/* Litepicker: z-index sobre modales Bootstrap */
.litepicker { z-index: 2000 !important; }

/* Modales siempre sobre el menu lateral y su overlay movil */
.modal-backdrop {
  z-index: 1070;
}

.modal {
  z-index: 1075;
}

:root {
  /* Typography */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Theme Layout Colors */
  --app-bg: #f8fafc;
  --app-surface: #ffffff;
  --app-text: #0f172a;
  --app-muted: #64748b;
  --app-border: rgba(226, 232, 240, 0.8);
  --app-card-header-bg: linear-gradient(135deg, rgba(14, 116, 144, 0.05) 0%, rgba(249, 115, 22, 0.07) 100%);
  
  /* Brand Accent Primary (Teal) */
  --accent: #0f8aa6;
  --accent-soft: rgba(14, 116, 144, 0.08);
  --accent-hover: #0b5f74;

  /* Layout Shell Sizing */
  --sidebar-bg: #0f172a;
  --sidebar-muted: #94a3b8;
  --sidebar-active: #1e293b;
  --sidebar-width: 260px;
  --sidebar-collapsed: 78px;

  /* Semantic HSL Colors */
  --color-primary: 191, 83%, 36%;       /* #0f8aa6 */
  --color-success: 142, 71%, 45%;       /* #16a34a */
  --color-danger: 0, 72%, 51%;          /* #dc2626 */
  --color-warning: 35, 92%, 47%;        /* #d97706 */
  --color-info: 217, 91%, 60%;          /* #2563eb */
  --color-violet: 262, 80%, 50%;        /* #7c3aed */

  /* Premium Elevated Shadows */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.04), 0 1px 4px rgba(15, 23, 42, 0.03);
  --shadow-lg: 0 10px 24px -4px rgba(15, 23, 42, 0.04), 0 4px 12px -2px rgba(15, 23, 42, 0.03);
  --shadow-xl: 0 20px 32px -8px rgba(15, 23, 42, 0.06), 0 8px 16px -4px rgba(15, 23, 42, 0.04);
  --shadow-premium: 0 12px 36px rgba(14, 116, 144, 0.06), 0 4px 12px rgba(15, 23, 42, 0.03);

  /* Borders & Radius Override */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --bs-border-radius: 0.625rem;
  --bs-border-radius-sm: 0.45rem;
  --bs-border-radius-lg: 0.75rem;
}

body.app-body {
  font-family: var(--font-sans);
  background: radial-gradient(circle at top left, #f1f5f9 0%, #f8fafc 40%, #ffffff 100%);
  color: var(--app-text);
  min-height: 100vh;
  overflow-x: hidden;
  max-width: 100vw;
}

.app-shell {
  min-height: 100vh;
  max-width: 100vw;
  overflow-x: hidden;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: #ffffff;
  transition: width 0.2s ease, left 0.2s ease;
  position: relative;
  z-index: 1060;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #fff;
}

.sidebar .nav-link {
  color: var(--sidebar-muted);
  padding: 10px 16px;
  border-radius: 10px;
  margin: 4px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.sidebar .nav-link i {
  font-size: 1rem;
  width: 1.15rem;
  text-align: center;
  flex-shrink: 0;
  transition: color 0.15s;
}

.sidebar .nav-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  transform: translateX(4px);
}

.sidebar .nav-link.active {
  background: linear-gradient(90deg, rgba(15, 138, 166, 0.16) 0%, rgba(15, 138, 166, 0.02) 100%);
  color: #ffffff;
  font-weight: 600;
  box-shadow: none;
}

.sidebar .nav-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 15%;
  height: 70%;
  width: 3.5px;
  background: var(--accent);
  border-radius: 99px;
}

.sidebar .nav-link.active i {
  color: #5eead4;
}

.sidebar .nav-section {
  padding: 14px 22px 3px;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.32);
}

.sidebar .nav-text {
  white-space: nowrap;
}

.sidebar-footer {
  padding: 14px 10px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: auto;
}

.sidebar-logout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: 2.5rem;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  border-color: rgba(239, 68, 68, 0.22) !important;
  background: rgba(239, 68, 68, 0.07) !important;
  color: rgba(252, 165, 165, 0.9) !important;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

/* Botón Salir como nav-link */
.sidebar .nav-link.nav-logout {
  color: rgba(252, 165, 165, 0.85);
}

.sidebar .nav-link.nav-logout:hover {
  background: rgba(239, 68, 68, 0.14);
  color: #fca5a5;
}

.sidebar .nav-link.nav-logout i {
  color: rgba(252, 165, 165, 0.85);
}

.sidebar-logout-btn:hover {
  background: rgba(239, 68, 68, 0.16) !important;
  border-color: rgba(239, 68, 68, 0.38) !important;
  color: #fca5a5 !important;
  transform: none;
  box-shadow: none;
}

.sidebar-logout-btn i {
  font-size: 1rem;
}

.app-main {
  flex: 1;
  padding: 24px;
  min-width: 0;
  overflow-x: hidden;
}

.topbar {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-lg, 16px);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-premium);
  margin-bottom: 24px;
}

.card,
.stat-card,
.app-card,
.mobile-card,
.user-docs-card,
.clinic-view-card,
.soap-history-item {
  background: var(--app-surface, #ffffff);
  border: 1px solid var(--app-border) !important;
  border-radius: var(--radius-lg, 16px) !important;
  box-shadow: var(--shadow-md) !important;
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover,
.stat-card:hover,
.app-card:hover,
.mobile-card:hover,
.user-docs-card:hover,
.clinic-view-card:hover,
.soap-history-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg) !important;
}

.clinic-default-row > td,
.clinic-default-row > th {
  background: rgba(254, 243, 199, 0.62) !important;
}

.clinic-default-card {
  border-color: rgba(251, 191, 36, 0.42) !important;
  background: linear-gradient(135deg, rgba(255, 251, 235, 0.98) 0%, rgba(254, 240, 138, 0.28) 100%);
}

