/* Shared pagination: ul specificity also wins when Bootstrap is loaded later. */
ul.pagination {
    display: table;
    margin: 20px auto;
}

ul.pagination > li > a,
ul.pagination > li > span {
    border: 2px solid #f2f2f2;
    color: #00695c;
    background-color: #fff;
    font-weight: 400;
    margin: 2px;
    border-radius: 4px;
    transition: 350ms ease all;
}

ul.pagination > li:first-child > a,
ul.pagination > li:first-child > span,
ul.pagination > li:last-child > a,
ul.pagination > li:last-child > span {
    background-color: #f2f2f2;
}

ul.pagination-sm > li > a,
ul.pagination-sm > li > span {
    height: 30px;
    width: 30px;
    font-size: 12px;
}

ul.pagination-lg > li > a,
ul.pagination-lg > li > span {
    height: 40px;
    width: 40px;
}

ul.pagination > li > a:focus,
ul.pagination > li > a:hover,
ul.pagination > li > span:focus,
ul.pagination > li > span:hover {
    border-color: #00695c;
    background-color: #fff;
    color: #00695c;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.15);
}

ul.pagination > li > a:focus {
    outline: 2px solid #00695c;
    outline-offset: 2px;
}

ul.pagination > li.active > a,
ul.pagination > li.active > a:focus,
ul.pagination > li.active > a:hover,
ul.pagination > li.active > span,
ul.pagination > li.active > span:focus,
ul.pagination > li.active > span:hover {
    color: #fff;
    background-color: #00695c;
    border-color: #00695c;
}

ul.pagination > li.disabled > a,
ul.pagination > li.disabled > a:focus,
ul.pagination > li.disabled > a:hover,
ul.pagination > li.disabled > span,
ul.pagination > li.disabled > span:focus,
ul.pagination > li.disabled > span:hover {
    color: #6b7280;
    background-color: #f2f2f2;
    border-color: #f2f2f2;
    box-shadow: none;
    cursor: not-allowed;
}

/*.form-control  {
	color: #ad2a58;
}*/

.select2-container .select2-selection--single {
    height: 42px; /* ou qualquer altura que se adeque ao seu design */
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 40px; /* altura - 2px para alinhar o texto corretamente */
}

.select2-container {
    width: 100% !important;
}

.error-message  {
	background-color: #800;
	color: #fff;
	font-weight: bold;
}
.required label:after {
    color: #d00;
    content: " *"
}



fieldset { min-width: 100%; }

.table-responsive .table {
    max-width: none;
    -webkit-overflow-scrolling: touch !important;
}

/*.img-resp {
    width: 100%;
    height: auto;
}*/

/* WEB CAM */
#video {
  border: 1px solid black;
  box-shadow: 2px 2px 3px black;
  width:320px;
  height:240px;
}

#photo {
  border: 1px solid black;
  box-shadow: 2px 2px 3px black;
  width:320px;
  height:240px;
}

#canvas {
  display:none;
}

.camera {
  width: 340px;
  display:inline-block;
}

.output {
  width: 340px;
  display:inline-block;
}

#startbutton {
  display:block;
  position:relative;
  margin-left:auto;
  margin-right:auto;
  bottom:32px;
  background-color: rgba(0, 150, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0px 0px 1px 2px rgba(0, 0, 0, 0.2);
  font-size: 14px;
  font-family: "Lucida Grande", "Arial", sans-serif;
  color: rgba(255, 255, 255, 1.0);
}

.contentarea {
  font-size: 16px;
  font-family: "Lucida Grande", "Arial", sans-serif;
  width: 760px;
}
/* WEB CAM END */

/* Bulk cancel/reschedule modal (Schedules/add) */
#modal-bulk-cancel .modal-body,
#modal-bulk-cancel .modal-body * {
  color: #333 !important;
}
#modal-bulk-cancel #bulk-summary {
  color: #333 !important;
}
#modal-bulk-cancel .table thead th {
  color: #333 !important;
  background: #f7f7f7;
}
#modal-bulk-cancel .alert-warning {
  color: #8a6d3b !important;
}

/* Flash messages and alerts spacing */
.alert { margin: 12px 0; }
.message { margin: 12px 0; }

/* Global contrast fix for shared panel headers */
.panel-default > .panel-heading {
  background-color: #dfe7e3;
  border-color: #c7d3cd;
  color: #2b564d;
}

.panel-default > .panel-heading .panel-title,
.panel-default > .panel-heading strong,
.panel-default > .panel-heading small,
.panel-default > .panel-heading a:not(.btn),
.panel-default > .panel-heading .glyphicon,
.panel-default > .panel-heading .fa {
  color: inherit;
}

.panel-default > .panel-heading .badge {
  background-color: #387467;
  color: #fff;
}

/* Global contrast fix for shared default buttons */
.btn-default {
  background-color: #dfe7e3;
  border-color: #c7d3cd;
  color: #2b564d;
}

.btn-default:hover,
.btn-default:active,
.btn-default:focus,
.btn-default:active:focus,
.btn-default.active,
.open > .dropdown-toggle.btn-default {
  background-color: #d1ddd7;
  border-color: #b2c4bc;
  color: #244940;
}

.btn-default .glyphicon,
.btn-default .fa {
  color: inherit;
}

/* Global breadcrumb casing */
.breadcrumb,
.breadcrumb > li,
.breadcrumb > li > a,
.breadcrumb .breadcrumb-item,
.breadcrumb .breadcrumb-item > a {
  text-transform: uppercase;
}

/* Standard spacing between row actions in application tables. */
table td.actions > * + * {
  margin-left: 6px;
}

/* Shared filter panels, based on GenericFiles/recentPatientFiles. */
.fm-filter-panel {
  margin-bottom: 20px;
  border: 1px solid #dfe7e4;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(38, 74, 64, 0.06);
}

.fm-filter-panel--flush {
  margin-bottom: 0;
}

.fm-filter-panel--hidden {
  display: none;
}

.fm-filter-form {
  margin-bottom: 0;
}

.fm-filter-panel fieldset,
.fm-clean-layout .fm-filter-panel fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

form.fm-filter-panel {
  padding: 0 15px 18px;
  overflow: hidden;
}

form.fm-filter-panel::before {
  display: block;
  margin: 0 -15px 18px;
  padding: 12px 15px;
  border-bottom: 1px solid #dfe7e4;
  background: #f7faf9;
  color: #2b564d;
  content: attr(data-filter-title);
  font-size: 15px;
  font-weight: 600;
  line-height: 20px;
}

.fm-filter-heading,
.fm-filter-panel > .panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 15px;
  border-color: #dfe7e4;
  background: #f7faf9;
  color: #2b564d;
}

.fm-filter-title {
  display: flex;
  align-items: center;
  font-size: 15px;
}

.fm-filter-title .glyphicon,
.fm-filter-title .fa {
  margin-right: 7px;
}

.fm-filter-title .badge {
  margin-left: 7px;
}

