@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #eef2f4;
  --card: #fcfdfd;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --primary: #0f766e;
  --primary-dark: #0b5c56;
  --danger: #b91c1c;
  --danger-dark: #991b1b;
  --shadow: 0 10px 24px rgba(15, 37, 65, 0.08);
  --control-height: 48px;
  --control-radius: 12px;
  --control-padding-x: 12px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top right, rgba(15, 118, 110, 0.04), transparent 24%),
    linear-gradient(180deg, #f3f6f7 0%, var(--bg) 280px);
  color: var(--text);
  font-family: "Manrope", "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

.topbar {
  background: linear-gradient(90deg, #0f766e, #138a7d);
  color: #fff;
  padding: 12px 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  box-shadow: 0 14px 26px rgba(15, 37, 65, 0.12);
}

.topbar-brand {
  font-weight: 800;
  display: none;
}

.topbar-left {
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 14px;
}

.menu {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-self: center;
}

.menu a {
  color: #fff;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.15);
  padding: 6px 10px;
  border-radius: 8px;
  transition: background 0.18s ease, transform 0.18s ease;
}

.menu a:hover,
.menu a:focus-visible {
  outline: none;
  background: rgba(255, 255, 255, 0.24);
  transform: translateY(-1px);
}

.menu a.is-active {
  background: rgba(255, 255, 255, 0.3);
}

.topbar-logout,
.topbar-account {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 6px 12px;
  text-decoration: none;
  font-weight: 700;
}

.topbar-logout {
  background: #fff;
  color: #475569;
}

.topbar-account {
  justify-self: end;
  min-width: 112px;
  background: #fff;
  color: #475569;
}

.topbar-account::before {
  content: "";
  inline-size: 12px;
  block-size: 12px;
  margin-right: 8px;
  border: 2px solid #64748b;
  border-radius: 50%;
}

.container {
  max-width: 1320px;
  margin: 18px auto;
  padding: 0 14px;
}

body[data-page="home"] .container {
  max-width: 1640px;
}

body[data-page="home"] .menu a {
  padding: 9px 14px;
  font-size: 1rem;
  font-weight: 700;
}

body[data-page="home"] .topbar-logout,
body[data-page="home"] .topbar-account {
  min-height: 40px;
  padding: 8px 16px;
  font-size: 1rem;
}

body[data-page="cadh"] .menu a,
body[data-page="cadh-cardiologia"] .menu a,
body[data-page="cadh-endocrino"] .menu a,
body[data-page="cadh-psicologia"] .menu a,
body[data-page="cadh-enfermagem"] .menu a {
  padding: 10px 16px;
  font-size: 1.08rem;
  font-weight: 800;
}

body[data-page="cadh"] .topbar-logout,
body[data-page="cadh"] .topbar-account,
body[data-page="cadh-cardiologia"] .topbar-logout,
body[data-page="cadh-cardiologia"] .topbar-account,
body[data-page="cadh-endocrino"] .topbar-logout,
body[data-page="cadh-endocrino"] .topbar-account,
body[data-page="cadh-psicologia"] .topbar-logout,
body[data-page="cadh-psicologia"] .topbar-account,
body[data-page="cadh-enfermagem"] .topbar-logout,
body[data-page="cadh-enfermagem"] .topbar-account {
  min-height: 44px;
  padding: 9px 18px;
  font-size: 1.08rem;
}

body[data-page="patients-list"] .container,
body[data-page="patients-trash"] .container,
body[data-page="care-plans-list"] .container,
body[data-page="care-plans-trash"] .container,
body[data-page="encounters-list"] .container,
body[data-page="encounters-trash"] .container,
body[data-page="transitions-list"] .container,
body[data-page="transitions-trash"] .container {
  max-width: 1460px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 18px;
  box-shadow: 0 18px 36px rgba(15, 37, 65, 0.06);
}

.page-title {
  margin: 0 0 16px 0;
  font-size: 1.35rem;
}

.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.page-heading .page-title {
  margin: 0;
}

.page-subtitle {
  margin: -8px 0 18px 0;
  color: var(--muted);
}

.actions,
.toolbar,
.tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.toolbar {
  justify-content: space-between;
  margin-bottom: 16px;
}

.search-toolbar {
  align-items: stretch;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, rgba(15, 118, 110, 0.04), transparent 28%),
    linear-gradient(180deg, rgba(15, 118, 110, 0.035), rgba(15, 118, 110, 0));
}

.search-toolbar input {
  flex: 1 1 auto;
}

.search-toolbar .actions {
  margin-left: auto;
}

.search-toolbar .search-input-shell {
  flex: 1 1 360px;
}

.cadh-ses-search .search-input-shell {
  flex: 0 0 auto;
  width: 100%;
  align-self: stretch;
}

.search-input-shell {
  position: relative;
  width: 100%;
  min-width: 0;
}

.search-input-shell-has-suggestions {
  z-index: 30;
}

.search-input-shell-has-suggestions input {
  border-color: rgba(15, 118, 110, 0.36);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.search-input-icon {
  position: absolute;
  inset: 50% auto auto 14px;
  display: grid;
  place-items: center;
  color: #94a3b8;
  pointer-events: none;
  transform: translateY(-50%);
}

.search-input-icon svg {
  inline-size: 18px;
  block-size: 18px;
  fill: currentColor;
}

.search-suggestions {
  position: absolute;
  inset: calc(100% + 8px) 0 auto 0;
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid rgba(15, 118, 110, 0.14);
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, rgba(15, 118, 110, 0.08), transparent 34%),
    #fff;
  box-shadow: 0 18px 34px rgba(15, 37, 65, 0.14);
  max-height: 280px;
  overflow: auto;
}

.search-suggestions[hidden] {
  display: none;
}

.search-suggestion {
  width: 100%;
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: #173045;
  text-align: left;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.search-suggestion:hover,
.search-suggestion:focus-visible,
.search-suggestion.is-active {
  outline: none;
  background: rgba(15, 118, 110, 0.08);
  border-color: rgba(15, 118, 110, 0.16);
  transform: translateY(-1px);
}

.search-suggestion-name {
  font-weight: 800;
  line-height: 1.3;
}

.search-suggestion-meta {
  color: #64748b;
  font-size: 0.84rem;
  line-height: 1.4;
  font-weight: 600;
}

.btn,
button,
input,
select,
textarea {
  font: inherit;
}

.btn,
button {
  border-radius: 14px;
  border: 1px solid #d8e2e8;
  background: linear-gradient(180deg, #ffffff, #f7fafb);
  color: var(--text);
  padding: 9px 14px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.btn:hover,
button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(15, 37, 65, 0.08);
}

.btn-primary {
  background: linear-gradient(180deg, #138178, var(--primary));
  border-color: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  background: var(--danger-dark);
}

.clinical-modal-close {
  --clinical-close-size: 42px;
  --clinical-close-border: var(--border);
  --clinical-close-bg: #ffffff;
  --clinical-close-color: var(--text);
  --clinical-close-hover-bg: #f8fafc;
  --clinical-close-hover-color: var(--clinical-close-color);
  inline-size: var(--clinical-close-size) !important;
  block-size: var(--clinical-close-size) !important;
  min-inline-size: var(--clinical-close-size);
  min-block-size: var(--clinical-close-size) !important;
  display: inline-grid !important;
  place-items: center;
  flex: 0 0 var(--clinical-close-size);
  position: relative;
  padding: 0 !important;
  border: 1px solid var(--clinical-close-border);
  border-radius: 10px;
  background: var(--clinical-close-bg);
  color: var(--clinical-close-color);
  font-size: 0 !important;
  line-height: 1;
  cursor: pointer;
}

.clinical-modal-close::before,
.clinical-modal-close::after {
  content: "";
  position: absolute;
  inline-size: 17px;
  block-size: 2.5px;
  border-radius: 999px;
  background: currentColor;
}

.clinical-modal-close::before {
  transform: rotate(45deg);
}

.clinical-modal-close::after {
  transform: rotate(-45deg);
}

.clinical-modal-close:hover,
.clinical-modal-close:focus-visible {
  outline: none;
  background: var(--clinical-close-hover-bg);
  color: var(--clinical-close-hover-color);
  box-shadow: none;
  transform: none;
}

.btn-link {
  background: transparent;
  border: none;
  padding: 0;
  color: var(--primary-dark);
}

.field,
.field-full {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.field-full {
  grid-column: 1 / -1;
}

.field label,
.field-full label {
  font-weight: 600;
}

.field-help {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  inline-size: 1px !important;
  block-size: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

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

.form-section {
  margin-bottom: 20px;
}

.form-section-title {
  margin: 0 0 14px 0;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #274c7c;
}

input,
select,
textarea,
.date-picker-trigger {
  width: 100%;
  min-height: var(--control-height);
  border: 1px solid var(--border);
  border-radius: var(--control-radius);
  padding: 0 var(--control-padding-x);
  background: #fff;
}

.search-input-control {
  padding-left: 42px;
}

input::placeholder,
textarea::placeholder {
  color: #94a3b8;
}

input:focus,
select:focus,
textarea:focus,
.date-picker-trigger:focus-visible {
  outline: none;
  border-color: rgba(15, 118, 110, 0.48);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

textarea {
  min-height: 160px;
  resize: none;
  overflow: auto;
  padding: 12px;
}

.date-picker-native-input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.date-picker {
  position: relative;
  width: 100%;
}

.date-picker.is-open {
  z-index: 1600;
}

.date-picker.is-invalid .date-picker-trigger {
  border-color: #fca5a5;
  box-shadow: 0 0 0 4px rgba(185, 28, 28, 0.12);
}

.date-picker-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text);
  text-align: left;
  box-shadow: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.date-picker-trigger:hover,
.date-picker.is-open .date-picker-trigger {
  border-color: var(--border);
  box-shadow: none;
}

.date-picker-trigger:focus-visible {
  border-color: rgba(15, 118, 110, 0.48);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.date-picker-trigger-text {
  display: block;
  min-width: 0;
  flex: 1;
  text-align: left;
}

.date-picker-trigger-value {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-weight: 400;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.date-picker-trigger.is-empty .date-picker-trigger-value,
.date-picker-trigger.is-empty .date-picker-trigger-help {
  color: #94a3b8;
}

.date-picker-trigger-help {
  display: none;
}

.date-picker-trigger-help:empty {
  display: none;
}

.date-picker-trigger-icon {
  flex: 0 0 auto;
  inline-size: 28px;
  block-size: 28px;
  display: grid;
  place-items: center;
  color: var(--primary);
}

.date-picker-trigger-icon svg {
  inline-size: 18px;
  block-size: 18px;
  fill: currentColor;
}

.date-picker-popover {
  position: absolute;
  inset: calc(100% + 10px) auto auto 0;
  width: min(340px, calc(100vw - 24px));
  min-width: min(312px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  padding: 12px;
  border: 1px solid rgba(15, 118, 110, 0.14);
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, rgba(15, 118, 110, 0.12), transparent 42%),
    #fff;
  box-shadow: 0 22px 40px rgba(15, 37, 65, 0.16);
  z-index: 1600;
}

.date-picker-header {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 40px;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.date-picker-selects {
  display: grid;
  grid-template-columns: minmax(92px, 1fr) minmax(86px, 0.8fr);
  gap: 8px;
  min-width: 0;
}

.date-picker-select {
  min-height: 40px;
  min-width: 0;
  padding-inline: 10px 8px;
  border-radius: 10px;
  border-color: rgba(15, 118, 110, 0.15);
  background-color: rgba(243, 249, 248, 0.98);
  font-size: 0.92rem;
}

.date-picker-nav {
  inline-size: 40px;
  block-size: 40px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(15, 118, 110, 0.08);
  color: var(--primary-dark);
}

.date-picker-nav:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.date-picker-weekdays,
.date-picker-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.date-picker-weekdays {
  margin-bottom: 8px;
  color: #698291;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.date-picker-weekdays span {
  display: grid;
  place-items: center;
  min-height: 24px;
}

.date-picker-grid {
  gap: 3px;
}

.date-picker-day {
  min-height: 38px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #203243;
  font-weight: 600;
}

.date-picker-day:hover:not(:disabled),
.date-picker-day:focus-visible {
  outline: none;
  background: rgba(15, 118, 110, 0.1);
  color: var(--primary-dark);
}

.date-picker-day.is-selected {
  background: linear-gradient(180deg, #d7efe8, #c7e8df);
  color: #0d4f49;
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.18);
}

.date-picker-day.is-today:not(.is-selected) {
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.32);
  color: var(--primary-dark);
}

.date-picker-day.is-outside {
  color: #9caab8;
}

.date-picker-day:disabled {
  opacity: 0.34;
  cursor: not-allowed;
}

.date-picker-footer {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.date-picker-status {
  color: #64808f;
  font-size: 0.82rem;
}

.date-picker-footer-actions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.form-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  margin-top: 22px;
}

.form-actions.field-full {
  grid-column: 1 / -1;
}

.form-actions .btn,
.form-actions button {
  display: inline-flex;
  align-items: center;
  min-width: 180px;
  min-height: 48px;
  text-align: center;
  justify-content: center;
  border-radius: 12px;
}

.status-toggle {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: min(100%, 420px);
  padding: 8px;
  border: 1px solid rgba(15, 118, 110, 0.16);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(15, 118, 110, 0.06), rgba(15, 118, 110, 0.025));
}

.status-toggle-option {
  min-height: 46px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: transparent;
  color: #476072;
  font-weight: 700;
  box-shadow: none;
}

.status-toggle-option:hover,
.status-toggle-option:focus-visible {
  background: rgba(15, 118, 110, 0.06);
  box-shadow: none;
}

.status-toggle-option.is-selected {
  border-color: rgba(15, 118, 110, 0.18);
  background: #ffffff;
  color: #10384a;
  box-shadow: 0 8px 18px rgba(15, 37, 65, 0.08);
}

.status-toggle-option[data-status-value="ativo"].is-selected {
  border-color: #bbf7d0;
  color: #166534;
  background: #ecfdf5;
}

.status-toggle-option[data-status-value="inativo"].is-selected {
  border-color: #fecaca;
  color: #b91c1c;
  background: #fff1f2;
}

.field-error {
  color: var(--danger);
  font-size: 0.9rem;
}

.alert {
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
}

.alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.alert-info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
}

.modal-open {
  overflow: hidden;
}

.confirmation-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.46);
}

.confirmation-modal-overlay[hidden] {
  display: none;
}

.confirmation-modal {
  width: min(440px, 100%);
  display: grid;
  gap: 14px;
  padding: 24px;
  border: 1px solid rgba(15, 37, 65, 0.08);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 24px 56px rgba(15, 37, 65, 0.22);
}

.confirmation-modal:focus {
  outline: none;
}

.confirmation-modal-icon {
  inline-size: 44px;
  block-size: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #fff3f2;
  color: var(--danger);
}

.confirmation-modal-icon svg {
  inline-size: 24px;
  block-size: 24px;
  fill: currentColor;
}

.confirmation-modal-copy {
  display: grid;
  gap: 8px;
}

.confirmation-modal-copy h2,
.confirmation-modal-copy p {
  margin: 0;
}

.confirmation-modal-copy h2 {
  font-size: 1.15rem;
  color: #111827;
}

.confirmation-modal-copy p {
  color: #475569;
  line-height: 1.5;
}

.confirmation-modal-copy p:first-of-type {
  color: var(--text);
  font-weight: 700;
}

.confirmation-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.confirmation-modal-actions .btn {
  min-width: 148px;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.confirmation-modal-cancel {
  background: #fff;
}

.status-badge-active {
  border-color: #bbf7d0;
  background: #ecfdf5;
  color: #166534;
}

.status-badge-inactive {
  border-color: #fecaca;
  background: #fff1f2;
  color: #b91c1c;
}

table {
  width: 100%;
  border-collapse: collapse;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.table-scroll table {
  border: 0;
}

.data-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.patients-table {
  min-width: 0;
}

.care-plans-table,
.encounters-table,
.admin-table {
  min-width: 0;
}

.transitions-table {
  min-width: 0;
  table-layout: fixed;
}

th,
td {
  border: 1px solid var(--border);
  padding: 8px;
  vertical-align: top;
}

th {
  background: #f3f4f6;
  text-align: left;
}

.data-table th,
.data-table td {
  border-top: 0;
  border-left: 0;
}

.data-table th:last-child,
.data-table td:last-child {
  border-right: 0;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table td {
  vertical-align: middle;
}

.data-table th {
  padding: 14px 16px;
  background: #eef8f6;
  color: #4b5f6b;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.data-table td {
  padding: 16px;
  overflow-wrap: anywhere;
  word-break: normal;
}

.data-table tbody tr {
  background: #fff;
}

.data-table tbody tr + tr td {
  border-top-color: #eef2f7;
}

.table-empty-row td {
  padding: 0 !important;
  border-right: 0 !important;
  border-left: 0 !important;
  border-bottom: 0 !important;
}

.table-empty-state {
  inline-size: 100%;
  min-height: clamp(180px, 32vh, 240px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px 20px;
  text-align: center;
  color: #94a3b8;
  background:
    radial-gradient(circle at top, rgba(15, 118, 110, 0.05), transparent 45%),
    #fff;
}

.table-empty-icon {
  inline-size: 48px;
  block-size: 48px;
  display: grid;
  place-items: center;
  color: #d7dee7;
}

.table-empty-icon svg {
  inline-size: 100%;
  block-size: 100%;
  fill: currentColor;
}

.table-empty-title,
.table-empty-text {
  margin: 0;
}

.table-empty-title {
  color: #94a3b8;
  font-size: 1.05rem;
  font-weight: 500;
}

.table-empty-text {
  max-width: 420px;
  font-size: 0.95rem;
  line-height: 1.5;
}

.table-empty-action {
  margin-top: 4px;
}

.patient-name {
  font-weight: 700;
}

.table-identity {
  display: grid;
  gap: 8px;
}

.table-identity-meta {
  display: grid;
  gap: 4px;
}

.table-identity-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.table-identity-label {
  flex: 0 0 34px;
  color: #64748b;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.table-identity-value {
  min-width: 0;
  color: #334155;
  font-size: 0.94rem;
  font-weight: 600;
  white-space: nowrap;
}

.search-highlight {
  padding: 0.04em 0.3em;
  border-radius: 0.45em;
  background: #bff1ea;
  color: #0b5c56;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.12);
}

.transitions-table .patient-name {
  display: inline-block;
  color: #0f172a;
  font-size: 1.02rem;
  line-height: 1.35;
}

.transition-date-time {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.transition-route {
  display: grid;
  gap: 8px;
  color: #334155;
  line-height: 1.35;
  min-width: 240px;
}

.transition-route-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.transition-route-service {
  min-width: 0;
  font-weight: 600;
}

.transition-route-arrow {
  color: #94a3b8;
  font-weight: 800;
}

.transition-specialty-tag {
  inline-size: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.transition-specialty-tag-endocrinologia {
  border-color: #9bd7c2;
  background: #eefaf3;
  color: #0f8b52;
}

.transition-specialty-tag-cardiologia {
  border-color: #f3b8b4;
  background: #fff4f3;
  color: #d92f2f;
}

.table-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.data-table .table-actions {
  justify-content: center;
  flex-wrap: nowrap;
}

.transitions-table .table-actions {
  justify-content: center;
  flex-wrap: nowrap;
}

body[data-page="patients-trash"] .table-scroll,
body[data-page="care-plans-trash"] .table-scroll,
body[data-page="encounters-list"] .table-scroll,
body[data-page="encounters-trash"] .table-scroll,
body[data-page="transitions-list"] .table-scroll,
body[data-page="transitions-trash"] .table-scroll {
  overflow-x: hidden;
}

body[data-page="patients-trash"] .patients-table,
body[data-page="care-plans-trash"] .care-plans-table,
body[data-page="encounters-list"] .encounters-table,
body[data-page="encounters-trash"] .encounters-table,
body[data-page="transitions-list"] .transitions-table,
body[data-page="transitions-trash"] .transitions-table {
  min-width: 0;
  table-layout: fixed;
}

body[data-page="patients-trash"] .patients-table th,
body[data-page="patients-trash"] .patients-table td,
body[data-page="care-plans-trash"] .care-plans-table th,
body[data-page="care-plans-trash"] .care-plans-table td,
body[data-page="encounters-list"] .encounters-table th,
body[data-page="encounters-list"] .encounters-table td,
body[data-page="encounters-trash"] .encounters-table th,
body[data-page="encounters-trash"] .encounters-table td,
body[data-page="transitions-list"] .transitions-table th,
body[data-page="transitions-list"] .transitions-table td,
body[data-page="transitions-trash"] .transitions-table th,
body[data-page="transitions-trash"] .transitions-table td {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

body[data-page="transitions-list"] .transition-route,
body[data-page="transitions-trash"] .transition-route {
  min-width: 0;
}

body[data-page="transitions-list"] .transition-date-time,
body[data-page="transitions-trash"] .transition-date-time {
  white-space: normal;
}

body[data-page="transitions-list"] .table-actions,
body[data-page="transitions-trash"] .table-actions {
  justify-content: center;
  flex-wrap: nowrap;
}

body[data-page="patients-trash"] .table-actions,
body[data-page="care-plans-trash"] .table-actions,
body[data-page="encounters-list"] .table-actions,
body[data-page="encounters-trash"] .table-actions {
  justify-content: center;
  flex-wrap: nowrap;
}

body[data-page="patients-trash"] .patients-table th:nth-child(1),
body[data-page="patients-trash"] .patients-table td:nth-child(1) {
  width: 34%;
}

body[data-page="patients-trash"] .patients-table th:nth-child(2),
body[data-page="patients-trash"] .patients-table td:nth-child(2) {
  width: 18%;
  white-space: nowrap;
}

body[data-page="patients-trash"] .patients-table th:nth-child(3),
body[data-page="patients-trash"] .patients-table td:nth-child(3) {
  width: 14%;
  white-space: nowrap;
}

body[data-page="patients-trash"] .patients-table th:nth-child(4),
body[data-page="patients-trash"] .patients-table td:nth-child(4) {
  width: 22%;
  white-space: nowrap;
}

body[data-page="patients-trash"] .patients-table th:nth-child(5),
body[data-page="patients-trash"] .patients-table td:nth-child(5) {
  width: 12%;
  white-space: nowrap;
}

body[data-page="care-plans-trash"] .care-plans-table th:nth-child(1),
body[data-page="care-plans-trash"] .care-plans-table td:nth-child(1) {
  width: 8%;
  white-space: nowrap;
}

body[data-page="care-plans-trash"] .care-plans-table th:nth-child(2),
body[data-page="care-plans-trash"] .care-plans-table td:nth-child(2) {
  width: 32%;
}

body[data-page="care-plans-trash"] .care-plans-table th:nth-child(3),
body[data-page="care-plans-trash"] .care-plans-table td:nth-child(3),
body[data-page="care-plans-trash"] .care-plans-table th:nth-child(4),
body[data-page="care-plans-trash"] .care-plans-table td:nth-child(4) {
  width: 12%;
  white-space: nowrap;
}

body[data-page="care-plans-trash"] .care-plans-table th:nth-child(5),
body[data-page="care-plans-trash"] .care-plans-table td:nth-child(5) {
  width: 22%;
  white-space: nowrap;
}

body[data-page="care-plans-trash"] .care-plans-table th:nth-child(6),
body[data-page="care-plans-trash"] .care-plans-table td:nth-child(6) {
  width: 14%;
  white-space: nowrap;
}

body[data-page="encounters-list"] .encounters-table th:nth-child(1),
body[data-page="encounters-list"] .encounters-table td:nth-child(1) {
  width: 11%;
  white-space: nowrap;
}

body[data-page="encounters-list"] .encounters-table th:nth-child(2),
body[data-page="encounters-list"] .encounters-table td:nth-child(2) {
  width: 29%;
}

body[data-page="encounters-list"] .encounters-table th:nth-child(3),
body[data-page="encounters-list"] .encounters-table td:nth-child(3) {
  width: 16%;
}

body[data-page="encounters-list"] .encounters-table th:nth-child(4),
body[data-page="encounters-list"] .encounters-table td:nth-child(4) {
  width: 28%;
}

body[data-page="encounters-list"] .encounters-table th:nth-child(5),
body[data-page="encounters-list"] .encounters-table td:nth-child(5) {
  width: 16%;
  white-space: nowrap;
}

body[data-page="encounters-trash"] .encounters-table th:nth-child(1),
body[data-page="encounters-trash"] .encounters-table td:nth-child(1) {
  width: 20%;
  white-space: nowrap;
}

body[data-page="encounters-trash"] .encounters-table th:nth-child(2),
body[data-page="encounters-trash"] .encounters-table td:nth-child(2) {
  width: 11%;
  white-space: nowrap;
}

body[data-page="encounters-trash"] .encounters-table th:nth-child(3),
body[data-page="encounters-trash"] .encounters-table td:nth-child(3) {
  width: 34%;
}

body[data-page="encounters-trash"] .encounters-table th:nth-child(4),
body[data-page="encounters-trash"] .encounters-table td:nth-child(4) {
  width: 19%;
}

body[data-page="encounters-trash"] .encounters-table th:nth-child(5),
body[data-page="encounters-trash"] .encounters-table td:nth-child(5) {
  width: 16%;
  white-space: nowrap;
}

body[data-page="transitions-list"] .transitions-table th:nth-child(1),
body[data-page="transitions-list"] .transitions-table td:nth-child(1) {
  width: 10%;
  white-space: nowrap;
}

body[data-page="transitions-list"] .transitions-table th:nth-child(2),
body[data-page="transitions-list"] .transitions-table td:nth-child(2) {
  width: 22%;
}

body[data-page="transitions-list"] .transitions-table th:nth-child(3),
body[data-page="transitions-list"] .transitions-table td:nth-child(3) {
  width: 10%;
  white-space: nowrap;
}

body[data-page="transitions-list"] .transitions-table th:nth-child(4),
body[data-page="transitions-list"] .transitions-table td:nth-child(4) {
  width: 13%;
  white-space: nowrap;
}

body[data-page="transitions-list"] .transitions-table th:nth-child(5),
body[data-page="transitions-list"] .transitions-table td:nth-child(5) {
  width: 19%;
}

body[data-page="transitions-list"] .transitions-table th:nth-child(6),
body[data-page="transitions-list"] .transitions-table td:nth-child(6) {
  width: 14%;
  white-space: nowrap;
}

body[data-page="transitions-list"] .transitions-table th:nth-child(7),
body[data-page="transitions-list"] .transitions-table td:nth-child(7) {
  width: 12%;
  white-space: nowrap;
}

body[data-page="transitions-trash"] .transitions-table th:nth-child(1),
body[data-page="transitions-trash"] .transitions-table td:nth-child(1) {
  width: 14%;
  white-space: nowrap;
}

body[data-page="transitions-trash"] .transitions-table th:nth-child(2),
body[data-page="transitions-trash"] .transitions-table td:nth-child(2) {
  width: 10%;
  white-space: nowrap;
}

body[data-page="transitions-trash"] .transitions-table th:nth-child(3),
body[data-page="transitions-trash"] .transitions-table td:nth-child(3) {
  width: 22%;
}

body[data-page="transitions-trash"] .transitions-table th:nth-child(4),
body[data-page="transitions-trash"] .transitions-table td:nth-child(4) {
  width: 10%;
  white-space: nowrap;
}

body[data-page="transitions-trash"] .transitions-table th:nth-child(5),
body[data-page="transitions-trash"] .transitions-table td:nth-child(5) {
  width: 13%;
  white-space: nowrap;
}

body[data-page="transitions-trash"] .transitions-table th:nth-child(6),
body[data-page="transitions-trash"] .transitions-table td:nth-child(6) {
  width: 15%;
}

body[data-page="transitions-trash"] .transitions-table th:nth-child(7),
body[data-page="transitions-trash"] .transitions-table td:nth-child(7) {
  width: 10%;
  white-space: nowrap;
}

body[data-page="transitions-trash"] .transitions-table th:nth-child(8),
body[data-page="transitions-trash"] .transitions-table td:nth-child(8) {
  width: 8%;
  white-space: nowrap;
}

.icon-btn {
  inline-size: 34px;
  block-size: 34px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  padding: 0;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.icon-btn:hover,
.icon-btn:focus-visible {
  outline: none;
  background: rgba(15, 118, 110, 0.08);
  color: var(--primary);
}

.icon-btn:active {
  transform: translateY(1px);
}

.icon-btn svg {
  inline-size: 18px;
  block-size: 18px;
  fill: currentColor;
}

.icon-btn-danger:hover,
.icon-btn-danger:focus-visible {
  background: rgba(185, 28, 28, 0.08);
  color: var(--danger);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 104px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
}

.status-badge-done {
  border-color: #bbf7d0;
  background: #dcfce7;
  color: #166534;
}

.status-badge-progress {
  border-color: #bae6fd;
  background: #e0f2fe;
  color: #075985;
}

.status-badge-pending {
  border-color: #fde68a;
  background: #fef3c7;
  color: #92400e;
}

.status-badge-canceled {
  border-color: #fecaca;
  background: #fee2e2;
  color: #991b1b;
}

.status-badge-neutral {
  border-color: var(--border);
  background: #f8fafc;
  color: var(--muted);
}

.muted {
  color: var(--muted);
  font-size: 0.92rem;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 0%, rgba(15, 118, 110, 0.1), transparent 26%),
    #f8fafc;
}

.auth-card {
  width: min(420px, 100%);
}

.auth-card-centered {
  padding: 28px 28px 24px;
  text-align: center;
}

.auth-mark {
  inline-size: 34px;
  block-size: 34px;
  margin: 0 auto 10px;
  border-radius: 50% 50% 42% 42%;
  background:
    linear-gradient(180deg, #6d5dfc 0 48%, #f59e0b 48% 100%);
  box-shadow: 0 12px 24px rgba(109, 93, 252, 0.22);
}

.auth-title,
.hero-title {
  margin: 0 0 10px 0;
  font-size: 2rem;
  color: #123456;
}

.auth-title {
  font-size: 1.35rem;
}

.auth-subtitle,
.hero-subtitle {
  margin: 0 0 20px 0;
  color: var(--muted);
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #f8fafc;
}

.auth-tab {
  min-height: 38px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
  color: #64748b;
  font-weight: 800;
}

.auth-tab:hover {
  box-shadow: none;
}

.auth-tab.is-active {
  background: #fff;
  color: var(--primary-dark);
  box-shadow: 0 8px 18px rgba(15, 37, 65, 0.08);
}

.auth-form {
  text-align: left;
}

.auth-form[hidden],
.auth-specialty-field[hidden] {
  display: none;
}

.auth-field-hint {
  margin: -2px 0 0;
  color: #64748b;
  font-size: 0.82rem;
  line-height: 1.4;
}

.auth-choice-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.auth-choice-group legend {
  grid-column: 1 / -1;
  margin-bottom: 0;
  font-weight: 700;
}

.auth-choice {
  display: block;
}

.auth-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.auth-choice span {
  min-height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: #334155;
  font-weight: 800;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.auth-choice input:checked + span {
  border-color: var(--primary);
  background: rgba(15, 118, 110, 0.08);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
  color: var(--primary-dark);
}

.auth-submit {
  width: 100%;
  min-height: 48px;
}

.auth-switch {
  margin: 16px 0 0;
  color: #64748b;
  font-size: 0.88rem;
  text-align: center;
}

.auth-switch button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--primary-dark);
  font-weight: 800;
  box-shadow: none;
}

.auth-switch button:hover {
  box-shadow: none;
}

.summary-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.summary-card {
  display: block;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  text-decoration: none;
  background: #fff;
}

.summary-card strong {
  display: block;
  margin-bottom: 6px;
}

.home-panel {
  overflow: hidden;
  padding: 22px;
  background:
    radial-gradient(circle at top right, rgba(122, 202, 196, 0.1), transparent 24%),
    linear-gradient(180deg, #f8fbfb, #fdfefe);
}

.home-panel-header {
  margin-bottom: 6px;
}

.home-kicker {
  margin: 0 0 8px;
  color: #0f766e;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

body[data-page="home"] .page-title {
  font-size: 1.65rem;
}

.home-subtitle {
  max-width: 760px;
}

.home-access-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  margin-top: 22px;
}

.home-access-card {
  min-height: 104px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(122, 149, 164, 0.18);
  border-radius: 22px;
  background: linear-gradient(180deg, #eef7fb, #f8fcfe);
  color: #0f2148;
  text-align: center;
  text-decoration: none;
  font-size: 1.15rem;
  font-weight: 700;
  box-shadow: 0 12px 24px rgba(15, 37, 65, 0.05);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.home-access-card:hover {
  transform: translateY(-2px);
  background: linear-gradient(180deg, #e7f4f3, #f5fbfb);
  box-shadow: 0 18px 28px rgba(15, 37, 65, 0.08);
}

.home-flow-bridge {
  min-width: 0;
}

.home-flow-bridge svg,
.home-illustration svg {
  display: block;
  width: 100%;
  height: auto;
}

.home-flow-line,
.home-flow-arrow,
.home-flow-bridge rect,
.home-flow-bridge circle,
.home-ill-arrow,
.home-ill-cloud,
.home-ill-screen rect,
.home-ill-screen path,
.home-ill-lock {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.home-flow-line,
.home-flow-arrow {
  stroke: #71c4bc;
  stroke-width: 4;
}

.home-flow-center {
  fill: rgba(113, 196, 188, 0.12);
  stroke: #71c4bc;
  stroke-width: 3;
}

.home-flow-center-mark {
  stroke: #2a7d8e;
  stroke-width: 3;
}

.home-flow-bridge rect {
  stroke: #6fb2c8;
  stroke-width: 3;
}

.home-flow-bridge circle {
  stroke: #7acac4;
  stroke-width: 3;
}

.home-flow-bridge path:not(.home-flow-line):not(.home-flow-arrow) {
  stroke: #33869c;
  stroke-width: 3;
}

.home-direction-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin: 30px 0 22px;
}

.home-direction-card {
  min-height: 190px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px 16px;
  align-items: center;
  border-radius: 26px;
  border: 1px solid rgba(122, 149, 164, 0.18);
  padding: 24px;
  background: linear-gradient(180deg, #f0f6fa, #f9fbfd);
  box-shadow: 0 16px 26px rgba(15, 37, 65, 0.05);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.home-direction-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 32px rgba(15, 37, 65, 0.08);
}

.home-direction-active {
  border: 1px solid rgba(53, 110, 164, 0.44);
  box-shadow: 0 18px 30px rgba(53, 110, 164, 0.12);
}

.home-direction-icon {
  inline-size: 62px;
  block-size: 62px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(180deg, #438fba, #367ba8);
  color: #fff;
  box-shadow: 0 12px 18px rgba(63, 135, 174, 0.18);
}

.home-direction-card:nth-child(2) .home-direction-icon {
  background: linear-gradient(180deg, #2ea593, #238678);
}

.home-direction-card:nth-child(3) .home-direction-icon {
  background: linear-gradient(180deg, #2b4d7a, #203f66);
}

.home-direction-icon svg {
  inline-size: 34px;
  block-size: 34px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.home-direction-card strong,
.home-direction-card span {
  display: block;
  color: #0f2148;
}

.home-direction-card strong {
  font-size: 1.16rem;
}

.home-direction-card span {
  margin-top: 4px;
  color: #4c6476;
  font-size: 1.04rem;
  font-weight: 700;
}

.home-direction-card p {
  grid-column: 1 / -1;
  margin: 4px 0 0;
  color: #0f2148;
  text-align: center;
  font-size: 2.45rem;
  font-weight: 800;
}

.home-direction-card .btn {
  grid-column: 1 / -1;
  justify-self: center;
  min-width: 220px;
  min-height: 46px;
  padding: 10px 18px;
  border-color: rgba(81, 114, 145, 0.24);
  background: linear-gradient(180deg, #ffffff, #f4f7fa);
  color: #0f2148;
  font-size: 0.98rem;
  text-align: center;
}

.home-illustration {
  margin: 10px 0 4px;
}

.home-ill-bg {
  fill: #d8efe4;
}

.home-ill-arrow {
  fill: none;
  stroke: #8fd8cf;
  stroke-width: 8;
  stroke-linecap: round;
}

.home-ill-cloud {
  fill: #daf5ef;
  stroke: #69b8b1;
  stroke-width: 3;
}

.home-ill-screen rect {
  fill: #4aa99f;
  stroke: #247e78;
  stroke-width: 3;
}

.home-ill-screen path {
  fill: none;
  stroke: #e8fffb;
  stroke-width: 4;
  stroke-linecap: round;
}

.home-ill-lock {
  fill: #d9f4ef;
  stroke: #378a83;
  stroke-width: 3;
}

.site-endbar {
  padding: 8px 0 22px;
}

.site-endbar-line {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #0f4c81, #0f766e);
  box-shadow: 0 10px 20px rgba(15, 37, 65, 0.12);
}

.site-endbar-text {
  margin: 10px 0 0;
  color: #6b7f8d;
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
}

.profile-block {
  line-height: 1.7;
}

.patient360-card {
  background:
    radial-gradient(circle at top right, rgba(63, 135, 174, 0.08), transparent 32%),
    linear-gradient(180deg, rgba(15, 118, 110, 0.03), rgba(255, 255, 255, 0) 24%),
    #fcfdfd;
}

.patient360-header {
  align-items: flex-start;
}

.patient360-header-actions {
  justify-content: flex-end;
}

.patient360-overview {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
}

.patient360-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding: 22px;
  border: 1px solid rgba(15, 118, 110, 0.12);
  border-radius: 24px;
  background: linear-gradient(180deg, #f7fcfb, #ffffff);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.patient360-avatar {
  inline-size: 82px;
  block-size: 82px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  background: linear-gradient(180deg, #c9f1e7, #b3e7db);
  color: #0b5c56;
  font-size: 1.8rem;
  font-weight: 900;
}

.patient360-hero-copy {
  display: grid;
  gap: 10px;
}

.patient360-name-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.patient360-name {
  margin: 0;
  font-size: clamp(1.6rem, 2vw, 2.1rem);
  color: #102236;
}

.patient360-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #bbf7d0;
  background: #ecfdf5;
  color: #166534;
  font-size: 0.86rem;
  font-weight: 800;
}

.patient360-status.is-inativo {
  border-color: #fecaca;
  background: #fff1f2;
  color: #b91c1c;
}

.patient360-meta-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.patient360-meta-item {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
}

.patient360-meta-label {
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.patient360-meta-value {
  color: #102236;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
}

.patient360-note-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 18px;
}

.patient360-note-card {
  padding: 18px;
  border: 1px solid #e2e8f0;
  border-radius: 22px;
  background: #fdfefe;
}

.patient360-note-title {
  margin: 0 0 8px 0;
  color: #0d6276;
  font-size: 0.84rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.patient360-note-text {
  margin: 0;
  color: #24364a;
  line-height: 1.6;
}

.patient360-note-empty {
  color: #94a3b8;
}

.patient360-actions {
  margin: 0 0 18px 0;
}

.patient360-tabs {
  margin: 0 0 18px 0;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(15, 118, 110, 0.03), rgba(15, 118, 110, 0));
}

.patient360-tab-badge {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  min-height: 26px;
  margin-left: 8px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.12);
  color: var(--primary-dark);
  font-size: 0.8rem;
  font-weight: 800;
}

.patient360-panel {
  margin-top: 18px;
}

.patient360-panel-title {
  font-size: 1.08rem;
}

.patient360-footer {
  margin-top: 18px;
  justify-content: flex-end;
}

.transition-card {
  padding: 24px;
  background:
    radial-gradient(circle at top right, rgba(63, 135, 174, 0.08), transparent 30%),
    linear-gradient(180deg, rgba(15, 118, 110, 0.03), rgba(255, 255, 255, 0) 26%),
    #fff;
}

.transition-form-shell {
  display: grid;
  gap: 22px;
}

.transition-section-kicker {
  margin: 0 0 6px 0;
  color: #5f7481;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.transition-specialty-title,
.transition-panel-title {
  margin: 0;
}

.transition-specialty-title {
  font-size: 1.18rem;
  color: #123456;
}

.transition-specialty-picker {
  display: grid;
  gap: 16px;
}

.transition-specialty-picker.is-invalid {
  padding: 16px;
  border: 1px solid #fecaca;
  border-radius: 22px;
  background: #fff7f7;
}

.transition-specialty-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 16px;
}

.transition-specialty-chip {
  min-width: 0;
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 20px;
  border: 1px solid #cfe1df;
  background: #f8fbfb;
  color: #18454b;
  text-align: left;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.transition-specialty-chip:hover,
.transition-specialty-chip:focus-visible {
  outline: none;
  transform: translateY(-1px);
  box-shadow: 0 14px 24px rgba(15, 37, 65, 0.08);
}

.transition-specialty-chip-endo {
  border-color: #9bd7c2;
  background: linear-gradient(180deg, #eefaf3, #f8fcf9);
  color: #0f8b52;
}

.transition-specialty-chip-cardio {
  border-color: #f3b8b4;
  background: linear-gradient(180deg, #fff4f3, #fff9f8);
  color: #d92f2f;
}

.transition-specialty-chip.is-selected {
  box-shadow: 0 18px 28px rgba(15, 37, 65, 0.12);
}

.transition-specialty-chip-endo.is-selected {
  border-color: #39aa72;
  background: linear-gradient(180deg, #e4f7ed, #f6fcf8);
}

.transition-specialty-chip-cardio.is-selected {
  border-color: #e55a54;
  background: linear-gradient(180deg, #ffeceb, #fff8f7);
}

.transition-specialty-icon {
  inline-size: 22px;
  block-size: 22px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.transition-specialty-icon svg {
  inline-size: 100%;
  block-size: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.transition-specialty-chip-label {
  min-width: 0;
  flex: 1 1 auto;
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1.25;
}

.transition-specialty-chip-mark {
  inline-size: 40px;
  block-size: 40px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 12px;
  border: 1px solid currentColor;
  background: rgba(255, 255, 255, 0.72);
  font-size: 0.95rem;
  font-weight: 700;
}

.transition-specialty-summary {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: #425466;
}

.transition-specialty-summary-label {
  font-weight: 900;
}

.transition-specialty-summary-label.is-endocrinologia {
  color: #0f8b52;
}

.transition-specialty-summary-label.is-cardiologia {
  color: #d92f2f;
}

.transition-panel {
  border: 1px solid #cfe1e4;
  border-radius: 22px;
  padding: 22px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.transition-panel-patient {
  background: linear-gradient(180deg, #f4fbfa, #fbfefe);
  border-color: #b7dcdd;
}

.transition-panel-details {
  background: linear-gradient(180deg, #f5f8fe, #fcfdff);
  border-color: #c8d8f0;
}

.transition-panel-header {
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(99, 134, 145, 0.28);
}

.transition-panel-title {
  color: #0d6276;
  font-size: 1.08rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.transition-panel-grid {
  display: grid;
  gap: 18px 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.transition-patient-search {
  position: relative;
}

.transition-patient-search .search-input-shell {
  width: 100%;
}

.transition-patient-results {
  position: absolute;
  inset: calc(100% + 8px) 0 auto 0;
  z-index: 30;
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid rgba(15, 118, 110, 0.14);
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, rgba(15, 118, 110, 0.08), transparent 34%),
    #fff;
  box-shadow: 0 18px 34px rgba(15, 37, 65, 0.14);
  max-height: 300px;
  overflow: auto;
}

.transition-patient-results[hidden] {
  display: none;
}

.transition-patient-option,
.transition-patient-empty {
  border-radius: 14px;
}

.transition-patient-option {
  width: 100%;
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  color: #173045;
  text-align: left;
}

.transition-patient-option:hover,
.transition-patient-option:focus-visible,
.transition-patient-option.is-active {
  outline: none;
  background: rgba(15, 118, 110, 0.08);
}

.transition-patient-option-name {
  font-weight: 800;
  line-height: 1.3;
}

.transition-patient-option-meta,
.transition-patient-empty {
  color: #64748b;
  font-size: 0.84rem;
  line-height: 1.4;
}

.transition-patient-empty {
  padding: 10px 12px;
}

.transition-readonly {
  background: rgba(255, 255, 255, 0.75);
  color: #516271;
  font-weight: 700;
}

.transition-field-hint {
  margin: 8px 0 0 0;
  color: #466d80;
  font-size: 0.84rem;
  line-height: 1.45;
}

.status-select-shell {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 56px;
  padding: 10px 48px 10px 14px;
  border: 1px solid #d8e2e8;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fcfb 100%);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.status-select-shell::after {
  content: "";
  position: absolute;
  right: 18px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-60%) rotate(45deg);
  color: #5f7483;
  pointer-events: none;
}

.status-select-shell:focus-within {
  border-color: #8bc7dc;
  box-shadow: 0 0 0 4px rgba(139, 199, 220, 0.18);
}

.status-select-native {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.status-select-pill {
  display: inline-flex;
  align-items: center;
  max-width: calc(100% - 6px);
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.status-select-native option {
  font-weight: 700;
}

.status-select-shell.status-select-shell-done {
  border-color: #cdecd8;
  background: linear-gradient(180deg, #ffffff 0%, #f8fcf9 100%);
}

.status-select-shell.status-select-shell-progress {
  border-color: #c7e6f4;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbfd 100%);
}

.status-select-shell.status-select-shell-pending {
  border-color: #f1dfac;
  background: linear-gradient(180deg, #ffffff 0%, #fffdf8 100%);
}

.status-select-shell.status-select-shell-canceled {
  border-color: #efc7c7;
  background: linear-gradient(180deg, #ffffff 0%, #fff8f8 100%);
}

.status-select-shell.status-select-shell-neutral {
  border-color: #d8e2e8;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.status-select-pill.status-select-pill-done {
  border-color: #bbf7d0;
  background: #ecfdf5;
  color: #166534;
}

.status-select-pill.status-select-pill-progress {
  border-color: #bae6fd;
  background: #e0f2fe;
  color: #075985;
}

.status-select-pill.status-select-pill-pending {
  border-color: #fde68a;
  background: #fef3c7;
  color: #92400e;
}

.status-select-pill.status-select-pill-canceled {
  border-color: #fecaca;
  background: #fee2e2;
  color: #991b1b;
}

.status-select-pill.status-select-pill-neutral {
  border-color: #d8e2e8;
  background: #f8fafc;
  color: #516271;
}

.transition-form-actions {
  margin-top: 2px;
}

.transition-form-actions .btn-primary {
  min-width: 220px;
}

.tab-link {
  text-decoration: none;
  color: var(--primary-dark);
}

.tab-link.is-active {
  font-weight: 800;
}

@media (max-width: 860px) {
  .toolbar {
    align-items: stretch;
  }

  .search-toolbar .actions {
    margin-left: 0;
    width: 100%;
  }

  .search-toolbar .actions .btn,
  .search-toolbar .actions button {
    flex: 1 1 160px;
    justify-content: center;
  }

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

  .transition-specialty-grid,
  .transition-panel-grid {
    grid-template-columns: 1fr;
  }

  .patient360-header,
  .patient360-hero,
  .patient360-note-grid {
    grid-template-columns: 1fr;
  }

  .patient360-header-actions {
    width: 100%;
    justify-content: stretch;
  }

  .patient360-header-actions .btn,
  .patient360-header-actions button {
    flex: 1 1 180px;
    justify-content: center;
  }

  .home-access-row,
  .home-direction-grid {
    grid-template-columns: 1fr;
  }

  .home-flow-bridge {
    display: none;
  }

  .menu {
    justify-content: flex-start;
  }

  .form-actions {
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
  }

  .form-actions .btn,
  .form-actions button {
    width: auto;
  }

  .date-picker-popover {
    position: fixed;
    inset: auto 12px 12px 12px;
    width: auto;
    min-width: 0;
    max-height: min(78vh, 520px);
    overflow: auto;
    padding: 16px;
    border-radius: 20px;
  }

  .date-picker-selects {
    grid-template-columns: 1fr 96px;
  }

  .date-picker-day {
    min-height: 44px;
  }

  .date-picker-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .date-picker-footer-actions {
    justify-content: space-between;
  }
}