.app-body .btn:not(.btn-close) {
  border-radius: 12px;
  font-weight: 500;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.app-body .btn:not(.btn-close):hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.app-body .btn.btn-sm:not(.btn-close) {
  min-height: 2.15rem;
  padding: 0.38rem 0.76rem;
}

.app-body .btn:not(.btn-sm):not(.btn-close) {
  min-height: 2.45rem;
  padding: 0.5rem 0.92rem;
}

.app-body .btn-primary {
  background: linear-gradient(135deg, #0f8aa6 0%, #0d5e9b 100%);
  border-color: #0d6f9c;
  color: #fff;
}

.app-body .btn-primary:hover,
.app-body .btn-primary:focus,
.app-body .btn-primary:active {
  background: linear-gradient(135deg, #0d7f98 0%, #0b5388 100%);
  border-color: #0b6690;
  color: #fff;
}

.app-body .btn-outline-primary {
  border-color: rgba(14, 116, 144, 0.24);
  background: rgba(14, 116, 144, 0.08);
  color: #0f3d56;
}

.app-body .btn-outline-primary:hover,
.app-body .btn-outline-primary:focus,
.app-body .btn-outline-primary:active,
.app-body .btn-outline-primary.active {
  border-color: rgba(14, 116, 144, 0.34);
  background: rgba(14, 116, 144, 0.14);
  color: #0b3247;
}

.app-body .btn-outline-secondary,
.app-body .btn-secondary {
  border-color: rgba(148, 163, 184, 0.38);
  background: rgba(248, 250, 252, 0.96);
  color: #475569;
}

.app-body .btn-outline-secondary:hover,
.app-body .btn-outline-secondary:focus,
.app-body .btn-outline-secondary:active,
.app-body .btn-secondary:hover,
.app-body .btn-secondary:focus,
.app-body .btn-secondary:active {
  border-color: rgba(148, 163, 184, 0.5);
  background: rgba(241, 245, 249, 1);
  color: #334155;
}

.app-body .btn-success,
.app-body .btn-outline-success {
  border-color: rgba(34, 197, 94, 0.28);
  background: rgba(34, 197, 94, 0.08);
  color: #166534;
}

.app-body .btn-success:hover,
.app-body .btn-success:focus,
.app-body .btn-success:active,
.app-body .btn-outline-success:hover,
.app-body .btn-outline-success:focus,
.app-body .btn-outline-success:active {
  border-color: rgba(34, 197, 94, 0.38);
  background: rgba(34, 197, 94, 0.14);
  color: #14532d;
}

.app-body .btn-danger,
.app-body .btn-outline-danger {
  border-color: rgba(239, 68, 68, 0.24);
  background: rgba(239, 68, 68, 0.06);
  color: #dc2626;
}

.app-body .btn-danger:hover,
.app-body .btn-danger:focus,
.app-body .btn-danger:active,
.app-body .btn-outline-danger:hover,
.app-body .btn-outline-danger:focus,
.app-body .btn-outline-danger:active {
  border-color: rgba(239, 68, 68, 0.34);
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

.app-body .btn-warning,
.app-body .btn-outline-warning {
  border-color: rgba(245, 158, 11, 0.28);
  background: rgba(245, 158, 11, 0.1);
  color: #b45309;
}

.app-body .btn-warning:hover,
.app-body .btn-warning:focus,
.app-body .btn-warning:active,
.app-body .btn-outline-warning:hover,
.app-body .btn-outline-warning:focus,
.app-body .btn-outline-warning:active {
  border-color: rgba(245, 158, 11, 0.38);
  background: rgba(245, 158, 11, 0.16);
  color: #92400e;
}

.app-body .btn-light {
  border-color: rgba(203, 213, 225, 0.6);
  background: #fff;
  color: #475569;
}

.app-body .btn-light:hover,
.app-body .btn-light:focus,
.app-body .btn-light:active {
  border-color: rgba(148, 163, 184, 0.45);
  background: rgba(248, 250, 252, 1);
  color: #334155;
}

.app-body .btn:disabled,
.app-body .btn.disabled {
  opacity: 0.6;
  box-shadow: none;
  transform: none;
}

/* ── Form controls ──────────────────────────────────────────── */
.app-body .form-label,
.app-body .col-form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.35rem;
}

.app-body .form-control,
.app-body .form-select {
  border-radius: 0.625rem;
  border-color: #e2e8f0;
  background-color: #f8fafc;
  font-size: 0.9rem;
  color: var(--app-text);
  min-height: 2.5rem;
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}

.app-body .form-control:focus,
.app-body .form-select:focus {
  background-color: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 138, 166, 0.12);
}

@media (max-width: 767.98px) {
  .app-body .form-control,
  .app-body .form-select {
    font-size: 16px !important;
  }
}

.app-body .form-control::placeholder {
  color: #b0bec5;
  font-weight: 400;
}

.app-body .form-control:disabled,
.app-body .form-control[readonly],
.app-body .form-select:disabled {
  background-color: #f1f5f9;
  border-color: #e9ecef;
  color: #94a3b8;
  opacity: 1;
}

.app-body .input-group-text {
  background-color: #f8fafc;
  border-color: #e2e8f0;
  color: #94a3b8;
  font-size: 0.9rem;
}

.app-body .form-text {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-top: 0.3rem;
}

.app-body .form-check-input {
  accent-color: #0e7490;
  width: 1em;
  height: 1em;
}

.app-body .form-check-label {
  font-size: 0.87rem;
  color: #475569;
}


/* ── Tables ─────────────────────────────────────────────────── */
.app-body .table {
  font-size: 0.9rem;
  color: #1f2430;
}

.app-body .table thead th {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #526277;
  background: rgba(14, 116, 144, 0.04);
  border-bottom-width: 1px;
  border-color: rgba(14, 116, 144, 0.14);
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

.app-body .table tbody tr {
  transition: background-color 0.12s;
}

.app-body .table-hover tbody tr:hover {
  background-color: rgba(14, 116, 144, 0.05);
}

.app-body .table td {
  border-color: rgba(14, 116, 144, 0.07);
  vertical-align: middle;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

/* ── Topbar mobile ───────────────────────────────────────────── */
@media (max-width: 991.98px) {
  .topbar {
    padding: 10px 14px;
    margin-bottom: 14px;
    border-radius: 12px;
  }
  .topbar small.text-muted {
    display: none;
  }
}

/* ── Thin custom scrollbar (webkit) ─────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(14, 116, 144, 0.22);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(14, 116, 144, 0.4);
}

.app-toast-container {
  z-index: 1085;
  top: 1rem;
  right: 1rem;
}

.app-toast {
  min-width: 320px;
  max-width: 460px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
  overflow: hidden;
}

.app-toast .toast-header {
  border: 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  font-weight: 600;
}

.app-toast .toast-body {
  color: #334155;
}

.app-toast--success {
  border-color: rgba(34, 197, 94, 0.35);
}

.app-toast--success .toast-header {
  background: rgba(34, 197, 94, 0.12);
  color: #166534;
}

.app-toast--warning {
  border-color: rgba(245, 158, 11, 0.35);
}

.app-toast--warning .toast-header {
  background: rgba(245, 158, 11, 0.14);
  color: #92400e;
}

.app-toast--error {
  border-color: rgba(239, 68, 68, 0.34);
}

.app-toast--error .toast-header {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

.app-body .alert {
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: #ffffff;
  color: #334155;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.app-body .alert.alert-success {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.1);
  color: #166534;
}

.app-body .alert.alert-warning {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.12);
  color: #92400e;
}

.app-body .alert.alert-danger {
  border-color: rgba(239, 68, 68, 0.34);
  background: rgba(239, 68, 68, 0.1);
  color: #b91c1c;
}

.app-body .alert.alert-info {
  border-color: rgba(14, 116, 144, 0.3);
  background: rgba(14, 116, 144, 0.1);
  color: #0f3d56;
}

.dashboard-stat-card .card-body,
.dashboard-panel-card .card-body {
  min-width: 0;
}

.dashboard-card-kicker,
.dashboard-stat-kicker {
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.7rem;
  color: #94a3b8;
}

.dashboard-card-header,
.card-header-band {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin: -1rem -1rem 1rem;
  padding: 0.75rem 1.1rem;
  border: 0 !important;
  border-bottom: 1px solid var(--app-border) !important;
  border-radius: 15px 15px 0 0 !important;
  background: var(--app-card-header-bg);
  box-shadow: inset 0 -1px 0 rgba(15, 23, 42, 0.03);
}

.dashboard-card-title-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}

.dashboard-card-icon {
  width: 2.15rem;
  height: 2.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.78);
  color: #0f3d56;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 12px;
  flex-shrink: 0;
  font-size: 1rem;
}

.dashboard-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.dashboard-card-summary {
  color: #526277;
  font-size: 0.84rem;
  margin-top: 0.15rem;
}

.dashboard-stat-card {
  background: var(--app-surface);
}

.dashboard-stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.dashboard-stat-title {
  font-size: 0.92rem;
  font-weight: 500;
  color: #64748b;
  margin-top: 0;
  line-height: 1.25;
}

.dashboard-stat-value {
  font-size: 1.55rem;
  line-height: 1;
  font-weight: 700;
  color: #0f172a;
}

.dashboard-stat-meta {
  color: #64748b;
  font-size: 0.78rem;
}

.dashboard-stat-icon {
  width: auto;
  height: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  flex-shrink: 0;
  font-size: 1.35rem;
}

.dashboard-stat-divider {
  display: none;
}

.dashboard-panel-card .badge {
  flex-shrink: 0;
}



.card-header-band .card-title {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
}

.card-header-band .card-title i {
  width: 2.15rem;
  height: 2.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.78);
  color: #0f3d56;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 12px;
  font-size: 1rem;
  flex-shrink: 0;
}

.card-header-band > .btn,
.card-header-band .btn,
.card-header-band .badge {
  flex-shrink: 0;
}

.card-header-band-divider {
  display: none;
}

.card-header-band + hr.my-3,
.card-header-band + .collapse > hr.my-3:first-child,
.card-header-band + .collapsing > hr.my-3:first-child,
.card-header-band + form > hr.my-3:first-child,
.dashboard-card-header + hr.my-3,
.dashboard-card-header + .collapse > hr.my-3:first-child,
.dashboard-card-header + .collapsing > hr.my-3:first-child,
.dashboard-card-header + form > hr.my-3:first-child {
  display: none;
}

.app-contact-group,
.app-action-row,
.app-action-stack {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.app-action-row > form,
.app-action-stack > form,
.mobile-card .d-grid.gap-2.d-sm-flex > form,
.mobile-card .d-flex.gap-2 > form,
.mobile-card .d-flex.gap-2.flex-wrap > form,
.table td .d-flex.gap-2 > form,
.table td .app-action-row > form {
  display: flex;
  margin: 0;
}

.app-action-row > form > .btn,
.app-action-stack > form > .btn,
.mobile-card .d-grid.gap-2.d-sm-flex > form > .btn,
.mobile-card .d-flex.gap-2 > form > .btn,
.mobile-card .d-flex.gap-2.flex-wrap > form > .btn,
.table td .d-flex.gap-2 > form > .btn,
.table td .app-action-row > form > .btn {
  width: 100%;
}

.app-action-stack {
  flex-direction: column;
}

/* Core shared foundation for all action, contact, and doc buttons */
.app-action-btn,
.app-contact-btn,
.user-docs-action-btn,
.map-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border-radius: var(--bs-border-radius, 12px);
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: #ffffff;
  color: #475569;
  text-decoration: none;
  font-weight: 600;
  line-height: 1;
  box-shadow: var(--shadow-sm);
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
  flex-shrink: 0;
}

.app-action-btn:hover,
.app-contact-btn:hover,
.user-docs-action-btn:hover,
.map-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  color: inherit !important;
  text-decoration: none;
}

.app-action-btn:active,
.app-contact-btn:active,
.user-docs-action-btn:active,
.map-action-btn:active {
  transform: translateY(0);
}

.app-contact-btn,
.app-action-btn {
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  font-weight: 500;
}

.app-action-btn i,
.app-contact-btn i,
.user-docs-action-btn i,
.map-action-btn i {
  font-size: 0.95rem;
}

.app-contact-btn.is-phone {
  border-color: rgba(37, 99, 235, 0.25);
  color: #2563eb;
  background: rgba(37, 99, 235, 0.06);
}

.app-contact-btn.is-whatsapp {
  border-color: rgba(34, 197, 94, 0.28);
  color: #15803d;
  background: rgba(34, 197, 94, 0.08);
}

.app-contact-btn.is-location {
  border-color: rgba(249, 115, 22, 0.24);
  color: #c2410c;
  background: rgba(249, 115, 22, 0.08);
}

.app-contact-btn.is-website {
  border-color: rgba(14, 165, 233, 0.24);
  color: #0369a1;
  background: rgba(14, 165, 233, 0.10);
}

.app-contact-btn.is-email,
.app-contact-btn.is-info {
  border-color: rgba(14, 116, 144, 0.24);
  color: #0f766e;
  background: rgba(14, 116, 144, 0.08);
}

.app-contact-btn.is-confirm {
  border-color: rgba(124, 58, 237, 0.28);
  color: #6d28d9;
  background: rgba(124, 58, 237, 0.08);
}

.app-action-btn.is-primary {
  border-color: rgba(124, 58, 237, 0.3) !important;
  background: rgba(124, 58, 237, 0.1) !important;
  color: #7c3aed !important;
}

.app-action-btn.is-success {
  border-color: rgba(34, 197, 94, 0.3) !important;
  background: rgba(34, 197, 94, 0.1) !important;
  color: #15803d !important;
}

.app-action-btn.is-danger {
  border-color: rgba(155, 28, 28, 0.3) !important;
  background: rgba(155, 28, 28, 0.08) !important;
  color: #9b1c1c !important;
}

.app-action-btn.is-warning {
  border-color: rgba(245, 158, 11, 0.35) !important;
  background: rgba(245, 158, 11, 0.12) !important;
  color: #b45309 !important;
}

.app-action-btn.is-neutral {
  border-color: rgba(148, 163, 184, 0.35) !important;
  background: rgba(248, 250, 252, 0.92) !important;
  color: #475569 !important;
}

.app-action-btn.is-info {
  border-color: rgba(59, 130, 246, 0.3) !important;
  background: rgba(59, 130, 246, 0.1) !important;
  color: #2563eb !important;
}

.app-action-btn.is-pdf {
  border-color: rgba(237, 28, 36, 0.3) !important;
  background: rgba(237, 28, 36, 0.1) !important;
  color: #ED1C24 !important;
}

.app-action-btn.is-edit {
  border-color: rgba(13, 148, 136, 0.3) !important;
  background: rgba(13, 148, 136, 0.1) !important;
  color: #0d9488 !important;
}

.app-action-btn[disabled],
.app-contact-btn[disabled],
.app-action-btn.disabled,
.app-contact-btn.disabled {
  opacity: 1;
  box-shadow: none;
  transform: none;
  background: #f1f5f9 !important;
  border-color: rgba(148, 163, 184, 0.35) !important;
  color: #94a3b8 !important;
  filter: grayscale(1);
}

.app-action-btn .text-success {
  color: inherit !important;
}

/* ── Token box: mismo tamaño que action buttons, para mostrar tipo/conteo ── */
.app-token-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 12px;
  border: 1.5px solid transparent;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}
.app-token-box.is-primary  { background: #eff6ff; border-color: #bfdbfe; color: #2563eb; }
.app-token-box.is-warning  { background: #fffbeb; border-color: #fcd34d; color: #b45309; }
.app-token-box.is-neutral  { background: #f8fafc; border-color: #e2e8f0; color: #64748b; }

.patients-table .patients-actions-heading,
.patients-table .patients-actions-cell {
  width: 1%;
  white-space: nowrap;
}

.patients-table .patients-actions-cell {
  vertical-align: middle;
}

.patient-row-main {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
}

.patient-row-avatar {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
  flex: 0 0 auto;
}

.patient-row-copy {
  min-width: 0;
}

.patient-row-name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  line-height: 1.35;
  font-size: 0.94rem;
  font-weight: 600;
  color: #0f172a;
}

.patient-row-alias {
  font-size: 0.88rem;
  font-weight: 400;
  color: #64748b !important;
}

.patient-mobile-subrow {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0.75rem;
  min-width: 0;
}

.patient-modalidad-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  min-width: 0;
}

.patient-modalidad-site {
  line-height: 1.3;
  white-space: normal;
  word-break: break-word;
  max-width: 220px;
}

.patient-actions-stack {
  gap: 0.6rem;
}

.patients-table .patient-actions-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.patients-table .patient-actions-row > *,
.patients-table .patient-actions-row > form {
  min-width: 0;
}

.patients-table .patient-actions-row .app-action-btn,
.patients-table .patient-actions-row > form > .app-action-btn {
  width: 100%;
  justify-content: center;
  white-space: nowrap;
  padding-inline: 0.7rem;
}

.mobile-list {
  display: none;
}

.mobile-card {
  word-break: break-word;
}

.mobile-card .card-body {
  padding: 16px;
}

.medical-history-record-actions {
  flex-wrap: wrap;
}

.medical-history-record-actions > form {
  margin: 0;
}

.mobile-patient-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.mobile-patient-main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1 1 auto;
  min-width: 0;
}

.mobile-patient-copy {
  flex: 1 1 auto;
  min-width: 0;
}

.mobile-patient-name {
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.mobile-patient-alias {
  display: inline;
}

.mobile-patient-id {
  flex: 0 0 auto;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
}

.checkbox-grid .form-check {
  margin-bottom: 0;
}

.badge-soft {
  background: var(--accent-soft);
  color: #1d4ed8;
  font-weight: 600;
}

/* Bootstrap .badge base override */
.app-body .badge:not(.app-badge):not(.status-badge):not(.modalidad-badge) {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  padding: 0.35em 0.72em;
  border-radius: 10px;
  border: 1.5px solid transparent;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.badge.app-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3em;
  padding: 0.35em 0.72em;
  border-radius: 10px;
  border: 1.5px solid transparent;
  font-weight: 700;
  font-size: 0.82rem;
  line-height: 1;
  white-space: nowrap;
}

.badge.app-badge.app-badge-count {
  min-width: 1.6rem;
  padding-inline: 0.52rem;
}

.badge.app-badge.app-badge-token {
  padding: 0.35em 0.72em;
  font-size: 0.82rem;
}

.badge.app-badge.is-neutral {
  background: #f8fafc !important;
  border-color: #cbd5e1;
  color: #475569 !important;
}

.badge.app-badge.is-primary {
  background: #f8fafc !important;
  border-color: #bfdbfe;
  color: #2563eb !important;
}

.badge.app-badge.is-secondary {
  background: #f8fafc !important;
  border-color: #e2e8f0;
  color: #475569 !important;
}

.badge.app-badge.is-success {
  background: #f8fafc !important;
  border-color: #86efac;
  color: #166534 !important;
}

.badge.app-badge.is-warning {
  background: #f8fafc !important;
  border-color: #fcd34d;
  color: #b45309 !important;
}

.appointment-selector-modal .modal-dialog {
  max-width: 840px;
}

.appointment-selector-modal .modal-content {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.appointment-selector-modal .modal-body {
  padding: 1.5rem;
}

.appointment-selector-shell {
  display: grid;
  gap: 1rem;
}

.appointment-selector-summary {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 1rem 1rem 1.35rem;
  text-align: center;
  border-bottom: 1px solid rgba(226, 232, 240, 0.95);
}

.appointment-selector-summary__icon {
  width: 64px;
  height: 64px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #2563eb;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.98), rgba(219, 234, 254, 0.95));
  border: 1px solid rgba(147, 197, 253, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 12px 24px rgba(37, 99, 235, 0.12);
  font-size: 1.75rem;
}

.appointment-selector-summary__title {
  margin: 0;
  font-size: 1.95rem;
  font-weight: 700;
  line-height: 1.15;
  color: #2b2f38;
}

.appointment-selector-summary__meta {
  color: #6b7280;
  font-size: 1rem;
}

.appointment-selector-section-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  color: #2f3640;
  font-size: 1.15rem;
  font-weight: 700;
}

.appointment-selector-list {
  display: grid;
  gap: 0.9rem;
}

.appointment-selector-card {
  appearance: none;
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 0.95rem 1rem;
  border: 1px solid rgba(226, 232, 240, 0.96);
  border-left: 4px solid var(--appointment-accent, #2563eb);
  border-radius: 16px;
  background: var(--appointment-accent-bg, rgba(255, 255, 255, 0.96));
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
  cursor: pointer;
  text-align: left;
  color: inherit;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.appointment-selector-card:hover {
  transform: translateX(4px);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.08);
  border-color: rgba(191, 219, 254, 0.95);
}

.appointment-selector-card:focus-visible {
  outline: 3px solid rgba(59, 130, 246, 0.28);
  outline-offset: 2px;
}

.appointment-selector-card__avatar {
  display: flex;
  align-items: center;
  justify-content: center;
}

.appointment-selector-card__body {
  min-width: 0;
  display: grid;
  gap: 0.6rem;
}

.appointment-selector-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.appointment-selector-card__title-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.35rem;
}

.appointment-selector-card__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #2b2f38;
}

.appointment-selector-card__warning {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
  font-size: 0.82rem;
}

.appointment-selector-card__therapist {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: #374151;
  font-weight: 600;
}

.appointment-selector-card__flags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.badge.app-badge.appointment-selector-flag {
  padding: 0.28em 0.6em;
  font-size: 0.77rem;
}

.appointment-selector-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem 1rem;
  color: #6b7280;
  font-size: 0.88rem;
}

.appointment-selector-card__meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.appointment-selector-card__arrow {
  color: #94a3b8;
  font-size: 1.1rem;
}

.appointment-selector-alert {
  border: 1px solid rgba(248, 113, 113, 0.18);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(254, 242, 242, 0.95) 0%, rgba(255, 247, 237, 0.95) 100%);
  color: #991b1b;
  box-shadow: 0 10px 24px rgba(127, 29, 29, 0.05);
}