.fm-filter-scope {
  color: #667a73;
  font-size: 12px;
  font-weight: 500;
}

.fm-filter-body,
.fm-filter-panel > .panel-body {
  padding: 18px 15px;
}

.fm-filter-panel .form-group {
  margin-bottom: 0;
}

.fm-filter-panel label {
  display: block;
  margin-bottom: 6px;
  color: #40544d;
  font-weight: 600;
}

.fm-filter-panel .form-control,
.fm-filter-panel .select2-container {
  width: 100% !important;
}

.fm-filter-grid {
  display: grid;
  gap: 12px;
  align-items: end;
}

.fm-filter-row + .fm-filter-row {
  margin-top: 12px;
}

.fm-filter-grid--patient-index {
  grid-template-columns:
    minmax(280px, 1fr)
    minmax(175px, 220px)
    minmax(155px, 200px)
    auto;
}

.fm-filter-grid--auto {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.fm-filter-field,
.fm-filter-field .input,
.fm-filter-field .form-group {
  min-width: 0;
  margin-bottom: 0;
}

.fm-filter-field label {
  line-height: 18px;
  white-space: nowrap;
}

.fm-filter-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-top: 25px;
}

.fm-filter-actions--end {
  justify-content: flex-end;
}

.fm-filter-actions--spread {
  justify-content: space-between;
}

.fm-filter-actions--compact {
  padding-top: 0;
}

.fm-filter-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 15px;
}

.fm-filter-toolbar__group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.fm-filter-toolbar__group--end {
  justify-content: flex-end;
  margin-left: auto;
}