.appointment-selector-alert i {
  font-size: 1rem;
  margin-top: 0.15rem;
}

@media (max-width: 767.98px) {
  .appointment-selector-modal .modal-body {
    padding: 1rem;
  }

  .appointment-selector-summary__title {
    font-size: 1.45rem;
  }

  .appointment-selector-card {
    grid-template-columns: auto 1fr;
    gap: 0.85rem;
  }

  .appointment-selector-card__top {
    flex-direction: column;
    gap: 0.65rem;
  }

  .appointment-selector-card__arrow {
    display: none;
  }
}

.badge.app-badge.is-danger {
  background: #f8fafc !important;
  border-color: #fca5a5;
  color: #dc2626 !important;
}

.badge.app-badge.is-info {
  background: #f8fafc !important;
  border-color: #a5f3fc;
  color: #0e7490 !important;
}

.badge.app-badge.is-violet {
  background: #f8fafc !important;
  border-color: #c4b5fd;
  color: #7c3aed !important;
}

/* ===== Status badges & buttons (citas) ===== */
.status-badge,
.status-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35em 0.72em;
  border-radius: 10px;
  border: 1.5px solid transparent;
  font-weight: 700;
  font-size: 0.82rem;
  line-height: 1;
  white-space: nowrap;
}
.status-btn {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.status-btn.active {
  box-shadow: 0 0 0 3px var(--status-ring, rgba(100,116,139,0.3));
  border-width: 2px;
  transform: translateY(-1px);
}
.status-btn:not(.active):hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.status-btn.is-locked,
.status-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.status-badge.is-primary,   .status-btn.is-primary   { background: #f8fafc; color: #2563eb; border-color: #bfdbfe; --status-ring: rgba(59,130,246,0.28); }
.status-badge.is-success,   .status-btn.is-success   { background: #f8fafc; color: #15803d; border-color: #86efac; --status-ring: rgba(16,185,129,0.28); }
.status-badge.is-info,      .status-btn.is-info      { background: #f8fafc; color: #0f766e; border-color: #99f6e4; --status-ring: rgba(20,184,166,0.28); }
.status-badge.is-violet,    .status-btn.is-violet    { background: #f8fafc; color: #7c3aed; border-color: #c4b5fd; --status-ring: rgba(124,58,237,0.28); }
.status-badge.is-warning,   .status-btn.is-warning   { background: #f8fafc; color: #b45309; border-color: #fcd34d; --status-ring: rgba(245,158,11,0.28); }
.status-badge.is-orange,    .status-btn.is-orange    { background: #fff8f3; color: #c2410c; border-color: #fdba74; --status-ring: rgba(249,115,22,0.28); }
.status-badge.is-danger,    .status-btn.is-danger    { background: #fff7f7; color: #dc2626; border-color: #fca5a5; --status-ring: rgba(239,68,68,0.28); }
.status-badge.is-secondary, .status-btn.is-secondary { background: #f8fafc; color: #475569; border-color: #cbd5e1; --status-ring: rgba(100,116,139,0.28); }

/* ===== FullCalendar Premium Redesign ===== */
.fc.fc-theme-standard {
  font-family: var(--font-sans);
  background: var(--app-surface, #ffffff);
  border: 1px solid var(--app-border) !important;
  border-radius: var(--radius-lg, 16px) !important;
  box-shadow: var(--shadow-lg) !important;
  overflow: hidden;
  padding: 1.25rem !important;
}

/* Toolbar & Title */
.fc .fc-toolbar {
  margin-bottom: 1.5rem !important;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.fc .fc-toolbar-title {
  font-size: 1.28rem !important;
  font-weight: 800 !important;
  color: #0f172a;
  letter-spacing: -0.02em;
}

/* Buttons Reskin */
.fc .fc-button {
  background: #ffffff !important;
  border: 1px solid rgba(148, 163, 184, 0.35) !important;
  color: #475569 !important;
  border-radius: var(--bs-border-radius, 12px) !important;
  padding: 0.48rem 0.88rem !important;
  font-size: 0.84rem !important;
  font-weight: 700 !important;
  box-shadow: var(--shadow-sm) !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  text-transform: capitalize !important;
}

.fc .fc-button:hover {
  background: var(--accent-soft) !important;
  border-color: var(--accent) !important;
  color: var(--accent) !important;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md) !important;
}

.fc .fc-button:active {
  transform: translateY(0) !important;
}

/* Active buttons / View togglers */
.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  box-shadow: var(--shadow-sm) !important;
}

.fc .fc-today-button {
  background: rgba(15, 138, 166, 0.08) !important;
  border-color: rgba(15, 138, 166, 0.2) !important;
  color: var(--accent) !important;
}
.fc .fc-today-button:hover {
  background: var(--accent) !important;
  color: #ffffff !important;
}

/* Day header labels */
.fc .fc-col-header-cell {
  background: rgba(14, 116, 144, 0.03) !important;
  border-color: rgba(226, 232, 240, 0.8) !important;
  padding: 0.3rem 0.25rem !important;
}

.fc .fc-col-header-cell-cushion {
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.06em !important;
  color: #475569 !important;
}

/* Grid & Border lines */
.fc-theme-standard td, 
.fc-theme-standard th,
.fc-theme-standard .fc-scrollgrid {
  border-color: rgba(226, 232, 240, 0.75) !important;
}

/* Day Grid Month View Cell styling */
.fc .fc-daygrid-day-number {
  font-size: 0.84rem !important;
  font-weight: 600;
  color: #475569;
  padding: 8px 10px !important;
  text-decoration: none !important;
}

.fc .fc-day-today {
  background: rgba(15, 138, 166, 0.03) !important;
}

.fc .fc-day-today .fc-daygrid-day-number {
  color: var(--accent) !important;
  font-weight: 800 !important;
  background: rgba(15, 138, 166, 0.12) !important;
  border-radius: 999px !important;
  min-width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 4px;
  padding: 0 !important;
}

/* Time Grid Slot styling (Hour rows) */
.fc .fc-timegrid-slot {
  height: 1.65rem !important;
}

.fc .fc-timegrid-slot-label-cushion {
  font-size: 0.76rem !important;
  font-weight: 700 !important;
  color: #64748b !important;
  text-transform: uppercase !important;
}

/* Redesign event cards globally */
.fc-v-event,
.fc-h-event,
.fc .fc-daygrid-event,
.fc .fc-timegrid-event {
  border: 0 !important;
  border-radius: var(--radius-sm, 8px) !important;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.04) !important;
  transition: transform 0.18s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.18s cubic-bezier(0.4, 0, 0.2, 1) !important;
  overflow: hidden !important;
}

.fc-v-event:hover,
.fc-h-event:hover,
.fc .fc-daygrid-event:hover,
.fc .fc-timegrid-event:hover {
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.08) !important;
  z-index: 10 !important;
}

/* Inside of event cards */
.fc-event-main {
  padding: 4px 6px !important;
  font-size: 0.78rem !important;
  font-weight: 600 !important;
  line-height: 1.4 !important;
  color: inherit !important;
}

/* Highlight indicator on the left side of events based on status/colors */
.fc-v-event,
.fc-h-event {
  border-left: 3.5px solid var(--fc-event-border-color, var(--accent)) !important;
  background: color-mix(in srgb, var(--fc-event-bg-color, var(--accent)) 12%, #ffffff) !important;
  color: var(--fc-event-bg-color, var(--accent)) !important;
}

/* Make sure active selected event is highlighted */
.fc-v-event.is-selected,
.fc-h-event.is-selected {
  box-shadow: 0 0 0 3px rgba(15, 138, 166, 0.22) !important;
}

/* Remove default fullcalendar focus dot borders */
.fc *:focus-visible {
  outline: none !important;
}

/* Mobile responsive fixes for fullcalendar toolbar */
@media (max-width: 767.98px) {
  .fc.fc-theme-standard {
    padding: 0.75rem !important;
    border-radius: var(--radius-md, 12px) !important;
  }
  .fc .fc-toolbar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.55rem !important;
  }
  .fc .fc-toolbar-title {
    font-size: 1.15rem !important;
    text-align: center !important;
    order: -1;
  }
  .fc .fc-button {
    padding: 0.35rem 0.65rem !important;
    font-size: 0.76rem !important;
  }
}

.status-btn.active.is-primary { background: #dbeafe; color: #1d4ed8; border-color: #93c5fd; }
.status-btn.active.is-success { background: #dcfce7; color: #166534; border-color: #86efac; }
.status-btn.active.is-info { background: #ccfbf1; color: #115e59; border-color: #5eead4; }
.status-btn.active.is-warning { background: #fef3c7; color: #92400e; border-color: #fbbf24; }
.status-btn.active.is-orange  { background: #ffedd5; color: #9a3412; border-color: #fdba74; }
.status-btn.active.is-danger { background: #fee2e2; color: #b91c1c; border-color: #f87171; }
.status-btn.active.is-secondary { background: #e2e8f0; color: #334155; border-color: #94a3b8; }

/* ===== Clickable status badge (advance state from table/search) ===== */
button.status-badge.apt-status-advance-btn {
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease, filter 0.14s ease;
  position: relative;
}
button.status-badge.apt-status-advance-btn::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 13px;
  border: 2px dashed currentColor;
  opacity: 0;
  transition: opacity 0.14s ease;
  pointer-events: none;
}
button.status-badge.apt-status-advance-btn:hover {
  transform: translateY(-2px);
  filter: brightness(0.94) saturate(1.1);
  box-shadow: 0 3px 8px var(--status-ring, rgba(100,116,139,0.3));
}
button.status-badge.apt-status-advance-btn:hover::after {
  opacity: 0.55;
}
button.status-badge.apt-status-advance-btn:active {
  transform: translateY(0);
  filter: brightness(0.88);
}
button.status-badge.apt-status-advance-btn:disabled {
  cursor: wait;
  opacity: 0.6;
  transform: none;
}

.appointment-status-panel {
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 18px;
  padding: 0.95rem;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: 0 18px 45px rgba(148, 163, 184, 0.14);
}

.appointment-status-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  text-align: center;
  margin-bottom: 0.85rem;
}

.appointment-status-panel__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #334155;
}

.appointment-status-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem;
}

.appointment-status-grid .status-btn {
  min-width: 154px;
  min-height: 46px;
  justify-content: center;
  border-radius: 15px;
  font-size: 0.9rem;
  padding: 0.65rem 1rem;
}

/* ===== Appointment Roadmap ===== */
@keyframes roadmap-pulse {
  0%, 100% {
    box-shadow:
      0 0 0 4px color-mix(in srgb, var(--roadmap-accent) 20%, white),
      0 6px 16px color-mix(in srgb, var(--roadmap-accent) 14%, transparent);
  }
  50% {
    box-shadow:
      0 0 0 9px color-mix(in srgb, var(--roadmap-accent) 9%, white),
      0 10px 24px color-mix(in srgb, var(--roadmap-accent) 20%, transparent);
  }
}

@keyframes roadmap-dash-spin {
  to { stroke-dashoffset: -48; }
}

.appointment-roadmap {
  display: grid;
  gap: 0.75rem;
}

.appointment-roadmap.is-horizontal {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
  position: relative;
  gap: 0.5rem;
  padding: 1.25rem 0.75rem 1rem;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 16px;
  border: 1px solid rgba(226, 232, 240, 0.8);
}

.appointment-roadmap__rail,
.appointment-roadmap__progress {
  position: absolute;
  left: calc(12.5% + 0.5rem);
  right: calc(12.5% + 0.5rem);
  top: calc(1.375rem + 1.25rem - 3px);
  height: 5px;
  border-radius: 999px;
  pointer-events: none;
}

.appointment-roadmap__rail {
  background: #dde4ee;
  z-index: 0;
}

.appointment-roadmap__progress {
  width: var(--roadmap-progress, 0%);
  right: auto;
  background: linear-gradient(90deg, #475569 0%, #64748b 100%);
  box-shadow: 0 2px 8px rgba(71, 85, 105, 0.3);
  z-index: 1;
  transition: width 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.appointment-roadmap.is-vertical {
  grid-template-columns: 1fr;
}

.appointment-roadmap.is-vertical .appointment-roadmap__rail,
.appointment-roadmap.is-vertical .appointment-roadmap__progress {
  display: none;
}

.appointment-roadmap.is-vertical .roadmap-step {
  flex-direction: row;
  align-items: center;
}

.appointment-roadmap.is-vertical .roadmap-step__body {
  align-items: flex-start;
  text-align: left;
}

.roadmap-step {
  --roadmap-accent: #94a3b8;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: #64748b;
  position: relative;
  z-index: 2;
  min-height: 0;
  box-shadow: none;
}

.roadmap-step--pending    { --roadmap-accent: #dc2626; }
.roadmap-step--confirmed  { --roadmap-accent: #d97706; }
.roadmap-step--in_progress{ --roadmap-accent: #2563eb; }
.roadmap-step--completed  { --roadmap-accent: #16a34a; }
.roadmap-step--cancelled  { --roadmap-accent: #dc2626; }

/* ---- Dot base ---- */
.roadmap-step__dot {
  width: 2.75rem;
  height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #fff;
  color: #c8d3de;
  flex-shrink: 0;
  font-size: 1rem;
  border: 2.5px solid #dde4ee;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease, box-shadow 0.3s ease;
}

/* ---- Body ---- */
.roadmap-step__body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  align-items: center;
  text-align: center;
}

.roadmap-step__label {
  font-weight: 700;
  font-size: 0.82rem;
  line-height: 1.25;
  color: #94a3b8;
  letter-spacing: 0.01em;
}

.roadmap-step__meta {
  font-size: 0.67rem;
  color: #b0bcc8;
  line-height: 1.35;
  margin-top: 0.05rem;
}

/* ---- Done — colored filled dot with ring ---- */
.roadmap-step.is-done .roadmap-step__dot {
  background: var(--roadmap-accent);
  border-color: var(--roadmap-accent);
  color: #ffffff;
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--roadmap-accent) 18%, white),
    0 4px 12px color-mix(in srgb, var(--roadmap-accent) 35%, transparent);
}

.roadmap-step.is-done .roadmap-step__label { color: var(--roadmap-accent); font-weight: 700; }
.roadmap-step.is-done .roadmap-step__meta  { color: color-mix(in srgb, var(--roadmap-accent) 65%, #64748b); }

/* ---- Current — colored + pulse ring ---- */
.roadmap-step.is-current .roadmap-step__dot {
  background: var(--roadmap-accent);
  border-color: var(--roadmap-accent);
  color: #ffffff;
  box-shadow:
    0 0 0 4px color-mix(in srgb, var(--roadmap-accent) 22%, white),
    0 4px 14px color-mix(in srgb, var(--roadmap-accent) 40%, transparent);
  animation: roadmap-pulse 2.6s ease-in-out infinite;
}

.roadmap-step.is-current .roadmap-step__label { color: var(--roadmap-accent); font-weight: 800; font-size: 0.86rem; }
.roadmap-step.is-current .roadmap-step__meta  { color: color-mix(in srgb, var(--roadmap-accent) 65%, #64748b); }

/* ---- Upcoming non-interactive — faded gray ---- */
.roadmap-step.is-upcoming {
  opacity: 0.4;
}

/* ---- Next clickable step — dashed ring, previews color on hover ---- */
.roadmap-step-btn {
  width: 100%;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.roadmap-step-btn.is-upcoming {
  opacity: 0.7;
  position: relative;
}

.roadmap-step-btn.is-upcoming .roadmap-step__dot {
  background: #f8fafc;
  border: 2.5px dashed #b0bcc8;
  color: #b0bcc8;
  box-shadow: none;
}

.roadmap-step-btn.is-upcoming .roadmap-step__label {
  color: #64748b;
  font-weight: 700;
}

.roadmap-step-btn.is-upcoming:hover {
  opacity: 1;
  transform: translateY(-3px);
}

.roadmap-step-btn.is-upcoming:hover .roadmap-step__dot {
  background: var(--roadmap-accent);
  border: 2.5px solid var(--roadmap-accent);
  color: #ffffff;
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--roadmap-accent) 18%, white),
    0 4px 12px color-mix(in srgb, var(--roadmap-accent) 35%, transparent);
}

.roadmap-step-btn.is-upcoming:hover .roadmap-step__label {
  color: var(--roadmap-accent);
}

/* ---- Cancelled slot step ---- */
.roadmap-step.is-cancelled .roadmap-step__dot {
  background: #dc2626;
  border: 2.5px solid #dc2626;
  color: #ffffff;
  box-shadow:
    0 0 0 4px rgba(220, 38, 38, 0.14),
    0 5px 16px rgba(220, 38, 38, 0.28);
}

.roadmap-step.is-cancelled .roadmap-step__label {
  color: #dc2626;
}

.roadmap-step.is-cancelled .roadmap-step__meta {
  color: #ef4444;
}

/* ---- Steps after the cancellation point — washed out ---- */
.roadmap-step.is-past-cancel {
  opacity: 0.18;
  filter: grayscale(1);
}

/* ---- Progress bar when cancelled ---- */
.appointment-roadmap.is-cancelled-state .appointment-roadmap__progress {
  background: linear-gradient(90deg, #f87171 0%, #dc2626 100%);
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.28);
}

.search-range-toggle .form-check-input {
  margin-top: 0;
}

.apt-search-topline {
  min-height: 30px;
}

@media (min-width: 768px) {
  .apt-search-col {
    display: flex;
    flex-direction: column;
    align-self: flex-start;
  }

  .apt-search-col > .form-control,
  .apt-search-col > .input-group,
  .apt-search-col > #aptSrchSingleDateWrap {
    width: 100%;
  }
}

@media (max-width: 767.98px) {
  .appointment-status-panel {
    padding: 0.85rem;
  }

  .appointment-roadmap.is-horizontal {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .appointment-roadmap__rail,
  .appointment-roadmap__progress {
    display: none;
  }

  .appointment-status-panel__header {
    align-items: center;
    text-align: left;
    justify-content: flex-start;
  }

  .appointment-status-grid .status-btn {
    min-width: calc(50% - 0.4rem);
    flex: 1 1 calc(50% - 0.4rem);
  }
}

/* ===== Map action buttons ===== */
.map-action-btn {
  font-size: 0.82rem;
  font-weight: 700;
  width: auto;
  height: auto;
  min-height: 38px;
  padding: 0.55rem 1rem;
  border-radius: 14px;
}

.map-action-btn:focus-visible {
  outline: none;
}

.map-action-btn.is-primary {
  background: #f8fafc;
  color: #2563eb;
  border-color: #bfdbfe;
}

.map-action-btn.is-success {
  background: #f8fafc;
  color: #15803d;
  border-color: #86efac;
}

.map-action-btn.is-warning {
  background: #f8fafc;
  color: #b45309;
  border-color: #fcd34d;
}

.map-action-btn.is-secondary {
  background: #f8fafc;
  color: #475569;
  border-color: #cbd5e1;
}

.map-action-btn i {
  font-size: 1rem;
}

.map-action-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin: 0 0 0.7rem;
}

.map-embed-frame {
  border-radius: 12px;
  overflow: hidden;
}

.map-embed-frame iframe {
  display: block;
  width: 100%;
  border: 0;
}

.map-modal-body {
  padding: 0.75rem;
}

.map-modal-address {
  margin-bottom: 0.85rem;
  color: #64748b;
  font-size: 0.85rem;
}

.map-section-start {
  margin-top: 1rem;
}

.map-section-shell {
  padding: 0.7rem;
  border-radius: 16px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.92) 0%, rgba(255, 255, 255, 0.98) 100%);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.05);
}

.map-section-shell .map-action-row {
  margin-bottom: 0.6rem;
}

.map-section-shell .card {
  box-shadow: none;
}

.map-section-shell .card-body {
  padding: 0.75rem !important;
}

.clinic-view-modal .modal-body {
  padding: 1rem;
}

.clinic-view-layout {
  display: grid;
  gap: 1rem;
}

.clinic-view-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.1rem;
  border-radius: 18px;
  border: 1px solid rgba(14, 116, 144, 0.12);
  background: linear-gradient(135deg, rgba(14, 116, 144, 0.08) 0%, rgba(249, 115, 22, 0.08) 100%);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.clinic-view-summary__icon {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.86);
  color: #0f6b83;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 10px 22px rgba(14, 116, 144, 0.12);
  font-size: 1.55rem;
}

.clinic-view-summary__content {
  min-width: 0;
}

.clinic-view-summary__eyebrow {
  margin-bottom: 0.2rem;
  color: #5b6472;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.clinic-view-summary__title {
  margin: 0;
  color: #2b2f38;
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.15;
}

.clinic-view-summary__subtitle {
  margin-top: 0.3rem;
  color: #5f6b7a;
  font-size: 1rem;
}

.clinic-view-summary__badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
}

.clinic-view-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.clinic-view-card {
  padding: 1rem 1.05rem;
}

.modal .card.mb-3,
.modal .clinic-view-card.mb-3 {
  margin-bottom: 0 !important;
}

.modal-card-stack {
  display: grid;
  gap: 1rem;
}

.tab-content > .modal-card-stack.active,
.tab-content > .show.modal-card-stack {
  display: grid;
}

.modal-card-stack > .clinic-view-card.mb-3,
.modal-card-stack > .card.mb-3 {
  margin-bottom: 0 !important;
}

.modal .modal-body > .clinic-view-card.mb-3 + .clinic-view-card.mb-3,
.modal .tab-pane > .clinic-view-card.mb-3 + .clinic-view-card.mb-3 {
  margin-top: 1rem !important;
}

.clinic-view-card--wide {
  grid-column: 1 / -1;
}

.clinic-view-card__label {
  margin-bottom: 0.6rem;
  color: #5f6b7a;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.clinic-view-card__headline {
  color: #2b2f38;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.35;
}

.clinic-view-card__headline.is-muted {
  color: #64748b;
}

.clinic-view-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 0.9rem;
}

.clinic-view-meta-item {
  min-width: 0;
}

.clinic-view-meta-item__label {
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.clinic-view-meta-item__value {
  margin-top: 0.18rem;
  color: #2b2f38;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  word-break: break-word;
}

.clinic-view-meta-item__value a {
  color: #0d6f9c;
  text-decoration: none;
}

.clinic-view-meta-item__value a:hover {
  color: #0b5d84;
  text-decoration: underline;
}

.clinic-view-contact-list,
.clinic-view-schedule-list {
  display: grid;
  gap: 0.75rem;
}

.clinic-view-contact-item,
.clinic-view-schedule-item {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
}

.clinic-view-contact-item__icon {
  width: 2rem;
  height: 2rem;
  flex: 0 0 2rem;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(14, 116, 144, 0.09);
  color: #0f6b83;
}

.clinic-view-schedule-item {
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

.clinic-view-schedule-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.clinic-view-schedule-item__day {
  color: #2b2f38;
  font-weight: 700;
}

.clinic-view-schedule-item__time {
  color: #475569;
  font-weight: 600;
  text-align: right;
}



.user-docs-upload-body {
  padding: 1rem 1.1rem 1.15rem;
}

.user-docs-upload-row {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
}

.user-docs-upload-field {
  flex: 1 1 auto;
  min-width: 0;
}

.user-docs-file-input {
  min-height: 3rem;
  border-radius: 14px;
  background: #fff;
}

.user-docs-help {
  display: inline-block;
  margin-top: 0.45rem;
}

.user-docs-upload-btn {
  min-width: 7rem;
  align-self: flex-start;
}

.user-docs-empty-wrap {
  padding: 1.1rem;
}

.user-docs-empty-state {
  min-height: 126px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.94) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: #475569;
  text-align: center;
}

.user-docs-empty-state__icon {
  font-size: 2rem;
  color: #64748b;
}

.user-docs-list .list-group-item {
  border-left: 0;
  border-right: 0;
}

.user-docs-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1.1rem;
}

.user-docs-item__file {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.user-docs-item__icon {
  width: 2.8rem;
  height: 2.8rem;
  flex: 0 0 2.8rem;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #2563eb;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.14);
}

.user-docs-item__icon i {
  font-size: 1.15rem;
}

.user-docs-item__meta {
  min-width: 0;
}

.user-docs-item__name {
  color: #2b2f38;
  font-weight: 700;
}

.user-docs-item__details {
  display: block;
  margin-top: 0.2rem;
  color: #64748b;
}

.user-docs-item__actions {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.55rem;
}

.user-docs-action-btn {
  width: auto;
  height: auto;
  min-height: 2.35rem;
  padding: 0.48rem 0.88rem;
}

.user-docs-action-btn.is-primary {
  border-color: rgba(14, 116, 144, 0.24);
  color: #0f766e;
  background: rgba(14, 116, 144, 0.08);
}

.user-docs-action-btn.is-neutral {
  border-color: rgba(148, 163, 184, 0.35);
  color: #475569;
  background: rgba(248, 250, 252, 0.92);
}

.user-docs-action-btn.is-danger {
  border-color: rgba(155, 28, 28, 0.3);
  color: #9b1c1c;
  background: rgba(155, 28, 28, 0.08);
}

@media (max-width: 767.98px) {
  .map-action-btn {
    min-height: 34px;
    padding: 0.48rem 0.8rem;
    border-radius: 12px;
    font-size: 0.78rem;
  }

  .map-section-shell {
    padding: 0.55rem;
    border-radius: 14px;
  }

  .map-action-row {
    gap: 0.45rem;
    margin-bottom: 0.55rem;
  }

  .clinic-view-modal .modal-body {
    padding: 0.8rem;
  }

  .clinic-view-summary {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .clinic-view-summary__badges {
    justify-content: flex-start;
  }

  .clinic-view-grid,
  .clinic-view-meta-grid {
    grid-template-columns: 1fr;
  }

  .clinic-view-schedule-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.18rem;
  }

  .clinic-view-schedule-item__time {
    text-align: left;
  }

  .user-docs-upload-row,
  .user-docs-item {
    flex-direction: column;
    align-items: stretch;
  }

  .user-docs-upload-btn {
    width: 100%;
  }

  .user-docs-item__actions {
    justify-content: stretch;
  }

  .user-docs-action-btn {
    width: 100%;
  }
}

.medical-history-modal .modal-dialog {
  max-width: 1148px;
}

.medical-history-modal .modal-body {
  padding: 1.2rem;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.78) 0%, rgba(255, 255, 255, 0.98) 100%);
}

.medical-history-modal-head {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
}

.medical-history-modal-head__avatar {
  flex: 0 0 auto;
}

.medical-history-modal-head__content {
  min-width: 0;
}

.medical-history-modal-head__eyebrow {
  color: #64748b;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.15rem;
}

.medical-history-modal-head__patient {
  color: #334155;
  font-weight: 600;
  margin-top: 0.15rem;
}

.medical-history-modal-head__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.medical-history-tabbar {
  position: static;
}

.medical-history-modal .tab-content {
  padding-bottom: 0.2rem;
}

.medical-history-modal .tab-pane .card {
  border-radius: 16px;
  border-color: rgba(203, 213, 225, 0.86) !important;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05) !important;
  overflow: hidden;
}

.medical-history-modal .tab-pane .card-header {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid rgba(203, 213, 225, 0.72);
  background: rgba(255, 255, 255, 0.94) !important;
}

.medical-history-modal .tab-pane .card-body {
  padding: 1rem;
}

.soap-history-empty {
  min-height: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.5rem;
  color: #64748b;
}

.soap-history-empty__icon {
  width: 4.25rem;
  height: 4.25rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(14, 116, 144, 0.12) 0%, rgba(59, 130, 246, 0.1) 100%);
  color: #0f5f8f;
  font-size: 1.8rem;
}

.soap-history-empty__title {
  color: #334155;
  font-size: 1rem;
  font-weight: 700;
}

.soap-history-empty__text {
  max-width: 28rem;
  font-size: 0.9rem;
}

.soap-history-list {
  display: grid;
  gap: 0.95rem;
  padding-top: 0.15rem;
}



.soap-history-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  padding: 1rem 1.1rem;
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.96) 0%, rgba(219, 234, 254, 0.88) 100%);
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}

.soap-history-trigger:hover {
  background: linear-gradient(135deg, rgba(224, 242, 254, 0.98) 0%, rgba(191, 219, 254, 0.9) 100%);
}

.soap-history-trigger:not(.collapsed) {
  background: linear-gradient(135deg, rgba(236, 253, 245, 0.98) 0%, rgba(209, 250, 229, 0.92) 100%);
  box-shadow: inset 0 -1px 0 rgba(16, 185, 129, 0.08);
}

.soap-history-trigger:not(.collapsed):hover {
  background: linear-gradient(135deg, rgba(220, 252, 231, 0.98) 0%, rgba(187, 247, 208, 0.92) 100%);
}

.soap-history-trigger.collapsed .soap-history-trigger__chevron {
  transform: rotate(0deg);
}

.soap-history-trigger:not(.collapsed) .soap-history-trigger__chevron {
  transform: rotate(180deg);
}

.soap-history-trigger__left {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
}

.soap-history-trigger__date-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.soap-history-trigger__date {
  font-weight: 700;
  font-size: 0.98rem;
  color: #1e293b;
}

.soap-history-trigger__time {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(147, 197, 253, 0.95);
  color: #0f5f8f;
  font-size: 0.8rem;
  font-weight: 600;
}

.soap-history-trigger:not(.collapsed) .soap-history-trigger__time {
  border-color: rgba(134, 239, 172, 0.95);
  color: #166534;
}

.soap-history-trigger__meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.soap-history-trigger__meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(226, 232, 240, 0.95);
  color: #5f6b7a;
  font-size: 0.78rem;
  font-weight: 600;
}

.soap-history-trigger:not(.collapsed) .soap-history-trigger__meta-pill {
  border-color: rgba(187, 247, 208, 0.98);
  color: #166534;
}

.soap-history-trigger__right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.soap-history-trigger__cta {
  color: #0f5f8f;
  font-size: 0.8rem;
  font-weight: 700;
}

.soap-history-trigger:not(.collapsed) .soap-history-trigger__cta {
  color: #166534;
}

.soap-history-trigger__chevron {
  font-size: 0.82rem;
  color: #64748b;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.soap-history-trigger:not(.collapsed) .soap-history-trigger__chevron {
  color: #166534;
}

.soap-history-body {
  border-top: 1px solid rgba(226, 232, 240, 0.92);
}

.soap-history-content {
  padding: 1rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}

.soap-history-field {
  min-width: 0;
}

.soap-history-field__label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.45rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: #5f6b7a;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.soap-history-field__label i {
  color: #94a3b8;
  font-size: 0.88rem;
}

.soap-history-field__text {
  height: auto;
  min-height: 5.5rem;
  font-size: 0.9rem;
  color: #334155;
  line-height: 1.65;
  padding: 0.85rem 0.95rem;
  background: rgba(248, 250, 252, 0.98);
  border-radius: 14px;
  border: 1px solid rgba(226, 232, 240, 0.96);
  white-space: pre-wrap;
}

.soap-history-field--notes {
  grid-column: 1 / -1;
}

.soap-history-field--notes .soap-history-field__label {
  color: #64748b;
}

.soap-history-field--notes .soap-history-field__text {
  min-height: 4.5rem;
  background: rgba(250, 250, 250, 0.98);
  color: #475569;
  border-style: dashed;
}

.medical-history-edit-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.95rem 1rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(191, 219, 254, 0.92);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.96) 0%, rgba(248, 250, 252, 0.96) 100%);
  color: #1e3a8a;
}

.medical-history-edit-banner::before {
  content: "\F4CA";
  font-family: bootstrap-icons;
  font-size: 1rem;
  line-height: 1;
  margin-top: 0.1rem;
}

.medical-history-edit-banner__text {
  color: #475569;
  margin-left: 0.25rem;
}

.medical-history-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.medical-history-modal-footer__note {
  color: #64748b;
  font-size: 0.88rem;
}

#sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 1056;
}

body.sidebar-open {
  overflow: hidden;
}

body.sidebar-open #sidebar-overlay {
  display: block;
}

body.sidebar-open .sidebar {
  left: 0;
}

body.sidebar-collapsed .sidebar {
  width: var(--sidebar-collapsed);
}

body.sidebar-collapsed .sidebar .nav-text,
body.sidebar-collapsed .sidebar .sidebar-brand span,
body.sidebar-collapsed .sidebar .nav-section {
  display: none;
}

body.sidebar-collapsed .sidebar .sidebar-brand {
  justify-content: center;
  padding: 18px 10px;
}

body.sidebar-collapsed .sidebar .sidebar-brand img {
  margin: 0;
}

body.sidebar-collapsed .sidebar .nav-link {
  justify-content: center;
  margin: 2px 8px;
  padding: 10px;
}

body.sidebar-collapsed .sidebar .nav-link i {
  margin: 0;
  width: auto;
}