.fm-filter-toolbar .btn {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.fm-filter-toolbar .btn .badge {
  margin-left: 2px;
}

.fm-filter-status {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid #e7cf94;
  border-radius: 4px;
  background: #fff9e9;
  color: #76530d;
  font-size: 12px;
  font-weight: 600;
  line-height: 20px;
  text-decoration: none;
}

.fm-filter-status:hover,
.fm-filter-status:focus,
.fm-filter-status.is-active {
  border-color: #d6b860;
  background: #fff2c9;
  color: #654606;
  text-decoration: none;
}

.fm-filter-status__count {
  display: inline-flex;
  min-width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border-radius: 11px;
  background: #e7c75f;
  color: #3e3108;
  font-size: 11px;
  line-height: 22px;
}

.fm-filter-meta {
  margin-top: 8px;
  color: #667a73;
  font-size: 12px;
}

.fm-filter-collapse {
  margin-top: 10px;
}

.fm-filter-checkboxes {
  padding-top: 25px;
}

.fm-filter-checkboxes .checkbox {
  margin-top: 0;
  margin-bottom: 8px;
}

.fm-filter-actions .btn,
.fm-filter-panel .btn:not(.btn-xs) {
  min-height: 34px;
  border-radius: 4px;
  white-space: nowrap;
}

.fm-clean-layout .fm-filter-panel .btn:not(.btn-xs) {
  min-height: 40px;
}

.fm-clean-layout .fm-filter-toolbar .btn,
.fm-clean-layout .fm-filter-status {
  min-height: 40px;
}

.fm-filter-actions .btn {
  display: inline-flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

form.fm-filter-panel > .form-group:last-of-type {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 14px;
  margin-bottom: 0;
}

@media (max-width: 991px) {
  .fm-filter-grid--patient-index {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  }

  .fm-filter-grid--patient-index .fm-filter-actions {
    grid-column: 1 / -1;
  }

  .fm-filter-actions {
    padding-top: 14px;
  }
}

@media (max-width: 767px) {
  form.fm-filter-panel {
    padding-right: 12px;
    padding-left: 12px;
  }

  form.fm-filter-panel::before {
    margin-right: -12px;
    margin-left: -12px;
  }

  .fm-filter-heading,
  .fm-filter-panel > .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .fm-filter-scope {
    margin-top: 4px;
  }

  .fm-filter-panel .form-group {
    margin-bottom: 14px;
  }

  .fm-filter-grid,
  .fm-filter-grid--patient-index {
    grid-template-columns: minmax(0, 1fr);
  }

  .fm-filter-grid--patient-index .fm-filter-actions {
    grid-column: auto;
  }

  .fm-filter-actions {
    display: flex;
    flex-direction: column;
    padding-top: 0;
  }

  .fm-filter-actions--spread {
    align-items: stretch;
  }

  .fm-filter-actions .btn {
    width: 100%;
  }

  .fm-filter-toolbar__group,
  .fm-filter-toolbar__group--end {
    width: 100%;
    justify-content: flex-start;
    margin-left: 0;
  }

  .fm-filter-toolbar__group--end .btn {
    flex: 1 1 auto;
  }

  .fm-filter-status {
    flex: 1 1 auto;
    justify-content: center;
  }

  .fm-filter-checkboxes {
    padding-top: 0;
  }
}

/* Audit result details share the app stylesheet instead of view-local CSS. */
.audit-help,
.audit-toolbar {
  margin-bottom: 15px;
}

.audit-details-cell {
  min-width: 380px;
}

.audit-context {
  margin-bottom: 6px;
  color: #777;
  font-size: 12px;
}

.audit-change-group summary {
  cursor: pointer;
  outline: none;
}

.audit-change-group[open] summary {
  margin-bottom: 8px;
}

.audit-change-list {
  margin: 0;
}

.audit-change-list li + li {
  margin-top: 6px;
}

.audit-change-label {
  font-weight: 600;
}

.audit-value-old {
  color: #a94442;
}

.audit-value-new {
  color: #3c763d;
}

.audit-arrow {
  padding: 0 5px;
  color: #999;
}

/* Appointment audit and financial transaction result helpers. */
.col-date {
  width: 100px;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hash-mono {
  display: inline-block;
  padding: 1px 4px;
  border-radius: 3px;
  background: #f5f5f5;
  font-family: Menlo, Consolas, monospace;
}

.collapse-toggle {
  display: block;
  color: inherit;
  text-decoration: none;
}

.collapse-toggle:hover {
  text-decoration: none;
}

.collapse-toggle .glyphicon {
  transition: transform 0.2s ease;
}

.collapse-toggle.collapsed .glyphicon {
  transform: rotate(180deg);
}

.desc-cell,
.desc-truncate {
  max-width: 220px;
}

.desc-truncate {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invoice-action {
  display: inline-flex;
  align-items: center;
  margin-left: 5px;
  vertical-align: middle;
}

.invoice-action-label {
  margin-right: 4px;
  color: #555;
  font-size: 11px;
  font-weight: 600;
}

.invoice-switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 20px;
  margin: 0;
}

.invoice-switch input {
  width: 0;
  height: 0;
  opacity: 0;
}

.invoice-slider {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  background: #aaa;
  cursor: pointer;
  transition: 0.2s;
}

.invoice-slider::before {
  position: absolute;
  bottom: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  content: "";
  transition: 0.2s;
}

.invoice-switch input:checked + .invoice-slider {
  background: #5cb85c;
}

.invoice-switch input:checked + .invoice-slider::before {
  transform: translateX(18px);
}

.invoice-switch input:disabled + .invoice-slider {
  cursor: not-allowed;
  opacity: 0.55;
}

.invoice-files-button {
  position: relative;
  margin-left: 3px;
}

.invoice-files-button .badge {
  position: absolute;
  top: -7px;
  right: -7px;
  padding: 2px 4px;
  background: #337ab7;
  font-size: 9px;
  line-height: 1;
}

.invoice-current-files {
  margin: 0;
  padding: 0;
  list-style: none;
}

.invoice-current-files li {
  padding: 6px 0;
  border-bottom: 1px solid #eee;
}

.invoice-current-files li:last-child {
  border-bottom: 0;
}

/* Shared dashboard presentation. */
.dashboard-filter-note {
  margin-top: 10px;
  color: #6f6f6f;
  font-size: 12px;
  text-align: left;
}

.dashboard-summary-note {
  display: block;
  margin-top: 6px;
  color: #6f6f6f;
  line-height: 1.5;
}

.dashboard-visible-hint {
  margin-bottom: 15px;
  border-left: 4px solid #31708f;
}

.finance-card-value,
.kpi-value {
  display: block;
  font-size: 24px;
  font-weight: 600;
}

.finance-card-hint,
.kpi-label {
  display: block;
  margin-top: 8px;
  color: #5f5f5f;
  font-size: 12px;
  line-height: 1.45;
}

.finance-card-hint {
  min-height: 36px;
}

.chart-hint {
  margin: 0 0 12px;
  color: #6f6f6f;
  font-size: 12px;
  line-height: 1.45;
}

.finance-split-label {
  display: block;
  color: #6f6f6f;
  font-size: 12px;
}

.finance-split-value {
  display: block;
  font-size: 20px;
  font-weight: 600;
}

.kpi-row {
  display: flex;
  flex-wrap: wrap;
  margin-right: -8px;
  margin-left: -8px;
}

.kpi-col {
  min-width: 180px;
  flex: 1 1 25%;
  padding: 0 8px;
}

.kpi-col .panel {
  height: 100%;
  border-top-width: 3px;
}

.kpi-label {
  margin-top: 6px;
  color: #6f6f6f;
}

.support-card {
  margin-top: 10px;
}

.dashboard-confirmations-empty {
  margin: 0;
  color: #4f5b66;
}

.dashboard-confirmations-note,
.dashboard-confirmations-counter {
  color: #4f5b66;
}

.dashboard-confirmations-panel-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.dashboard-confirmations-heading-title {
  color: #333;
  font-weight: 600;
}

.dashboard-confirmations-counter {
  font-weight: 400;
}

.dashboard-confirmations-toggle {
  flex: 0 0 auto;
}

.dashboard-confirmations-proof {
  min-width: 130px;
}

.dashboard-confirmations-proof .label {
  display: inline-block;
  margin-bottom: 3px;
}

.dashboard-confirmations-audit-summary .label {
  display: inline-block;
  margin-left: 10px;
}

/* View-specific rules centralized from migrated filter templates. */

/* src/Template/UsersUsers/index_clinic.ctp */
.clinic-attendance-not-informed {
        display: inline-block;
        padding: 3px 8px;
        border-radius: 3px;
        background-color: #4f5b66;
        color: #fff !important;
        font-weight: 600;
        line-height: 1.35;
    }

/* src/Template/AppSettings/whatsapp.ctp */
.wa-settings-layout,
    .wa-settings-top-grid,
    .wa-settings-main-grid {
        display: grid;
        gap: 16px;
    }

    .wa-settings-top-grid {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .wa-settings-main-grid {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .wa-settings-layout .panel {
        margin-bottom: 0;
    }

    .wa-conversation-messages-panel {
        margin-bottom: 16px;
    }

    .wa-quick-reply-row {
        margin-bottom: 12px;
        padding-bottom: 12px;
        border-bottom: 1px solid #edf1f3;
    }

    .wa-quick-reply-remove-column {
        padding-top: 25px;
    }

    .wa-rag-editor-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .wa-rag-markdown-input {
        min-height: 290px;
        font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
        font-size: 12px;
        line-height: 1.45;
        resize: vertical;
    }

    .wa-rag-preview-panel {
        min-height: 240px;
        max-height: 360px;
        overflow: auto;
        padding: 12px 14px;
        background: #fff;
        border: 1px solid #dfe7ea;
        border-radius: 8px;
    }

    .wa-rag-preview-title {
        margin-bottom: 10px;
        color: #334155;
        font-size: 12px;
        font-weight: 700;
        text-transform: uppercase;
    }

    .wa-rag-preview {
        color: #1f2933;
        font-size: 13px;
        line-height: 1.5;
    }

    .wa-rag-preview h2,
    .wa-rag-preview h3,
    .wa-rag-preview h4 {
        margin: 14px 0 8px;
        color: #17212b;
        font-weight: 700;
        letter-spacing: 0;
    }

    .wa-rag-preview h2 {
        font-size: 17px;
    }

    .wa-rag-preview h3 {
        font-size: 15px;
    }

    .wa-rag-preview h4 {
        font-size: 14px;
    }

    .wa-rag-preview p,
    .wa-rag-preview ul {
        margin: 0 0 10px;
    }

    .wa-rag-preview ul {
        padding-left: 18px;
    }

    .wa-rag-preview li + li {
        margin-top: 4px;
    }

    .wa-rag-preview hr {
        margin: 14px 0;
        border: 0;
        border-top: 1px solid #dfe7ea;
    }

    .wa-rag-preview code {
        word-break: normal;
    }

    .wa-rag-preview-empty {
        color: #6b7280;
        font-style: italic;
    }

    @media (min-width: 1500px) {
        .wa-rag-editor-grid {
            grid-template-columns: minmax(0, 1fr) minmax(280px, .9fr);
            align-items: stretch;
        }

        .wa-rag-preview-panel {
            max-height: 420px;
        }
    }

    .wa-settings .text-muted {
        color: #6b7280 !important;
    }

    .wa-settings code {
        white-space: normal;
        word-break: break-all;
    }

    .wa-settings .wa-rag-preview code {
        word-break: normal;
    }

    .wa-settings .small {
        line-height: 1.5;
    }

/* src/Template/AppSettings/whatsapp_menu.ctp */
.wa-menu-editor {
    max-width: 1500px;
    margin: 20px auto 32px;
}

.wa-menu-editor [hidden] {
    display: none !important;
}

.wa-menu-page-header {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    justify-content: space-between;
    margin-top: 0;
}

.wa-menu-page-header h2 {
    margin-top: 0;
}

.wa-menu-page-header p {
    margin-bottom: 0;
}

.wa-menu-page-header .text-muted {
    color: #5f6b76 !important;
}

.wa-menu-mode-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    margin-bottom: 18px;
    padding: 16px 18px;
    border: 1px solid #d8e1e8;
    border-left-width: 4px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .05);
}

.wa-menu-mode-card.is-active {
    border-left-color: #2e9d63;
    background: #f8fdf9;
}

.wa-menu-mode-card.is-inactive {
    border-left-color: #7b8794;
    background: #fafbfc;
}

.wa-menu-mode-icon {
    display: flex;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #e7ecef;
    color: #52616b;
    font-size: 16px;
}

.wa-menu-mode-card.is-active .wa-menu-mode-icon {
    background: #dff4e8;
    color: #21804e;
}

.wa-menu-mode-title {
    display: flex;
    gap: 9px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 4px;
    color: #263238;
}

.wa-menu-mode-content p {
    margin: 0;
    color: #52616b;
    line-height: 1.45;
}

.wa-menu-mode-content .wa-menu-mode-note {
    margin-top: 5px;
    color: #8a5a16;
}

.wa-menu-version-alert {
    margin-bottom: 18px;
}

.wa-menu-general-panel > .panel-heading {
    display: flex;
    gap: 10px;
    align-items: baseline;
    justify-content: space-between;
}

.wa-menu-options-heading {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
}

.wa-menu-item-counter {
    display: inline-block;
    margin-left: 7px;
    padding-left: 8px;
    border-left: 1px solid #cfd8dc;
    color: #6b7280;
    font-size: 12px;
    font-weight: 400;
}

.wa-menu-editor-help {
    display: flex;
    gap: 9px;
    align-items: flex-start;
    margin-bottom: 16px;
    padding: 11px 13px;
    border: 1px solid #dbe8f2;
    border-radius: 6px;
    background: #f5faff;
    color: #40566a;
    line-height: 1.45;
}

.wa-menu-editor-help .glyphicon {
    margin-top: 2px;
    color: #367da8;
}

.wa-menu-item-list {
    overflow: hidden;
}

.wa-menu-item-card {
    position: relative;
    margin-right: 0;
    margin-bottom: 14px;
    margin-left: calc(var(--menu-depth, 0) * 22px);
    border-color: #d8e1e8;
    border-left: 4px solid #7aa7c7;
    border-radius: 7px;
    box-shadow: 0 2px 6px rgba(15, 23, 42, .05);
    transition: margin .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.wa-menu-item-card[data-depth="1"] {
    border-left-color: #337ab7;
}

.wa-menu-item-card[data-depth="2"] {
    border-left-color: #5e9c76;
}

.wa-menu-item-card[data-depth="3"] {
    border-left-color: #9b7bb5;
}

.wa-menu-item-card:focus-within {
    border-color: #82b6d7;
    box-shadow: 0 3px 12px rgba(51, 122, 183, .14);
}

.wa-menu-item-heading {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    min-height: 49px;
    background: #f8fafb !important;
}

.wa-menu-item-identity {
    display: grid;
    grid-template-columns: auto minmax(80px, auto);
    gap: 2px 8px;
    min-width: 0;
    align-items: center;
}

.wa-menu-item-title-preview {
    min-width: 0;
    overflow: hidden;
    color: #263238;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wa-menu-item-path {
    grid-column: 1 / -1;
    overflow: hidden;
    color: #718096;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wa-menu-item-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex: 0 0 auto;
}

.wa-menu-item-actions .menu-action-badge {
    max-width: 210px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wa-menu-item-actions .remove-menu-item {
    padding-right: 7px;
    padding-left: 7px;
    color: #b73a3a;
}

.wa-menu-item-card .panel-body {
    padding-bottom: 5px;
}

.wa-menu-item-card .form-group {
    margin-bottom: 13px;
}

.wa-menu-item-card .help-block {
    min-height: 17px;
    margin: 4px 0 0;
    font-size: 11px;
}

.wa-menu-item-warning {
    margin-bottom: 14px;
    padding: 9px 12px;
}

.wa-menu-message-field textarea {
    resize: vertical;
}

.wa-menu-empty-state {
    display: flex;
    min-height: 190px;
    flex-direction: column;
    gap: 7px;
    align-items: center;
    justify-content: center;
    padding: 24px;
    border: 1px dashed #bdc8cf;
    border-radius: 8px;
    background: #fafbfc;
    color: #667781;
    text-align: center;
}

.wa-menu-empty-state > .glyphicon {
    margin-bottom: 4px;
    color: #91a1aa;
    font-size: 28px;
}

.wa-menu-empty-state .btn {
    margin-top: 8px;
}

.wa-menu-submit-bar {
    display: flex;
    gap: 14px;
    align-items: center;
    justify-content: space-between;
    margin-top: 18px;
    padding: 14px 16px;
    border: 1px solid #d8e1e8;
    border-radius: 7px;
    background: #fff;
    box-shadow: 0 3px 10px rgba(15, 23, 42, .06);
}

.wa-menu-submit-note {
    color: #63727c;
    font-size: 12px;
}

.wa-menu-submit-note .glyphicon {
    margin-right: 4px;
}

.wa-menu-submit-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

@media (max-width: 991px) {
    .wa-menu-item-card {
        margin-left: calc(var(--menu-depth, 0) * 12px);
    }

    .wa-menu-item-heading {
        align-items: flex-start;
    }

    .wa-menu-item-actions {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .wa-menu-item-actions .menu-action-badge {
        display: none;
    }
}

@media (max-width: 767px) {
    .wa-menu-editor {
        margin-top: 12px;
        padding-right: 10px;
        padding-left: 10px;
    }

    .wa-menu-page-header,
    .wa-menu-mode-card,
    .wa-menu-submit-bar {
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

    .wa-menu-page-header .btn,
    .wa-menu-mode-action .btn {
        width: 100%;
    }

    .wa-menu-mode-icon {
        display: none;
    }

    .wa-menu-general-panel > .panel-heading,
    .wa-menu-options-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .wa-menu-options-heading .btn {
        width: 100%;
    }

    .wa-menu-item-card {
        margin-left: calc(var(--menu-depth, 0) * 7px);
    }

    .wa-menu-item-heading {
        flex-direction: column;
    }

    .wa-menu-item-identity,
    .wa-menu-item-actions {
        width: 100%;
    }

    .wa-menu-item-actions .add-submenu-item {
        flex: 1 1 auto;
    }

    .wa-menu-submit-note {
        text-align: center;
    }

    .wa-menu-submit-actions {
        display: grid;
        grid-template-columns: 1fr;
    }
}

/* src/Template/AppSettings/whatsapp_onboarding.ctp */
.wa-onboarding-page .text-muted {
        color: #6b7280 !important;
    }

/* src/Template/Appointments/index_patient_appointments.ctp */
.patient-menu {
    margin: 10px 0 20px;
}

.patient-menu > li {
    margin: 0 5px 5px 0; /* espaço lateral e embaixo */
}

.patient-name-line {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.patient-plan-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #2f6fab;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
}

.patient-profile-header {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr) minmax(0, 1.2fr) 100px;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 14px;
}

.patient-profile-section {
    min-width: 0;
}

.patient-profile-section h5 {
    margin: 0 0 6px;
    line-height: 1.35;
}

.patient-profile-registration {
    margin-top: 4px;
}

.patient-profile-health .badge {
    margin: 0 4px 4px 0;
}

.patient-profile-muted {
    color: #777;
}

/* Registros removidos: preservar leitura e ações, com apresentação atenuada. */
.fm-record-removed,
.fm-record-removed > td {
    background-color: #f8f9fa;
    color: #667085 !important;
}

.fm-record-removed a:not(.btn),
.fm-record-removed .fm-person-age {
    color: #667085 !important;
}

.patient-profile-plan-line .patient-plan-badge {
    margin-left: 4px;
}

.patient-profile-photo {
    flex: 0 0 auto;
    text-align: right;
}

.patient-profile-photo img {
    width: 90px;
    height: 120px;
    border: 1px solid #ddd;
    background: #f7f7f7;
    object-fit: cover;
    object-position: var(--fm-profile-photo-position, 50% 35%);
}

/* opcional: empilhar em telas pequenas */
@media (max-width: 768px) {
    .patient-menu > li {
        display: block;
    }
    .patient-profile-header {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .patient-profile-photo {
        align-self: flex-end;
        justify-self: end;
    }
}
.json-data {
        font-family: Arial, sans-serif;
        line-height: 1.6;
    }
    .json-data ul {
        list-style-type: none;
        padding-left: 20px;
    }
    .json-data li {
        margin-bottom: 10px;
    }
    .json-data div {
        margin-bottom: 10px;
    }
    .json-data strong {
        color: #2c3e50;
    }

/* src/Template/Appointments/index_patient_appointments_tabs.ctp */
.patient-tabs {
    margin-top: 10px;
    border: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.patient-tabs > li {
    float: none;
}

.patient-tabs > li > a {
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    padding: 10px 14px;
    color: #333;
    background: #fafafa;
}

.patient-tabs > li.active > a,
.patient-tabs > li.active > a:focus,
.patient-tabs > li.active > a:hover {
    background: #f2fffb;
    border-color: #387467;
    color: #387467;
}

.patient-tab-content {
    background: #fff;
    border: 1px solid #e2e2e2;
    border-radius: 10px;
    padding: 15px;
    margin-top: 10px;
    max-width: 100%;
    overflow: visible;
}

.tab-section {
    margin-bottom: 24px;
}

.patient-tab-pane-shell,
.patient-tab-content .tab-pane,
.patient-tab-content .panel,
.patient-tab-content .users.index.large-9.medium-8.columns.content {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.patient-tab-content .tab-pane,
.patient-tab-content .users.index.large-9.medium-8.columns.content {
    float: none;
}

.patient-tab-pane-shell {
    padding: 0;
}

.patient-tab-content .table-responsive {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    border: 0;
}

.patient-tab-content .table-responsive > .table {
    margin-bottom: 0;
}

.patient-tab-content .dropdown-menu {
    z-index: 1060;
}

.patient-tab-content img,
.patient-tab-content iframe,
.patient-tab-content object,
.patient-tab-content embed {
    max-width: 100%;
}

.patient-tab-content pre {
    max-width: 100%;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.patient-tab-content .pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.patient-tab-content .pagination > li {
    display: inline-flex;
}

.tab-note {
    margin: 8px 0 14px;
    color: #666;
}

.patient-summary {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr) minmax(0, 1.2fr) 100px;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 14px;
}

.patient-summary-section {
    min-width: 0;
}

.patient-summary-section h5 {
    margin: 0 0 6px;
    line-height: 1.35;
}

.patient-summary-registration {
    margin-top: 4px;
}

.patient-summary-cpf {
    margin-top: 4px;
    color: #333;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.35;
}

.patient-summary-health .badge {
    margin: 0 4px 4px 0;
}

.patient-summary-muted {
    color: #777;
}

.patient-summary-plan-line .patient-plan-badge {
    margin-left: 4px;
}

.patient-summary-photo {
    flex: 0 0 auto;
    text-align: right;
}

.patient-summary-photo img {
    width: 90px;
    height: 120px;
    border: 1px solid #ddd;
    background: #f7f7f7;
    object-fit: cover;
    object-position: var(--fm-profile-photo-position, 50% 35%);
}

.patient-summary h3 {
    margin: 0;
}

.patient-overview-details {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 12px 0 14px;
}

.patient-overview-card {
    flex: 1 1 320px;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid #dfe9e6;
    border-radius: 8px;
    background: #f8fbfa;
}

.patient-overview-card h4 {
    margin: 0 0 8px;
    color: #2f3b38;
    font-size: 15px;
    font-weight: 600;
}

.patient-healthcare-plan-item {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    align-items: baseline;
    padding: 7px 0;
    border-top: 1px solid #e5ecea;
}

.patient-healthcare-plan-item:first-child {
    padding-top: 0;
    border-top: 0;
}

.patient-healthcare-plan-name {
    color: #245e52;
    font-weight: 600;
}

.patient-healthcare-card-number,
.patient-overview-note {
    color: #3f4947;
}

.patient-overview-note {
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.tab-actions {
    margin-top: 12px;
}

.patient-tabs-sticky-shell {
    position: sticky;
    top: 0;
    z-index: 1040;
    background: #fff;
    padding: 6px 0 8px;
    margin-bottom: 10px;
    border-bottom: 1px solid #e6e6e6;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
}

.patient-record-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 0;
}

.patient-tabs-quick-actions {
    padding: 10px;
    margin-top: 8px;
    border: 1px solid #dfe9e6;
    border-radius: 8px;
    background: #f7fbfa;
}

.patient-record-actions__item {
    display: inline-flex;
    max-width: 100%;
}

.patient-tab-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    margin-bottom: 14px;
}

.patient-tab-toolbar h3 {
    margin: 0;
    color: #2f3b38;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.3;
}

.tab-subtitle {
    margin: 0 0 12px;
    color: #4b5654;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.35;
}

.patient-tab-content .panel-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.35;
}

.patient-tab-toolbar .patient-record-actions {
    margin: 0;
}

.patient-record-actions .btn {
    margin: 0;
}

.patient-record-actions .dropdown-menu {
    z-index: 1065;
}

.patient-report-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 14px;
    margin-top: 10px;
}

.patient-report-option {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    padding: 8px;
    border: 1px solid #e1e8e6;
    border-radius: 6px;
    background: #fafcfc;
    font-weight: 400;
    cursor: pointer;
}

.patient-report-option input {
    margin-top: 2px;
}

.patient-tabs-sticky-shell .patient-tabs {
    margin-top: 0;
}

.embedded-container { margin-top: 0; }
.embedded-container .patient-tab-content { border: none; box-shadow: none; padding: 0; }
.embedded-container .patient-tabs-sticky-shell { top: 0; }
.embedded-container .patient-tabs { margin-top: 0; }
.embedded-container .tab-section { margin-bottom: 16px; }
.embedded-container .tab-note { margin-top: 0; }
.embedded-container .tc-iframe-offset { padding: 0 4px; }
.embedded-container .patient-summary { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.1fr) 82px; gap: 10px; }
.embedded-container .patient-summary-photo img { width: 72px; height: 96px; }
.embedded-container .patient-tab-pane-shell { padding: 0; }
@media (max-width: 768px) {
    .patient-summary {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .patient-summary-photo {
        align-self: flex-end;
        justify-self: end;
    }

    .patient-tabs-sticky-shell {
        padding: 6px 0;
    }

    .patient-tabs-quick-actions {
        padding: 8px;
    }

    .patient-record-actions__item,
    .patient-record-actions__item .btn,
    .patient-record-actions__item .btn-group {
        width: 100%;
    }

    .patient-record-actions__item .dropdown-toggle {
        width: 100%;
        text-align: left;
    }

    .patient-report-options {
        grid-template-columns: 1fr;
    }
}

/* Legacy patient archive. */
.legacy-archive-page {
    width: 100%;
    max-width: none;
}

.legacy-archive-page__intro {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}
.legacy-archive-page__intro p {
    margin: 0;
    color: #667085;
}
.legacy-archive-page__stats {
    display: grid;
    grid-template-columns: repeat(6, minmax(135px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.legacy-stat-card {
    display: flex;
    min-width: 0;
    min-height: 76px;
    flex-direction: column;
    justify-content: center;
    padding: 12px 14px;
    color: #344054;
    background: #fff;
    border: 1px solid #dfe6ee;
    border-radius: 6px;
    text-decoration: none;
}
.legacy-stat-card:hover,
.legacy-stat-card:focus,
.legacy-stat-card.is-active {
    color: #1f5f59;
    background: #f3faf8;
    border-color: #8fc8c1;
    text-decoration: none;
}
.legacy-stat-card__label {
    overflow: hidden;
    color: #667085;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.legacy-stat-card__value {
    margin-top: 4px;
    color: #1d2939;
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
}
.legacy-archive-page .panel {
    margin-bottom: 20px;
    border-color: #dfe6ee;
    box-shadow: none;
}
.legacy-archive-page .panel-heading {
    display: flex;
    min-height: 44px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #344054;
    background: #f8fafc;
    border-color: #dfe6ee;
}
.legacy-archive-page .panel-title {
    font-size: 15px;
    font-weight: 600;
}
.legacy-archive-page__filter-row {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
}
.legacy-archive-page__filter-row .form-group,
.legacy-archive-page__filter-row .input {
    margin-bottom: 0;
}
.legacy-archive-page__filter-actions {
    display: flex;
    gap: 7px;
}
.legacy-archive-page__filter-actions .btn {
    flex: 1 1 auto;
}
.legacy-archive-page__table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.legacy-archive-page__table {
    min-width: 1030px;
    margin-bottom: 0;
}
.legacy-archive-page__table > thead > tr > th {
    color: #475467;
    background: #fbfcfd;
    border-bottom-width: 1px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}
.legacy-archive-page__table > tbody > tr > td {
    vertical-align: middle;
}
.legacy-archive-page__patient {
    min-width: 230px;
}
.legacy-archive-page__name {
    display: block;
    color: #1d2939;
    font-weight: 600;
}
.legacy-archive-page__meta {
    display: block;
    margin-top: 3px;
    color: #667085;
    font-size: 12px;
}
.legacy-badge {
    display: inline-block;
    padding: 4px 9px;
    color: #344054;
    background: #eef2f6;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
    white-space: nowrap;
}
.legacy-badge--pending,
.legacy-badge--ambiguous {
    color: #8a4b08;
    background: #fff4df;
}
.legacy-badge--linked,
.legacy-badge--created {
    color: #176b3a;
    background: #e7f8ee;
}
.legacy-badge--ignored_duplicate {
    color: #667085;
    background: #f2f4f7;
}
.legacy-archive-page__empty {
    padding: 46px 20px !important;
    color: #667085;
    text-align: center;
}
.legacy-archive-page__empty .glyphicon {
    display: block;
    margin-bottom: 10px;
    color: #98a2b3;
    font-size: 24px;
}
.legacy-archive-page__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
.legacy-archive-page__footer p,
.legacy-archive-page__footer .pagination {
    margin: 0;
}
@media (max-width: 1199px) {
    .legacy-archive-page__stats {
        grid-template-columns: repeat(3, minmax(150px, 1fr));
    }
    .legacy-archive-page__filter-row > [class*="col-"] {
        margin-bottom: 12px;
    }
}
@media (max-width: 767px) {
    .legacy-archive-page__intro {
        align-items: flex-start;
        flex-direction: column;
    }
    .legacy-archive-page__stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .legacy-archive-page__filter-actions {
        width: 100%;
    }
    .legacy-archive-page__footer {
        align-items: flex-start;
        flex-direction: column;
    }
}
@media (max-width: 420px) {
    .legacy-archive-page__stats {
        grid-template-columns: 1fr;
    }
}


/* Shared person-photo framing. Keep the focal point slightly above center. */
:root {
  --fm-profile-photo-position: 50% 35%;
}

.fm-profile-photo {
  background: #f3f4f6;
  object-fit: cover;
  object-position: 50% 35%;
  object-position: var(--fm-profile-photo-position);
}

.fm-profile-photo--avatar {
  width: 64px;
  height: 64px;
  border: 2px solid #d8e2de;
  border-radius: 50%;
}

.fm-profile-photo-control {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  text-align: left;
}

.fm-profile-photo-trigger {
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  line-height: 0;
}

.fm-profile-photo-trigger:focus {
  outline: 2px solid #387467;
  outline-offset: 2px;
}

.fm-profile-photo-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}

.fm-profile-photo-hint,
.fm-profile-photo-status {
  display: block;
  max-width: 260px;
  color: #667085;
  font-size: 12px;
  line-height: 1.35;
}

.fm-profile-photo-status.is-success {
  color: #166534;
}

.fm-profile-photo-status.is-error {
  color: #b42318;
}

.fm-profile-photo-status.is-loading {
  color: #1d4ed8;
}

.fm-record-profile-photo-control {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
}

.fm-record-profile-photo-trigger {
  position: relative;
  display: inline-block;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  line-height: 0;
  cursor: pointer;
}

.fm-record-profile-photo-trigger:focus {
  outline: 2px solid #387467;
  outline-offset: 3px;
}

.fm-record-profile-photo-trigger:hover .fm-record-profile-photo-camera,
.fm-record-profile-photo-trigger:focus .fm-record-profile-photo-camera {
  background: #285c50;
  transform: scale(1.06);
}

.fm-record-profile-photo-camera {
  position: absolute;
  right: 5px;
  bottom: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #387467;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .28);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  transition: background .15s ease, transform .15s ease;
}

.fm-record-profile-photo-status {
  max-width: 160px;
  text-align: right;
}

/* Shared profile-photo capture and crop editor (webcam.html). */
.fm-profile-photo-capture-page,
.fm-profile-photo-capture-page * {
  box-sizing: border-box;
}

.fm-profile-photo-capture-page {
  margin: 0;
  background: #fff;
  color: #263238;
  font-family: Arial, sans-serif;
}

.fm-profile-photo-capture-page .profile-capture {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: 14px;
}

.fm-profile-photo-capture-page .profile-capture h1 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 700;
}

.fm-profile-photo-capture-page .profile-capture-intro {
  margin: 0 0 12px;
  color: #667085;
  font-size: 13px;
  line-height: 1.4;
}

.fm-profile-photo-capture-page .capture-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  border-bottom: 1px solid #dfe5e2;
}

.fm-profile-photo-capture-page .capture-tab {
  padding: 8px 12px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: #52635d;
  font-weight: 600;
}

.fm-profile-photo-capture-page .capture-tab.is-active {
  border-bottom-color: #387467;
  color: #2b5f54;
}

.fm-profile-photo-capture-page .capture-panel[hidden],
.fm-profile-photo-capture-page .photo-editor-controls[hidden] {
  display: none;
}

.fm-profile-photo-capture-page .camera-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  margin-bottom: 8px;
}

.fm-profile-photo-capture-page .camera-toolbar label {
  margin: 0;
  color: #475467;
  font-size: 12px;
}

.fm-profile-photo-capture-page .camera-toolbar select {
  width: 100%;
  margin-top: 3px;
}

.fm-profile-photo-capture-page .mirror-control {
  padding-bottom: 7px;
  white-space: nowrap;
}

.fm-profile-photo-capture-page .camera-stage {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  background: #111;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
}

.fm-profile-photo-capture-page #video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fm-profile-photo-capture-page .face-guide {
  position: absolute;
  top: 9%;
  left: 29%;
  width: 42%;
  height: 66%;
  border: 2px dashed rgba(255, 255, 255, .82);
  border-radius: 48% 48% 44% 44%;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, .08);
  pointer-events: none;
}

.fm-profile-photo-capture-page .face-guide-label {
  position: absolute;
  right: 8px;
  bottom: 7px;
  padding: 3px 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, .58);
  color: #fff;
  font-size: 11px;
  pointer-events: none;
}

.fm-profile-photo-capture-page .capture-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.fm-profile-photo-capture-page .capture-actions .btn {
  flex: 1 1 0;
}

.fm-profile-photo-capture-page .upload-box {
  padding: 18px;
  border: 2px dashed #bcc9c4;
  border-radius: 10px;
  background: #f8faf9;
  text-align: center;
}

.fm-profile-photo-capture-page .upload-box input {
  width: 100%;
}

.fm-profile-photo-capture-page .upload-help {
  margin: 8px 0 0;
  color: #667085;
  font-size: 12px;
}

.fm-profile-photo-capture-page .photo-preview-shell {
  margin-top: 12px;
}

.fm-profile-photo-capture-page .photo-preview-shell h2 {
  margin: 0 0 6px;
  font-size: 14px;
}

.fm-profile-photo-capture-page .photo-preview {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  width: 220px;
  max-width: 100%;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  border: 2px solid #b9c7c2;
  border-radius: 50%;
  outline: 0;
  background: #f2f4f3;
  cursor: grab;
  touch-action: none;
}

.fm-profile-photo-capture-page .photo-preview:focus {
  border-color: #387467;
  box-shadow: 0 0 0 3px rgba(56, 116, 103, .18);
}

.fm-profile-photo-capture-page .photo-preview.is-dragging {
  cursor: grabbing;
}

.fm-profile-photo-capture-page #photo {
  position: absolute;
  top: 0;
  left: 0;
  display: none;
  max-width: none;
  user-select: none;
  pointer-events: none;
}

.fm-profile-photo-capture-page .photo-placeholder {
  max-width: 145px;
  color: #98a2b3;
  font-size: 12px;
  text-align: center;
}

.fm-profile-photo-capture-page .photo-editor-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 10px;
  align-items: end;
  max-width: 320px;
  margin: 10px auto 0;
}