body.sidebar-collapsed .sidebar .nav-link.active {
  box-shadow: inset 0 -2px 0 #0e7490;
}

body.sidebar-collapsed .app-main {
  padding-left: 24px;
}

@media (max-width: 991.98px) {
  .sidebar {
    position: fixed;
    left: -100%;
    top: 0;
    bottom: 0;
    height: 100vh;
    width: 80%;
    max-width: 300px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 80px;
  }
  
  .sidebar nav {
    padding-bottom: 40px;
  }

  .app-main {
    padding: 12px;
    max-width: 100%;
  }
  
  .container-fluid {
    padding-left: 12px;
    padding-right: 12px;
  }
  
  .row {
    margin-left: -8px;
    margin-right: -8px;
  }
  
  .row > * {
    padding-left: 8px;
    padding-right: 8px;
  }

  body.sidebar-collapsed .sidebar {
    width: 80%;
  }

  .desktop-table {
    display: none;
  }

  .mobile-list {
    display: block;
  }

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

  .dashboard-card-header,
  .card-header-band {
    align-items: center;
    flex-direction: row;
    flex-wrap: nowrap;
  }

  .dashboard-card-header > .btn,
  .dashboard-card-header .btn,
  .card-header-band > .btn,
  .card-header-band .btn,
  .card-header-band .badge {
    margin-left: auto;
  }
}

@media (max-width: 767.98px) {
  .badge.app-badge.app-badge-token {
    min-width: 2.6rem;
    min-height: 2.2rem;
    font-size: 0.92rem;
  }

  .card-header-band {
    margin: -1rem -1rem 0.9rem;
    padding: 0.95rem 1rem;
  }

  .card-header-band .card-title {
    font-size: 1rem;
    min-width: 0;
  }

  .app-action-row {
    gap: 0.4rem;
  }

  .patients-table .patients-actions-heading,
  .patients-table .patients-actions-cell {
    width: auto;
    min-width: 0;
  }

.mobile-card .d-grid.gap-2.d-sm-flex > *,
  .mobile-card .d-flex.gap-2 > *,
  .mobile-card .d-flex.gap-2.flex-wrap > *,
  .mobile-card .app-action-stack > * {
    width: 100%;
    min-width: 0;
  }

  .app-action-btn {
    justify-content: center;
  }

  .mobile-card .app-action-stack > .btn,
  .mobile-card .app-action-stack > form > .btn {
    width: 100%;
    justify-content: center;
  }

  /* app-action-row: botones icon-cuadrado horizontales con separador */
  .mobile-card .app-action-row {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
    border-top: 1px solid rgba(203, 213, 225, 0.6);
    padding-top: 0.6rem;
  }

  .mobile-card .app-action-row > form {
    width: auto;
  }

  .mobile-card .app-action-row .app-action-btn,
  .mobile-card .app-action-row > form > .app-action-btn {
    width: 2.35rem;
    height: 2.35rem;
    justify-content: center;
  }

  /* medical-history-record-actions: mismo estilo icon-cuadrado */
  .mobile-card .medical-history-record-actions > form {
    width: auto;
    flex: none;
  }

  .mobile-card .medical-history-record-actions .app-action-btn,
  .mobile-card .medical-history-record-actions > form > .app-action-btn {
    width: 2.35rem;
    height: 2.35rem;
    flex: none;
    justify-content: center;
  }

  .mobile-card .card-actions-separator {
    border-top: 1px solid rgba(203, 213, 225, 0.6);
    margin: 0.75rem 0 0.5rem;
  }

  .apt-mobile-card .app-action-row {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
    border-top: 1px solid rgba(203, 213, 225, 0.6);
    padding-top: 0.6rem;
  }

  .apt-mobile-card .app-action-row > form {
    width: auto;
  }

  .apt-mobile-card .app-action-row--compact .app-action-btn,
  .apt-mobile-card .app-action-row--compact > form > .app-action-btn {
    width: 2.35rem;
    height: 2.35rem;
    justify-content: center;
  }

  .dashboard-card-header {
    margin: -1rem -1rem 0.9rem;
    padding: 0.95rem 1rem;
  }

  .dashboard-card-title-row {
    align-items: center;
    min-width: 0;
  }

  .dashboard-card-title {
    font-size: 1rem;
  }

  .dashboard-stat-value {
    font-size: 1.4rem;
  }
}

@media (max-width: 576px) {
  .app-toast-container {
    left: 0.75rem;
    right: 0.75rem;
    top: 0.75rem;
  }

  .app-toast {
    min-width: 0;
    width: 100%;
    max-width: none;
  }
}

/* ── Login Page ───────────────────────────────────────────── */
.login-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top left, #eef2ff 0%, #f6f7fb 35%, #f8fafc 100%);
  padding: 1.5rem;
  overflow-y: auto;
}

.login-card-wrap {
  display: flex;
  width: 100%;
  max-width: 880px;
  min-height: 540px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(14, 116, 144, 0.13), 0 2px 8px rgba(15, 23, 42, 0.08);
  background: #fff;
  border: 1px solid rgba(14, 116, 144, 0.14);
}

/* Left brand panel */
.login-panel-brand {
  flex: 0 0 42%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(14, 116, 144, 0.18) 0%, rgba(249, 115, 22, 0.14) 100%);
  border-right: 1px solid rgba(14, 116, 144, 0.15);
  padding: 2.5rem 2rem;
}

.lp-deco {
  position: absolute;
  border-radius: 50%;
  opacity: 0.18;
  background: rgba(14, 116, 144, 0.35);
  pointer-events: none;
}
.lp-deco-1 { width: 340px; height: 340px; top: -90px; right: -110px; }
.lp-deco-2 { width: 210px; height: 210px; bottom: -65px; left: -65px; }
.lp-deco-3 { width: 110px; height: 110px; top: 42%; left: 8%; }

.login-brand-body {
  position: relative;
  z-index: 1;
  text-align: center;
  color: #0f172a;
}

.login-brand-img {
  max-height: 72px;
  max-width: 180px;
  object-fit: contain;
  margin-bottom: 1.25rem;
}

.login-brand-icon {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(14, 116, 144, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
}
.login-brand-icon i { font-size: 2rem; color: #0f3d56; }

.login-brand-name {
  font-size: 1.6rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.3rem;
  letter-spacing: -0.01em;
}

.login-brand-tagline {
  font-size: 0.875rem;
  color: #526277;
  margin-bottom: 1.75rem;
}

.login-brand-features {
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: left;
  display: inline-block;
}
.login-brand-features li {
  font-size: 0.82rem;
  color: #374151;
  margin-bottom: 0.55rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.login-brand-features li i { color: #0e7490; font-size: 0.95rem; }

/* Right form panel */
.login-panel-form {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 2.25rem;
  background: #fff;
}

.login-form-body {
  width: 100%;
  max-width: 340px;
}

.login-form-header { margin-bottom: 1.75rem; }

.login-greeting {
  font-size: 1.45rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.2rem;
}

.login-greeting-sub {
  font-size: 0.875rem;
  color: #64748b;
  margin: 0;
}

.login-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.35rem;
  display: block;
}

.login-input-wrap { position: relative; }

.login-input-icon {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 1rem;
  pointer-events: none;
  z-index: 2;
}

.login-input {
  padding-left: 2.5rem !important;
  border-radius: 10px !important;
  border-color: #e2e8f0 !important;
  background: #f8fafc !important;
  font-size: 0.9rem;
  height: 44px;
  transition: border-color .2s, box-shadow .2s;
}
.login-input:focus {
  background: #fff !important;
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12) !important;
}
.login-input-pass { padding-right: 2.75rem !important; }

.login-eye-btn {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #94a3b8;
  padding: 0;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}
.login-eye-btn:hover { color: #475569; }

.login-remember .form-check-label {
  font-size: 0.82rem;
  color: #64748b;
}

.login-submit-btn {
  background: linear-gradient(135deg, #0f8aa6 0%, #0d5e9b 100%);
  border-color: #0d6f9c;
  color: #fff;
  border-radius: 10px;
  height: 44px;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: background .2s, transform .15s;
}
.login-submit-btn:hover { background: linear-gradient(135deg, #0d7f98 0%, #0b5388 100%); border-color: #0b6690; color: #fff; transform: translateY(-1px); }
.login-submit-btn:active { transform: translateY(0); }

.login-clinic-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid #f1f5f9;
}
.login-clinic-logo { max-height: 36px; max-width: 80px; object-fit: contain; }
.login-clinic-name { font-size: 0.82rem; font-weight: 600; color: #334155; }
.login-clinic-meta { font-size: 0.75rem; color: #94a3b8; }

/* Mobile: stack panels */
@media (max-width: 768px) {
  .login-shell {
    align-items: flex-start;
    padding: 1rem;
  }
  .login-card-wrap {
    flex-direction: column;
    min-height: unset;
    border-radius: 16px;
  }
  .login-panel-brand {
    flex: none;
    padding: 1.75rem 1.5rem;
  }
  .login-brand-features { display: none; }
  .login-brand-tagline { margin-bottom: 0; }
  .login-panel-form { padding: 1.75rem 1.5rem; }
  .login-form-body { max-width: 100%; }
}

/* Utilidades personalizadas alineadas con Bootstrap */
.avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
}

.avatar-md {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
}

.avatar-lg {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  object-fit: cover;
}

.avatar-xl {
  width: 120px;
  height: 120px;
  border-radius: 12px;
  object-fit: cover;
}

.app-avatar-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f8f9fa;
  color: #6c757d;
  flex-shrink: 0;
}

.app-avatar-placeholder.is-md {
  width: 40px;
  height: 40px;
  border-radius: 8px;
}

.app-avatar-placeholder.is-sm {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.app-avatar-placeholder.is-28 {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.app-avatar-placeholder.is-45 {
  width: 45px;
  height: 45px;
  border-radius: 12px;
}

.app-avatar-placeholder.is-56 {
  width: 56px;
  height: 56px;
  min-width: 56px;
  border-radius: 12px;
}

.app-avatar-placeholder.is-64 {
  width: 64px;
  height: 64px;
  border-radius: 14px;
}

.app-avatar-placeholder.is-lg {
  width: 80px;
  height: 80px;
  border-radius: 8px;
}

.app-avatar-placeholder.is-xl {
  width: 120px;
  height: 120px;
  border-radius: 12px;
}

.quick-view-shell {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.quick-view-hero {
  padding: 1rem 1.05rem;
}

.quick-view-pdf-btn {
  border-radius: 16px;
  padding: 0.55rem 1rem;
  font-weight: 600;
}

.quick-view-footer-pdf-btn {
  min-width: 118px;
  min-height: 46px;
  border-radius: 16px;
  padding: 0.7rem 1.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 0.98rem;
  line-height: 1;
}

.quick-view-footer-pdf-btn i {
  font-size: 1.05rem;
}

.quick-view-card {
  padding: 1rem 1.05rem;
}

.quick-view-card.is-full {
  grid-column: 1 / -1;
}

.quick-view-card-body {
  padding: 0;
}

.quick-view-treatment-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.quick-view-divider {
  margin: 1rem 0;
  border: 0;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
}

.quick-view-text-block {
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: #f8fafc;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  color: #0f172a;
}

.quick-view-subtitle {
  display: block;
  color: #6b7280;
  margin-bottom: 0.5rem;
}

.quick-view-services {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.quick-view-service-item {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
}

.quick-view-service-item + .quick-view-service-item {
  padding-top: 0.85rem;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
}

.quick-view-service-icon {
  color: #3f8f5a;
  font-size: 1rem;
  line-height: 1.5;
  margin-top: 0.1rem;
}

.quick-view-service-name {
  font-weight: 700;
  color: #0f172a;
}

.quick-view-service-detail {
  color: #6b7280;
  margin-top: 0.15rem;
}

.quick-view-empty {
  color: #94a3b8;
  font-style: italic;
}

@media (max-width: 991.98px) {
  .quick-view-treatment-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 575.98px) {
  .mobile-patient-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }

  .mobile-patient-main {
    align-items: flex-start;
  }

  .mobile-patient-id {
    align-self: start;
    margin-top: 0.1rem;
  }

  .mobile-patient-alias {
    display: block;
    margin-top: 0.15rem;
  }

  .mobile-card .app-contact-group {
    gap: 0.45rem;
  }

  .mobile-card .app-contact-group .btn {
    width: 2.35rem;
    min-width: 2.35rem;
    height: 2.35rem;
    flex: 0 0 auto;
  }

  .patient-row-avatar {
    width: 52px;
    height: 52px;
    border-radius: 12px;
  }

  .patient-row-name {
    font-size: 0.92rem;
  }

  .patient-mobile-subrow {
    gap: 0.5rem;
  }

  .patient-mobile-subrow .patient-modalidad-cell {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
  }

  .patient-modalidad-site {
    max-width: none;
  }

}

/* Íconos cuadrados */
.icon-box {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: white;
}

.icon-box-md {
  width: 40px;
  height: 40px;
  font-size: 20px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.icon-box-lg {
  width: 50px;
  height: 50px;
  font-size: 24px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.icon-box-xl {
  width: 60px;
  height: 60px;
  font-size: 32px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.icon-btn-lg {
  aspect-ratio: 1;
  font-size: 1.5rem;
}

.app-picker-stack {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.app-picker-control {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 250, 252, 0.92) 100%);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.app-picker-swatch {
  width: 4.1rem;
  height: 4.1rem;
  border: 1px solid rgba(148, 163, 184, 0.22) !important;
  border-radius: 18px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12) !important;
  flex-shrink: 0;
}

.app-picker-swatch::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0.06) 45%, rgba(15, 23, 42, 0.12) 100%),
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.38) 0%, rgba(255, 255, 255, 0) 58%);
  z-index: 0;
}

.app-picker-swatch::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  z-index: 0;
}

.app-picker-swatch.icon-box-lg {
  font-size: 1.55rem;
}

.app-picker-swatch span,
.app-picker-swatch i {
  color: #fff;
  position: relative;
  z-index: 1;
  text-shadow: 0 1px 2px rgba(15, 23, 42, 0.2);
}

.app-picker-meta {
  min-width: 0;
  flex: 1;
}

.app-picker-trigger {
  width: 100%;
  justify-content: flex-start;
}

.app-picker-help {
  display: block;
  margin-top: 0.4rem;
}

.app-picker-preview {
  padding: 1rem;
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 250, 252, 0.92) 100%);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.app-picker-preview .icon-box-xl {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 10px 18px rgba(15, 23, 42, 0.1);
}

@media (max-width: 767.98px) {
  .app-picker-control {
    padding: 0.8rem;
  }

  .app-picker-swatch {
    width: 3.65rem;
    height: 3.65rem;
  }
}

.logo-height-sm {
  height: 48px;
  width: auto;
  object-fit: contain;
}

.logo-height-md {
  height: 80px;
  width: auto;
  object-fit: contain;
}

.icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  gap: 0.5rem;
}

.text-truncate-150 {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.color-input-lg {
  height: 50px;
}

/* Clases para imágenes circulares */
.avatar-circle-sm {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 50%;
}

.avatar-circle-md {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 50%;
}

.avatar-circle-lg {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 50%;
}

/* Placeholder para fotos de perfil */
.profile-placeholder {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f3f4f6;
}

.profile-placeholder-sm {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #dbeafe;
}

.profile-placeholder-md {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f3f4f6;
}

/* Logo de clínica */
.clinic-logo {
  width: 50px;
  height: 50px;
  object-fit: contain;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 5px;
}

/* Mapa de clinica */
.clinic-map {
  height: 240px;
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
}

/* Modal de imagen */
.modal-img-zoom {
  max-height: 70vh;
}

/* Cursor pointer */
.cursor-pointer {
  cursor: pointer;
}

/* Modal body scrollable */
.modal-body-scrollable {
  max-height: 70vh;
  overflow-y: auto;
}

.modal-content {
  border: 1px solid rgba(14, 116, 144, 0.12);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid rgba(14, 116, 144, 0.12);
  background: linear-gradient(135deg, rgba(14, 116, 144, 0.08) 0%, rgba(249, 115, 22, 0.10) 100%);
  box-shadow: inset 0 -1px 0 rgba(15, 23, 42, 0.05);
}

.modal-header.bg-light {
  background: linear-gradient(135deg, rgba(14, 116, 144, 0.08) 0%, rgba(249, 115, 22, 0.10) 100%) !important;
  border-bottom-color: rgba(14, 116, 144, 0.12);
}

.modal-header.bg-danger {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.14) 0%, rgba(249, 115, 22, 0.14) 100%) !important;
  border-bottom-color: rgba(239, 68, 68, 0.18);
  color: #991b1b !important;
}

.modal-header.bg-danger .modal-title,
.modal-header.bg-danger .btn-close {
  color: inherit;
}

.modal-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
}

.modal-header .btn-close {
  flex-shrink: 0;
  padding: 0.9rem;
  margin: 0;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 12px;
  background-color: rgba(255, 255, 255, 0.8);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  opacity: 0.85;
}

.modal-header .btn-close:hover {
  background-color: rgba(255, 255, 255, 0.98);
  opacity: 1;
}

.modal-footer {
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  padding: 0.95rem 1.2rem 1.1rem;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.55) 0%, rgba(255, 255, 255, 0.96) 100%);
}

.app-body .form-check {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 1.5rem;
}

.app-body .form-check-input {
  flex-shrink: 0;
  margin-top: 0;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background-color: rgba(255, 255, 255, 0.98);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.app-body .form-check-input:focus {
  border-color: rgba(14, 116, 144, 0.4);
  box-shadow: 0 0 0 0.2rem rgba(14, 116, 144, 0.14);
}

.app-body .form-check-input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 0.4rem;
}

.app-body .form-check-input:checked {
  border-color: #2563eb;
  background-color: #2563eb;
}

.app-body .form-check-label {
  color: #334155;
  font-weight: 500;
}

.app-body .form-switch {
  padding-left: 0;
}

.app-body .form-switch .form-check-input {
  width: 2.9rem;
  height: 1.6rem;
  margin-left: 0;
  border-radius: 999px;
  border-color: rgba(148, 163, 184, 0.34);
  background-color: rgba(226, 232, 240, 0.95);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08);
}

.app-body .form-switch .form-check-input:checked {
  border-color: rgba(37, 99, 235, 0.32);
  background-color: #2563eb;
}

.app-body .form-switch .form-check-input:not(:checked) {
  background-position: left center;
}

.app-body .form-switch .form-check-input:checked {
  background-position: right center;
}