.fm-profile-photo-capture-page .photo-editor-controls label {
  margin: 0;
  color: #475467;
  font-size: 12px;
  font-weight: 600;
}

.fm-profile-photo-capture-page .photo-editor-controls input[type="range"] {
  display: block;
  width: 100%;
  margin: 5px 0 0;
}

.fm-profile-photo-capture-page .photo-editor-help {
  grid-column: 1 / -1;
  margin: 0;
  color: #667085;
  font-size: 11px;
  line-height: 1.35;
  text-align: center;
}

.fm-profile-photo-capture-page .use-photo {
  width: 100%;
  margin-top: 12px;
}

.fm-profile-photo-capture-page .capture-status {
  display: none;
  margin: 10px 0 0;
  padding: 8px 10px;
  border-radius: 5px;
  font-size: 12px;
}

.fm-profile-photo-capture-page .capture-status.is-visible {
  display: block;
}

.fm-profile-photo-capture-page .capture-status.is-info {
  background: #eaf2ff;
  color: #1d4ed8;
}

.fm-profile-photo-capture-page .capture-status.is-warning {
  background: #fff7e6;
  color: #8a4b08;
}

.fm-profile-photo-capture-page .capture-status.is-success {
  background: #eaf7ef;
  color: #166534;
}

.fm-profile-photo-capture-page #canvas {
  display: none;
}