/* Pain scale - Escala de dolor */
.pain-scale-0 { background-color: #22c55e; }
.pain-scale-1 { background-color: #4ade80; }
.pain-scale-2 { background-color: #84cc16; }
.pain-scale-3 { background-color: #d4e815; }
.pain-scale-4 { background-color: #fde047; }
.pain-scale-5 { background-color: #fbbf24; }
.pain-scale-6 { background-color: #f59e0b; }
.pain-scale-7 { background-color: #f97316; }
.pain-scale-8 { background-color: #ef4444; }
.pain-scale-9 { background-color: #dc2626; }
.pain-scale-10 { background-color: #991b1b; }

.pain-scale-card {
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  padding: 1rem 1rem 1.1rem;
}

.pain-scale-card-modal {
  margin-bottom: 1rem;
}

.pain-scale-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
}

.pain-scale-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .35rem .7rem;
  border-radius: 999px;
  background: #e0f2fe;
  color: #075985;
  font-size: .78rem;
  font-weight: 700;
  white-space: nowrap;
}

.pain-scale-visual {
  display: grid;
  grid-template-columns: repeat(11, minmax(0, 1fr));
  gap: .35rem;
  align-items: end;
}

.pain-scale-step {
  min-width: 0;
  text-align: center;
}

.pain-scale-step-label {
  display: block;
  min-height: 2rem;
  margin-bottom: .25rem;
  color: #64748b;
  font-size: .67rem;
  line-height: 1.05;
}

.pain-scale-step-number {
  display: block;
  margin-bottom: .35rem;
  color: #0f172a;
  font-size: .8rem;
  font-weight: 700;
}

.pain-scale-step-bar {
  height: 2.6rem;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35);
}

.pain-view-toggle {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .25rem;
  border-radius: 999px;
  background: #e2e8f0;
}

.pain-view-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  border: 0;
  border-radius: 999px;
  padding: .45rem .8rem;
  background: transparent;
  color: #334155;
  font-size: .85rem;
  font-weight: 600;
  transition: background-color .18s ease, color .18s ease, box-shadow .18s ease;
}

.pain-view-toggle-btn.is-active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.14);
}

.pain-level-display h1 {
  margin-bottom: .25rem;
  font-size: 4rem;
  font-weight: 800;
  line-height: 1;
}

@media (max-width: 767.98px) {
  .pain-scale-header-row {
    flex-direction: column;
    align-items: stretch;
  }

  .pain-scale-visual {
    gap: .2rem;
  }

  .pain-scale-step-label {
    min-height: 1.6rem;
    font-size: .58rem;
  }

  .pain-scale-step-number {
    font-size: .72rem;
  }

  .pain-scale-step-bar {
    height: 2.15rem;
    border-radius: 9px;
  }

  .pain-view-toggle {
    width: 100%;
  }

  .pain-view-toggle-btn {
    flex: 1 1 0;
    justify-content: center;
  }

  .pain-level-display h1 {
    font-size: 3.25rem;
  }
}

/* Mínimos anchos para switches */
.form-switch-min-180 {
  min-width: 180px;
}

.form-switch-min-250 {
  min-width: 250px;
}

.form-switch-min-150 {
  min-width: 150px;
}

/* SVG body silhouette */
.body-silhouette {
  width: 100%;
  cursor: pointer;
  display: block;
}

.body-silhouette-hidden {
  display: none;
}

/* Contenedor posicionado para mapa de dolor */
.pain-map-container {
  max-width: 450px;
  margin: 0 auto;
}

.pain-map-buttons {
  top: 80px;
  z-index: 10;
}

/* ─── FAB Speed-dial flotante ──────────────────────────────────── */
.fab-wrap {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-end;
  gap: 10px;
  z-index: 1068;
  pointer-events: none;
}

/* Botón principal — glass */
.fab-trigger {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(13, 94, 155, 0.25);
  background: rgba(13, 94, 155, 0.08);
  color: rgba(13, 94, 155, 0.55);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(13, 94, 155, 0.1), inset 0 1px 0 rgba(255,255,255,0.6);
  pointer-events: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px) scale(0.82);
  transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease,
              background 0.2s ease, box-shadow 0.2s ease;
  outline: none;
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
}
.fab-wrap.fab-visible .fab-trigger {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
.fab-trigger:hover {
  background: rgba(13, 94, 155, 0.14);
  box-shadow: 0 4px 16px rgba(13, 94, 155, 0.18), inset 0 1px 0 rgba(255,255,255,0.6);
  transform: scale(1.1);
}
.fab-trigger:active { transform: scale(0.93); }
.fab-trigger i {
  display: block;
  line-height: 1;
  transition: transform 0.25s ease;
}
.fab-wrap.fab-open .fab-trigger i {
  transform: rotate(45deg);
}

/* Dial (acciones) — estilo sólido igual al trigger anterior */
.fab-dial {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}
.fab-item {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #0f8aa6 0%, #0d5e9b 100%);
  color: #fff;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(13, 94, 155, 0.4);
  pointer-events: none;
  opacity: 0;
  transform: translateY(12px) scale(0.8);
  transition: opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}
/* Stagger: menú (nth-child 2, más cercano al trigger) aparece primero */
.fab-dial .fab-item:nth-child(2) { transition-delay: 0s; }
.fab-dial .fab-item:nth-child(1) { transition-delay: 0.07s; }

.fab-wrap.fab-open .fab-item {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.fab-item:hover {
  transform: translateY(-2px) scale(1.06);
  box-shadow: 0 8px 24px rgba(13, 94, 155, 0.48);
}
.fab-item:active { transform: scale(0.94); }
.fab-item i { display: block; line-height: 1; }

@media (max-width: 576px) {
  .fab-wrap { bottom: 16px; right: 14px; }
  .fab-trigger { width: 36px; height: 36px; font-size: 17px; }
  .fab-item { width: 50px; height: 50px; font-size: 19px; }
}

/* ─── Pill Tabs (modales historial clínico) ───────────────────── */
.nav-tabs-pill-wrap {
  display: block;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(14, 116, 144, 0.3) transparent;
  background: linear-gradient(135deg, rgba(14, 116, 144, 0.08) 0%, rgba(249, 115, 22, 0.10) 100%);
  border: 1px solid rgba(14, 116, 144, 0.12);
  border-radius: 16px;
  box-shadow: inset 0 -1px 0 rgba(15, 23, 42, 0.04);
  padding: 8px 8px 12px 8px;
  margin-bottom: 1.25rem;
  cursor: grab;
  user-select: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.nav-tabs-pill-wrap.active-dragging {
  cursor: grabbing;
}
.nav-tabs-pill-wrap::-webkit-scrollbar {
  height: 6px;
  display: block !important;
}
.nav-tabs-pill-wrap::-webkit-scrollbar-track {
  background: rgba(14, 116, 144, 0.03);
  border-radius: 10px;
}
.nav-tabs-pill-wrap::-webkit-scrollbar-thumb {
  background-color: rgba(14, 116, 144, 0.35);
  border-radius: 10px;
}
.nav-tabs-pill-wrap::-webkit-scrollbar-thumb:hover {
  background-color: rgba(14, 116, 144, 0.6);
}

.nav-tabs-pill {
  display: flex;
  flex-wrap: nowrap;
  gap: 2px;
  border: none;
  width: max-content;
  min-width: 100%;
}

.nav-tabs-pill .nav-item { flex-shrink: 0; }

.nav-tabs-pill .nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--app-muted);
  background: transparent;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s, border-color 0.15s;
  line-height: 1.3;
}

.nav-tabs-pill .nav-link i {
  font-size: 1rem;
  flex-shrink: 0;
}

.nav-tabs-pill .nav-link:hover:not(.active) {
  background: rgba(255, 255, 255, 0.62);
  border-color: rgba(14, 116, 144, 0.12);
  color: #0f3d56;
}

.nav-tabs-pill .nav-link.active {
  background: rgba(255, 255, 255, 0.95);
  color: #2563eb;
  border-color: rgba(37, 99, 235, 0.16);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.12), 0 0 0 1px rgba(37, 99, 235, 0.06);
  font-weight: 600;
}

/* En móvil: 2 filas compactas con icono + texto pequeño */
@media (max-width: 575.98px) {
  .medical-history-modal-head {
    align-items: flex-start;
  }

  .medical-history-modal-head__chips {
    gap: 0.35rem;
  }

  .medical-history-edit-banner {
    padding: 0.85rem;
  }

  .medical-history-modal-footer {
    align-items: center;
    justify-content: flex-end;
  }

  .medical-history-modal-footer__note {
    width: 100%;
  }

  .nav-tabs-pill {
    flex-wrap: wrap;
    width: 100%;
  }
  .nav-tabs-pill .nav-item {
    flex: 1 1 calc(20% - 2px); /* 5 por fila */
    min-width: 0;
  }
  .nav-tabs-pill .nav-link {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 4px;
    font-size: 0.62rem;
    text-align: center;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .nav-tabs-pill .nav-link i {
    font-size: 1rem;
  }
  .nav-tabs-pill .nav-link.active {
    padding: 6px 4px;
  }

  .soap-history-trigger {
    align-items: flex-start;
    flex-direction: column;
  }

  .soap-history-trigger__right {
    width: 100%;
    justify-content: space-between;
  }

  .soap-history-content {
    grid-template-columns: 1fr;
  }

  .soap-history-field__text {
    min-height: 0;
  }
}

/* ===== Editor de texto del footer ===== */
.footer-editor-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 5px 8px;
  background: #f1f5f9;
  border: 1px solid #d1d9e0;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
}

.fed-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 28px;
  padding: 0 6px;
  font-size: 0.8rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  color: #374151;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.fed-btn:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
}

.fed-btn.active {
  background: #dbeafe;
  border-color: #93c5fd;
  color: var(--accent);
}

.fed-sep {
  display: inline-block;
  width: 1px;
  height: 18px;
  background: #d1d9e0;
  margin: 0 4px;
}

.footer-editor-area {
  min-height: 80px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #d1d9e0;
  border-radius: 0 0 6px 6px;
  font-size: 0.875rem;
  color: #1f2430;
  outline: none;
  line-height: 1.6;
}

.footer-editor-area:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

/* ===== Footer ===== */
.app-footer {
  border-top: 1px solid rgba(0, 0, 0, 0.07);
  background: #ffffff;
  padding: 14px 24px;
  margin-top: auto;
}

.app-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.app-footer-text {
  font-size: 0.82rem;
  color: #5d7999;
  line-height: 1.6;
}

.app-footer-social {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.footer-social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  text-decoration: none;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.footer-social-icon img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  display: block;
}

.footer-social-icon:hover {
  transform: scale(1.08);
  opacity: 0.85;
}

@media (max-width: 575.98px) {
  .app-footer {
    padding: 12px 16px;
  }
  .app-footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}


/* ─ Fix: el picker nativo de tiempo (type="time") en Android/Chrome dentro de un
       modal Bootstrap queda recortado porque Bootstrap agrega padding-right al body
       para compensar el scrollbar (inexistente en móvil). Se elimina en pantallas
       pequeñas para que el diálogo ocupe el ancho completo de pantalla. ─ */
@media (max-width: 767.98px) {
  body.modal-open {
    padding-right: 0 !important;
    overflow-x: hidden !important;
  }
  /* Asegurar que el modal ocupe el 100% sin desborde */
  .modal-dialog {
    margin: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
  }
  .modal-content {
    border-radius: 0 !important;
  }
}

/* ===== Modalidad Picker / Filter Pills / Badge ===== */
.birth-date-wrapper .form-control { cursor: pointer; }
.birth-date-wrapper .input-group-text { cursor: pointer; background: #fff; }

.modalidad-picker {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
}
.modalidad-btn {
    flex: 1;
    min-width: 75px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.7rem 0.4rem;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    background: #f8fafc;
    color: #64748b;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.18s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    user-select: none;
}
.modalidad-btn i { font-size: 1.3rem; transition: transform 0.18s ease; }
.modalidad-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.10); }
.modalidad-btn:hover i { transform: scale(1.15); }
.modalidad-btn.modalidad-clinica:hover,
.modalidad-btn.modalidad-clinica.is-active {
    background: rgba(59,130,246,0.13); border-color: #3b82f6; color: #1d4ed8;
}
.modalidad-btn.modalidad-clinica.is-active { box-shadow: 0 0 0 3px rgba(59,130,246,0.22); }
.modalidad-btn.modalidad-hospital:hover,
.modalidad-btn.modalidad-hospital.is-active {
    background: rgba(245,158,11,0.13); border-color: #f59e0b; color: #b45309;
}
.modalidad-btn.modalidad-hospital.is-active { box-shadow: 0 0 0 3px rgba(245,158,11,0.22); }
.modalidad-btn.modalidad-domicilio:hover,
.modalidad-btn.modalidad-domicilio.is-active {
    background: rgba(16,185,129,0.13); border-color: #10b981; color: #047857;
}
.modalidad-btn.modalidad-domicilio.is-active { box-shadow: 0 0 0 3px rgba(16,185,129,0.22); }

.modalidad-filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}
.modalidad-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.32rem 0.8rem;
    border-radius: 10px;
    border: 1.5px solid #e2e8f0;
    background: #f8fafc;
    color: #475569;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1.4;
}
.modalidad-filter-pill:hover { border-color: #94a3b8; background: #f1f5f9; color: #1e293b; }
.modalidad-filter-pill.pill-clinica  { border-color: #bfdbfe; color: #3b82f6; }
.modalidad-filter-pill.pill-hospital { border-color: #fde68a; color: #d97706; }
.modalidad-filter-pill.pill-domicilio{ border-color: #6ee7b7; color: #059669; }
.modalidad-filter-pill.pill-sin      { border-color: #cbd5e1; color: #64748b; }
.modalidad-filter-pill.fp-todas    { background: #1e293b; border-color: #1e293b; color: #fff; }
.modalidad-filter-pill.fp-clinica  { background: #3b82f6; border-color: #2563eb; color: #fff; }
.modalidad-filter-pill.fp-hospital { background: #f59e0b; border-color: #d97706; color: #fff; }
.modalidad-filter-pill.fp-domicilio{ background: #10b981; border-color: #059669; color: #fff; }
.modalidad-filter-pill.fp-sin      { background: #64748b; border-color: #475569; color: #fff; }

.modalidad-badge {
    font-size: 0.82rem;
    padding: 0.35em 0.72em;
    border-radius: 10px;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
    border: 1.5px solid transparent;
    white-space: nowrap;
}
.mb-clinica  { background: #f8fafc; color: #3b82f6; border-color: #bfdbfe; }
.mb-hospital { background: #f8fafc; color: #d97706; border-color: #fde68a; }
.mb-domicilio{ background: #f8fafc; color: #059669; border-color: #6ee7b7; }
.mb-sin      { background: #f8fafc; color: #64748b; border-color: #cbd5e1; }

/* ===== Tarjetas móvil de citas / SOAP ===== */
.apt-mobile-card {
    border: 1px solid rgba(203, 213, 225, 0.5);
    border-left-width: 3px;
    border-radius: 12px;
    padding: 0.85rem 1rem;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}
.apt-mobile-card + .apt-mobile-card {
    margin-top: 0.6rem;
}
.apt-mobile-card.mc-pending     { border-left-color: #dc2626; }
.apt-mobile-card.mc-confirmed   { border-left-color: #d97706; }
.apt-mobile-card.mc-in_progress { border-left-color: #2563eb; }
.apt-mobile-card.mc-completed   { border-left-color: #16a34a; }
.apt-mobile-card.mc-cancelled   { border-left-color: #94a3b8; }

/* ===== Image upload zone ===== */
.logo-upload-zone {
  position: relative;
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color .18s, background .18s;
  overflow: hidden;
}
.logo-upload-zone:hover {
  border-color: #94a3b8;
  background: #f1f5f9;
}
.logo-upload-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  z-index: 2;
}
.logo-upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  padding: 1rem;
  text-align: center;
}
.logo-upload-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .75rem;
  width: 100%;
}
.logo-upload-img {
  max-height: 90px;
  max-width: 100%;
  object-fit: contain;
  border-radius: 8px;
}
.logo-upload-clear {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 3;
  background: rgba(255,255,255,.9);
  border: 1px solid #e2e8f0;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  color: #64748b;
  cursor: pointer;
  transition: background .15s, color .15s;
  line-height: 1;
}
.logo-upload-clear:hover {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
}
/* ── Medical history modal footer ── */
.medical-history-modal-footer {
  justify-content: flex-end;
  padding: 1rem 1.25rem 1.15rem;
  border-top: 1px solid #e2e8f0;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.88) 0%, #ffffff 100%);
}
.medical-history-modal-footer__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .75rem;
  width: 100%;
  flex-wrap: nowrap;
}

@media (max-width: 767.98px) {
  .modal-footer,
  .medical-history-modal-footer {
    border-top: 1px solid #e2e8f0;
  }
  .medical-history-modal-footer {
    padding: .9rem 1rem 1rem;
    justify-content: flex-end;
  }
  .medical-history-modal-footer__actions {
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: .55rem;
    flex-wrap: nowrap;
    width: auto;
  }
  .medical-history-modal-footer__actions .btn {
    flex: 0 0 auto;
    min-width: 0;
  }
}

/* ── Schedule grid (Horario de Atención) ── */
.schedule-grid {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr) minmax(0, 1fr) 4.5rem;
  gap: 0.4rem;
  align-items: center;
}
.schedule-grid input[type="time"] {
  min-width: 0;
  width: 100%;
}
.schedule-grid__day {
  font-size: .9rem;
}

/* Fix: <form> wrapping modal-body inside scrollable modal breaks Bootstrap flex chain */
.modal-dialog-scrollable .modal-content > form {
  flex: 1 1 auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* ── Diálogo de confirmación estilizado (global) ──────────── */
.calendar-prompt-modal {
    border: none;
    border-radius: 20px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.08), 0 32px 72px rgba(15, 23, 42, 0.16);
}

.calendar-prompt-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.85rem;
    padding: 1.1rem 1.1rem 0.85rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.98) 0%, rgba(241, 245, 249, 0.92) 100%);
}

.calendar-prompt-modal__title-wrap {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
}

.calendar-prompt-modal__icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, 0.12);
    color: #2563eb;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.calendar-prompt-modal__eyebrow {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #94a3b8;
    margin-bottom: 0.1rem;
}

.calendar-prompt-modal__title {
    font-size: 1.08rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
}

.calendar-prompt-modal__message {
    padding: 1rem 1.1rem 0.75rem;
    color: #334155;
    font-size: 0.965rem;
    line-height: 1.6;
    white-space: pre-line;
}

.calendar-prompt-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    padding: 0 1.1rem 1.1rem;
}

.calendar-prompt-modal__actions .btn {
    min-width: 110px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.92rem;
    padding: 0.58rem 1.1rem;
    transition: filter 0.15s, box-shadow 0.15s;
}

.calendar-prompt-modal__actions .btn:hover {
    filter: brightness(0.94);
}

.calendar-prompt-modal__actions .btn-light {
    border: 1.5px solid rgba(203, 213, 225, 0.92);
    background: #fff;
    color: #475569;
}

.calendar-prompt-modal.is-danger .calendar-prompt-modal__icon {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

.calendar-prompt-modal.is-danger .calendar-prompt-modal__header {
    background: linear-gradient(135deg, rgba(254, 242, 242, 0.98) 0%, rgba(254, 226, 226, 0.92) 100%);
    border-bottom-color: rgba(252, 165, 165, 0.55);
}

.calendar-prompt-modal.is-danger .btn-prompt-confirm {
    background: #dc2626;
    border-color: #dc2626;
    color: #fff;
}

.calendar-prompt-modal.is-success .calendar-prompt-modal__icon {
    background: rgba(34, 197, 94, 0.12);
    color: #15803d;
}

.calendar-prompt-modal.is-success .calendar-prompt-modal__header {
    background: linear-gradient(135deg, rgba(240, 253, 244, 0.98) 0%, rgba(220, 252, 231, 0.92) 100%);
    border-bottom-color: rgba(134, 239, 172, 0.55);
}

.calendar-prompt-modal.is-success .btn-prompt-confirm {
    background: #16a34a;
    border-color: #16a34a;
    color: #fff;
}

.calendar-prompt-modal.is-warning .calendar-prompt-modal__icon {
    background: rgba(245, 158, 11, 0.14);
    color: #d97706;
}

.calendar-prompt-modal.is-warning .calendar-prompt-modal__header {
    background: linear-gradient(135deg, rgba(255, 251, 235, 0.98) 0%, rgba(254, 243, 199, 0.92) 100%);
    border-bottom-color: rgba(252, 211, 77, 0.55);
}

.calendar-prompt-modal.is-warning .btn-prompt-confirm {
    background: #d97706;
    border-color: #d97706;
    color: #fff;
}

/* ===== Fee Control ===== */
.fee-control-shell {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.fee-control-card > .card-body {
    padding: 1rem;
}

.fee-control-tabs {
    margin-bottom: 1rem;
}

.fee-control-tab-content {
    border: 1px solid rgba(226, 232, 240, 0.92);
    border-radius: 14px;
    background: #fff;
    overflow: hidden;
}

.fee-control-section {
    padding: 1rem;
}

.fee-control-section + .fee-control-section,
.fee-control-toolbar,
.fee-control-legend,
.fee-control-table-wrap,
.fee-control-state {
    border-top: 1px solid rgba(226, 232, 240, 0.92);
}

.fee-control-tab-content .tab-pane > .fee-control-section:first-child,
.fee-control-tab-content .tab-pane > .fee-control-state:first-child {
    border-top: 0;
}

.fee-control-section--filters {
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.72) 0%, rgba(255, 255, 255, 1) 100%);
}

.fee-control-section__title {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.75rem;
    color: #475569;
    font-size: 0.82rem;
    font-weight: 700;
}

.fee-control-section__title i {
    color: #2563eb;
}

.fee-control-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: #f8fafc;
}

.fee-control-selection {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.fee-control-selection__label {
    color: #334155;
    font-size: 0.82rem;
    font-weight: 700;
}

.fee-control-toolbar__actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
}

.fee-control-pay-btn,
.fee-control-hospital-btn {
    min-height: 2.35rem;
    border-radius: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    white-space: nowrap;
}

.fee-control-hospital-btn {
    color: #92400e;
    background: #fffbeb;
    border-color: #fcd34d;
}

.fee-control-hospital-btn:hover {
    color: #78350f;
    background: #fef3c7;
    border-color: #fbbf24;
}

.fee-control-legend {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.85rem;
    padding: 0.65rem 1rem;
    background: #fff;
}

.fee-control-table-wrap {
    margin: 0;
}

.fee-control-table {
    --bs-table-cell-padding-y: 0.75rem;
}

.fee-control-table thead th {
    color: #475569;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.fee-control-table tbody td {
    vertical-align: middle;
}

.fee-control-table tbody tr:hover {
    --bs-table-hover-bg: rgba(241, 245, 249, 0.75);
}

.fee-control-state {
    min-height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 2.5rem 1rem;
    text-align: center;
    background: linear-gradient(180deg, rgba(255, 255, 255, 1) 0%, rgba(248, 250, 252, 0.86) 100%);
}

.fee-control-state__icon {
    width: 3rem;
    height: 3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #f8fafc;
    color: #64748b;
    font-size: 1.45rem;
    border: 1px solid rgba(203, 213, 225, 0.8);
}

.fee-control-state__title {
    color: #334155;
    font-size: 1rem;
    font-weight: 800;
}

.fee-control-pagination {
    padding: 1rem;
    border-top: 1px solid rgba(226, 232, 240, 0.92);
}

@media (max-width: 767.98px) {
    .fee-control-tabs .nav-tabs-pill {
        flex-wrap: nowrap;
        width: max-content;
        min-width: 100%;
    }

    .fee-control-tabs .nav-tabs-pill .nav-item {
        flex: 1 0 auto;
    }

    .fee-control-tabs .nav-tabs-pill .nav-link {
        flex-direction: row;
        width: 100%;
        min-height: 2.35rem;
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
        white-space: nowrap;
    }

    .fee-control-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .fee-control-toolbar__actions {
        justify-content: flex-start;
    }

    .fee-control-pay-btn,
    .fee-control-hospital-btn {
        flex: 1 1 11rem;
    }
}

/* ===== Physio Sessions ===== */
.physio-sessions-card > .card-body {
    padding: 1rem;
}

.physio-sessions-tabs {
    margin-bottom: 1rem;
}

.physio-sessions-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(226, 232, 240, 0.92);
    border-radius: 14px;
    background: #f8fafc;
}

.physio-sessions-toolbar__summary,
.physio-sessions-toolbar__actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.physio-sessions-toolbar__actions {
    justify-content: flex-end;
}

.physio-sessions-table-wrap {
    margin: 0 -1rem -1rem;
    border-top: 1px solid rgba(226, 232, 240, 0.92);
}

.physio-sessions-table {
    --bs-table-cell-padding-y: 0.75rem;
}

.physio-sessions-table thead th {
    color: #475569;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    white-space: nowrap;
    background: #f8fafc;
}

.physio-sessions-table tbody td {
    vertical-align: middle;
}

.physio-sessions-table tbody tr:hover {
    --bs-table-hover-bg: rgba(241, 245, 249, 0.75);
}

.physio-sessions-state {
    min-height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    margin: 0 -1rem -1rem;
    padding: 2.5rem 1rem;
    text-align: center;
    border-top: 1px solid rgba(226, 232, 240, 0.92);
    background: linear-gradient(180deg, rgba(255, 255, 255, 1) 0%, rgba(248, 250, 252, 0.86) 100%);
}

.physio-sessions-state__icon {
    width: 3rem;
    height: 3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #f8fafc;
    color: #64748b;
    font-size: 1.45rem;
    border: 1px solid rgba(203, 213, 225, 0.8);
}

.physio-sessions-state__title {
    color: #334155;
    font-size: 1rem;
    font-weight: 800;
}

@media (max-width: 767.98px) {
    .physio-sessions-tabs .nav-tabs-pill {
        flex-wrap: nowrap;
        width: max-content;
        min-width: 100%;
    }

    .physio-sessions-tabs .nav-tabs-pill .nav-item {
        flex: 1 0 auto;
    }

    .physio-sessions-tabs .nav-tabs-pill .nav-link {
        flex-direction: row;
        width: 100%;
        min-height: 2.35rem;
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
        white-space: nowrap;
    }

    .physio-sessions-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .physio-sessions-toolbar__actions {
        justify-content: flex-start;
    }

    .physio-sessions-toolbar__actions .btn {
        flex: 1 1 9rem;
    }
}

/* ===== Fees ===== */
.fees-stat-card {
    min-height: 5.25rem;
}

.fees-stat-card > .card-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0.9rem 0.75rem;
}

.fees-card > .card-body {
    padding: 1rem;
}

.fees-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(226, 232, 240, 0.92);
    border-radius: 14px;
    background: #f8fafc;
}

.fees-toolbar__summary,
.fees-toolbar__actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.fees-toolbar__actions {
    justify-content: flex-end;
}

.fees-table-wrap {
    margin: 0 -1rem -1rem;
    border-top: 1px solid rgba(226, 232, 240, 0.92);
}

.fees-table {
    --bs-table-cell-padding-y: 0.75rem;
}

.fees-table thead th,
.fees-table tfoot td {
    color: #475569;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    white-space: nowrap;
    background: #f8fafc;
}

.fees-table tbody tr:hover {
    --bs-table-hover-bg: rgba(241, 245, 249, 0.75);
}

.fees-state {
    min-height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    margin: 0 -1rem -1rem;
    padding: 2.5rem 1rem;
    text-align: center;
    border-top: 1px solid rgba(226, 232, 240, 0.92);
    background: linear-gradient(180deg, rgba(255, 255, 255, 1) 0%, rgba(248, 250, 252, 0.86) 100%);
}

.fees-state__icon {
    width: 3rem;
    height: 3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #f8fafc;
    color: #64748b;
    font-size: 1.45rem;
    border: 1px solid rgba(203, 213, 225, 0.8);
}

.fees-state__title {
    color: #334155;
    font-size: 1rem;
    font-weight: 800;
}

.fees-pagination {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(226, 232, 240, 0.92);
}

@media (max-width: 767.98px) {
    .fees-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .fees-toolbar__actions {
        justify-content: flex-start;
    }

    .fees-toolbar__actions .btn {
        flex: 1 1 7rem;
    }

    .fees-toolbar__actions .app-action-btn {
        flex: 0 0 2.35rem;
    }
}