@media (max-width: 440px) {
  .fm-profile-photo-capture-page .profile-capture {
    padding: 10px;
  }

  .fm-profile-photo-capture-page .camera-toolbar {
    grid-template-columns: 1fr;
  }

  .fm-profile-photo-capture-page .mirror-control {
    padding-bottom: 0;
  }
}

/* Full-width response fields without global input rules. */
.fm-full-width-fields input[type="text"] {
    width: 100%;
    box-sizing: border-box;
}

/* Reusable document dialog. */
.simple-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background: rgba(0,0,0,.45);
}

.simple-modal .box {
    background: #fff;
    margin: 5% auto;
    padding: 15px;
    border-radius: 6px;
    max-width: 720px;
}

.simple-modal .box h4 {
    margin-top: 0;
}

.simple-modal .row {
    margin-left: -7px;
    margin-right: -7px;
}

.simple-modal [class^=col-] {
    padding-left: 7px;
    padding-right: 7px;
}

.simple-modal .close-modal {
    float: right;
    border: none;
    background: transparent;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.simple-modal .help {
    font-size: 12px;
    color: #777;
}

.simple-modal .doc-label {
    margin-top: 10px;
    margin-bottom: 5px;
}

.simple-modal .doc-hint {
    font-size: 12px;
    color: var(--fm-brand-link, #2e7d32);
}

.simple-modal .divider {
    border-top: 1px solid #eee;
    margin: 10px 0;
}

/* Shared treatment approval and fingerprint capture. */
.fm-treatment-form .section-title {
    font-size: 16px;
    font-weight: 600;
    margin: 10px 0;
}

.fm-treatment-form .summary-card {
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    padding: 10px;
    background: #fcfcfc;
}

.fm-treatment-form .summary-item {
    margin: 4px 0;
}

.fm-treatment-form .fp-card {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
}

.fm-treatment-form .fp-preview {
    width: 180px;
    height: 240px;
    border: 1px solid #999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
    cursor: pointer;
}

.fm-treatment-form .fp-preview img {
    max-width: 100%;
    max-height: 100%;
}

.fm-treatment-form .fp-meta {
    font-size: 12px;
    color: #555;
    margin-top: 8px;
}

.fm-treatment-form .fp-quality-bar {
    height: 8px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;
}

.fm-treatment-form .fp-quality-fill {
    height: 100%;
    width: 0;
    background: #d9534f;
    transition: width .2s ease;
}

.fm-treatment-form .fp-quality-label {
    font-size: 12px;
    margin-top: 4px;
}

.fm-treatment-form .fp-actions .btn {
    margin-right: 6px;
    margin-top: 6px;
}



/* Shared financial semantics are independent of the tenant's brand. */
.fm-financial-positive,
.fm-clean-layout .table > tbody > tr > td.fm-financial-positive {
    color: #0000ff;
}

.fm-financial-negative,
.fm-clean-layout .table > tbody > tr > td.fm-financial-negative {
    color: #ff0000;
}

.fm-emphasis {
    font-weight: 700;
}
/* Shared navigation search for authenticated clean and legacy shells. */
.fm-feature-search { min-width: 0; width: 100%; max-width: 560px; justify-self: center; }
.fm-feature-search[hidden] { display: none; }
.fm-feature-search__trigger.btn { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 8px 12px; text-align: left; color: #475569; background: #f8fafb; border: 1px solid #dbe5ea; border-radius: 8px; text-transform: none; letter-spacing: normal; font-size: 14px; font-weight: 400; }
.fm-feature-search__trigger span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fm-feature-search__trigger kbd { color: #64748b; background: #fff; box-shadow: none; border: 1px solid #dbe5ea; font-size: 11px; }
.fm-feature-search__trigger:focus-visible, .fm-feature-search__dialog input:focus { outline: 2px solid var(--fm-brand-primary, #00695c); outline-offset: 2px; }
.fm-feature-search__dialog { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); margin: 0; width: 640px; max-width: calc(100% - 32px); max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); padding: 24px; border: 1px solid #dbe5ea; border-radius: 16px; color: #253746; background: #fff; box-shadow: 0 16px 60px rgba(15,23,42,.25); z-index: 2000; font-size: 14px; text-align: left; }
.fm-feature-search__dialog::backdrop { background: rgba(15,23,42,.45); }
.fm-feature-search__heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.fm-feature-search__heading h2 { margin: 0; font-size: 20px; line-height: 1.3; color: #17212b; }
.fm-feature-search__heading .btn { min-height: 44px; }
.fm-feature-search__dialog .form-control { height: 46px; font-size: 16px; }
.fm-feature-search__dialog .help-block { margin: 10px 0; color: #526478; font-size: 12px; }
.fm-feature-search__results { display: grid; gap: 6px; max-height: min(440px, 52vh); overflow-y: auto; overscroll-behavior: contain; }
.fm-feature-search__results > a { display: grid; gap: 3px; padding: 12px; border: 1px solid transparent; border-radius: 8px; color: #253746; background: #fff; text-decoration: none; white-space: normal; line-height: 1.4; }
.fm-feature-search__results > a small { color: #526478; }
.fm-feature-search__results > a span { color: #526478; font-size: 13px; }
.fm-feature-search__results > a:hover, .fm-feature-search__results > a[aria-selected=true] { background: var(--fm-brand-primary-soft, #eaf7f4); border-color: var(--fm-brand-primary, #00695c); text-decoration: none; }
.fm-feature-search__results > a strong { color: var(--fm-brand-link, #00695c); }
.fm-feature-search__admin { margin-top: 16px; border-top: 1px solid #dbe5ea; padding-top: 14px; }
.fm-feature-search__admin summary { cursor: pointer; margin-bottom: 10px; }
.fm-feature-search-legacy { width: 260px; margin: 16px 12px; }
.navbar-header > .fm-feature-search-legacy { float: left; }
@media (max-width: 680px) {
    .fm-app-topbar .fm-feature-search { max-width: 44px; justify-self: start; }
    .fm-feature-search__trigger.btn { justify-content: center; width: 44px; min-height: 44px; padding: 10px; }
    .fm-feature-search__trigger span, .fm-feature-search__trigger kbd { display: none; }
    .fm-feature-search__dialog { max-width: calc(100% - 24px); padding: 16px; }
    .fm-feature-search__heading h2 { font-size: 18px; }
    .fm-feature-search-legacy { width: 44px; margin: 16px 8px; }
}


/* Attendance queue: styles remain restricted to its page. */
/* Alinhamento padrão à esquerda nas tabelas da fila */
.schedule-queue-page .table th, .schedule-queue-page .table td { text-align: left; }
.schedule-queue-page .table th.text-right, .schedule-queue-page .table td.text-right { text-align: right; }
.schedule-queue-page .queue-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  min-width: 230px;
  max-width: 420px;
  margin-left: auto;
}
.schedule-queue-page .queue-actions > form {
  display: inline-flex !important;
  margin: 0;
}
.schedule-queue-page .queue-actions .btn {
  white-space: nowrap;
  min-height: 30px;
  padding: 5px 8px;
}
.schedule-queue-page .queue-actions .btn-warning { color: #513300; }
@media (min-width: 1200px) {
  .schedule-queue-page .queue-actions { width: max-content; max-width: none; flex-wrap: nowrap; }
}
@media (max-width: 767px) {
  .schedule-queue-page .queue-actions { width: 240px; }
  .schedule-queue-page .queue-actions > form,
  .schedule-queue-page .queue-actions > a { flex: 1 0 110px; }
  .schedule-queue-page .queue-actions > form > .btn { width: 100%; }
  .schedule-queue-page .queue-actions .btn { min-height: 36px; }
}

/* Attendance queue popup. */
/* Garantir contraste e legibilidade no modal */
#modal-queue .modal-dialog { width: 95%; max-width: 1200px; }
.queue-widget { color: #000; }
.queue-widget .panel { background-color: #fff; }
.queue-widget .panel-heading { background-color: #337ab7; color: #fff; }
.queue-widget .btn { margin-left: 4px; }
/* Alinhamento padrão à esquerda no conteúdo e cabeçalhos, exceto ações */
.queue-widget table th, .queue-widget table td { text-align: left; }
.queue-widget table th.text-right, .queue-widget table td.text-right { text-align: right; }
