:root {
  --color-primary: #2a9a9c;
  --color-primary-dark: #1f787a;
  --color-primary-active: #186163;
  --color-primary-soft: #e4f5f5;
  --color-secondary: #e0a07e;
  --color-secondary-soft: #f8ede4;
  --color-accent: #f2c14e;
  --color-accent-soft: #faf0d2;
  --color-bg: #f7f8fa;
  --color-surface: #ffffff;
  --color-surface-soft: #f2fafa;
  --color-text: #1f2933;
  --color-muted: #6b7280;
  --color-border: #dfe6e8;
  --color-success: #1f9d55;
  --color-success-soft: #ecfdf3;
  --color-warning: #d97706;
  --color-warning-soft: #fffbeb;
  --color-danger: #dc2626;
  --color-danger-soft: #fef2f2;
  --action-view: #64748b;
  --action-view-dark: #475569;
  --action-view-active: #334155;
  --action-danger-dark: #b91c1c;
  --action-danger-active: #991b1b;
  --action-success-dark: #17803d;
  --action-success-active: #166534;
  --action-warning-dark: #b45309;
  --action-warning-active: #92400e;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
}

.btn-primary {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--color-primary);
  --bs-btn-border-color: var(--color-primary);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--color-primary-dark);
  --bs-btn-hover-border-color: var(--color-primary-dark);
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: var(--color-primary-active);
  --bs-btn-active-border-color: var(--color-primary-active);
  --bs-btn-disabled-bg: var(--color-primary);
  --bs-btn-disabled-border-color: var(--color-primary);
}

.btn-danger {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--color-danger);
  --bs-btn-border-color: var(--color-danger);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--action-danger-dark);
  --bs-btn-hover-border-color: var(--action-danger-dark);
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: var(--action-danger-active);
  --bs-btn-active-border-color: var(--action-danger-active);
  --bs-btn-disabled-bg: var(--color-danger);
  --bs-btn-disabled-border-color: var(--color-danger);
}

.btn-success {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--color-success);
  --bs-btn-border-color: var(--color-success);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--action-success-dark);
  --bs-btn-hover-border-color: var(--action-success-dark);
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: var(--action-success-active);
  --bs-btn-active-border-color: var(--action-success-active);
  --bs-btn-disabled-bg: var(--color-success);
  --bs-btn-disabled-border-color: var(--color-success);
}

.btn-warning {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--color-warning);
  --bs-btn-border-color: var(--color-warning);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--action-warning-dark);
  --bs-btn-hover-border-color: var(--action-warning-dark);
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: var(--action-warning-active);
  --bs-btn-active-border-color: var(--action-warning-active);
  --bs-btn-disabled-bg: var(--color-warning);
  --bs-btn-disabled-border-color: var(--color-warning);
}

.btn-outline-primary {
  --bs-btn-color: var(--color-primary-dark);
  --bs-btn-border-color: var(--color-primary);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--color-primary);
  --bs-btn-hover-border-color: var(--color-primary);
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: var(--color-primary-active);
  --bs-btn-active-border-color: var(--color-primary-active);
}

.btn-outline-danger {
  --bs-btn-color: var(--action-danger-dark);
  --bs-btn-border-color: var(--color-danger);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--color-danger);
  --bs-btn-hover-border-color: var(--color-danger);
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: var(--action-danger-active);
  --bs-btn-active-border-color: var(--action-danger-active);
}

.btn-outline-warning {
  --bs-btn-color: var(--action-warning-dark);
  --bs-btn-border-color: var(--color-warning);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--color-warning);
  --bs-btn-hover-border-color: var(--color-warning);
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: var(--action-warning-active);
  --bs-btn-active-border-color: var(--action-warning-active);
}

.app-shell {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
}

@media (min-width: 992px) {
  html,
  body {
    height: 100%;
    overflow: hidden;
  }

  .app-shell {
    height: 100vh;
    overflow: hidden;
  }

  .sidebar-desktop {
    height: 100vh;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .main {
    height: 100vh;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

.sidebar {
  padding: 22px 18px;
  border-right: 1px solid var(--color-border);
  background: var(--color-surface-soft);
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 24px;
}
.brand-lockup-wrap { display: inline-block; }
.brand-stack { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.brand-stack.justify-content-center { align-items: center; }
.brand-lockup { display: flex; align-items: center; gap: 0; line-height: 1; }
.brand-wordmark-tail {
  font-size: 22px; font-weight: 780; color: #16212c;
  letter-spacing: -0.03em; margin-left: -1px;
}
.brand-lockup-lg .brand-wordmark-tail { font-size: 36px; }
.brand-lockup-lg .polymorph-mark { height: 46px; width: auto; }
.brand .polymorph-mark { height: 32px; width: auto; }
.offcanvas-brand .polymorph-mark { height: 28px; width: auto; }
.brand-tagline { margin: 0; font-size: 13px; color: var(--color-muted); line-height: 1.35; }
.brand-sub { font-size: 12px; color: var(--color-muted); }
.polymorph-mark { display: block; flex-shrink: 0; }

.sidebar-nav { display: flex; flex-direction: column; gap: 6px; }
.sidebar-link {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 8px; color: var(--color-text); text-decoration: none; font-size: 14px;
}
.sidebar-link.active, .sidebar-link:hover {
  background: var(--color-primary-soft);
  color: var(--color-primary-dark);
  font-weight: 600;
}

.main { min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: flex-end; gap: 16px;
  padding: 16px 22px; border-bottom: 1px solid var(--color-border); background: var(--color-surface);
}
.topbar-menu-btn { flex-shrink: 0; margin-right: auto; }
.user-box {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-shrink: 0;
}
.user-box-text {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  line-height: 1.25;
  min-width: 0;
}
.user-name { font-size: 14px; font-weight: 600; line-height: 1.2; }
.user-role { font-size: 12px; color: var(--color-muted); line-height: 1.2; }
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--color-primary-soft);
  color: var(--color-accent);
}

.avatar--md {
  width: 34px;
  height: 34px;
}

.avatar--sm {
  width: 28px;
  height: 28px;
}

.avatar svg {
  display: block;
  width: 62%;
  height: 62%;
}

.avatar .avatar-detail {
  fill: var(--color-primary-dark);
}

.user-list-name {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  min-width: 0;
}

.list-card__title-row {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  min-width: 0;
}

.avatar-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(4.5rem, 1fr));
  gap: 0.625rem;
}

.avatar-picker__option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.35rem;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.avatar-picker__option:hover {
  border-color: var(--color-primary);
}

.avatar-picker__option.is-selected {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary-soft);
}

.avatar-picker__label {
  font-size: 0.6875rem;
  color: var(--color-muted);
  text-align: center;
  line-height: 1.2;
}

.avatar-picker__input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.sidebar-logout-form {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--color-border);
}
.sidebar-link-logout {
  width: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
}
.content { padding: 24px; }

.card-soft {
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.kpi-card {
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
  padding: 16px;
}

.kpi-label { font-size: 13px; color: var(--color-muted); margin-bottom: 6px; overflow-wrap: break-word; }
.kpi-value { font-size: 24px; font-weight: 700; }
.kpi-delta { font-size: 12px; margin-top: 6px; }
.kpi-delta.good { color: var(--color-success); }
.kpi-delta.bad { color: var(--color-danger); }
.kpi-delta--snapshot { color: var(--color-muted); font-style: italic; }

.dashboard-period-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  flex-shrink: 0;
}

.dashboard-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
}

.dashboard-filter-custom {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
  flex: 1 1 auto;
  min-width: min(100%, 20rem);
}

.dashboard-filter-date {
  flex: 0 1 9.5rem;
  min-width: 8.5rem;
}

.dashboard-filter-date .form-label {
  margin-bottom: 0.35rem;
  font-size: 0.8125rem;
}

.dashboard-filter-apply {
  white-space: nowrap;
  flex-shrink: 0;
}

.dashboard-period-pill {
  border: 1px solid var(--color-border);
  background: var(--color-surface, #fff);
  color: var(--color-text);
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.dashboard-period-pill:hover {
  border-color: var(--color-primary);
  color: var(--color-primary-dark);
}

.dashboard-period-pill.is-active {
  background: var(--color-primary-soft);
  border-color: var(--color-primary);
  color: var(--color-primary-dark);
  font-weight: 600;
}

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

.dashboard-page-head__body {
  flex: 1 1 auto;
  min-width: 0;
}

.dashboard-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

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

  .dashboard-filter-custom {
    width: 100%;
  }

  .dashboard-filter-apply {
    width: 100%;
  }

  .content:has(> .dashboard-page-head) {
    padding-top: 12px;
  }

  .dashboard-page-head {
    display: block;
    position: relative;
    min-height: 2.25rem;
    margin-bottom: 1rem;
  }

  .dashboard-page-head .dashboard-toolbar {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
  }

  .dashboard-page-head__body {
    padding-top: 2.35rem;
    padding-right: 0;
  }
}

.dashboard-section__title {
  font-weight: 600;
  color: var(--color-text);
}

.dashboard-cards-row,
.dashboard-charts-row {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
  align-items: stretch;
}

.dashboard-cards-row .dashboard-widget {
  min-height: 120px;
}

.dashboard-charts-row .dashboard-widget {
  min-height: 260px;
}

.dashboard-widget {
  position: relative;
  padding: 16px;
  min-width: 0;
  overflow: hidden;
  container-type: inline-size;
  display: flex;
  flex-direction: column;
}

.dashboard-widget-content {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.dashboard-widget-body--card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 88px;
}

.dashboard-widget-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 8px;
}

.dashboard-widget-head > div:first-child {
  min-width: 0;
  flex: 1 1 8rem;
}

.dashboard-widget .kpi-delta {
  flex: 0 1 auto;
  max-width: 100%;
  overflow-wrap: anywhere;
  text-align: right;
}

@container (max-width: 280px) {
  .dashboard-widget-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .dashboard-widget .kpi-delta {
    text-align: left;
  }
}

.dashboard-widget-head--chart {
  margin-bottom: 12px;
}

.kpi-value--compact {
  font-size: 20px;
}

.dashboard-chart-wrap {
  height: 180px;
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  flex: 1;
  min-height: 0;
}

.dashboard-chart-wrap canvas {
  display: block;
  width: 100% !important;
  max-width: 100%;
}

@media (max-width: 991px) {
  .dashboard-cards-row,
  .dashboard-charts-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .dashboard-cards-row .dashboard-widget {
    grid-column: span 1 !important;
    min-height: 0;
    padding: 12px;
  }

  .dashboard-charts-row .dashboard-widget {
    grid-column: 1 / -1 !important;
    padding: 12px;
  }

  .dashboard-widget-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    margin-bottom: 6px;
  }

  .dashboard-widget .kpi-label {
    font-size: 12px;
    line-height: 1.25;
  }

  .dashboard-widget .kpi-delta {
    font-size: 11px;
    margin-top: 0;
  }
}

.offcanvas-brand { padding-right: 2rem; }
.offcanvas-brand .brand-sub { margin-top: 4px; }

@media (max-width: 991.98px) {
  .mobile-nav-offcanvas {
    --bs-offcanvas-width: max-content;
    width: max-content;
    max-width: min(92vw, 20.5rem);
  }

  .mobile-nav-offcanvas .offcanvas-header {
    position: relative;
    padding: 1.125rem 0.875rem 0.5rem;
  }

  .mobile-nav-offcanvas .offcanvas-header .btn-close {
    position: absolute;
    top: 1.125rem;
    right: 0.75rem;
    margin: 0;
  }

  .mobile-nav-offcanvas .offcanvas-body {
    padding: 0.5rem 0.75rem 1rem;
  }

  .mobile-nav-offcanvas .offcanvas-brand {
    padding-right: 1.75rem;
  }

  .mobile-nav-offcanvas .sidebar-nav {
    width: max-content;
    min-width: 100%;
  }

  .mobile-nav-offcanvas .sidebar-link {
    white-space: nowrap;
  }

  /* Mesmo desfoque dos overlays do app (lightbox, app-overlay) */
  .offcanvas-backdrop.show {
    background-color: rgba(15, 23, 42, 0.42);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
    opacity: 1;
  }
}

.auth-body {
  min-height: 100vh; display: grid; place-items: center; background: var(--color-bg);
}
.auth-card { width: min(420px, 92vw); border: 1px solid var(--color-border); border-radius: 12px; }

.password-field {
  position: relative;
}

.password-field .form-control {
  padding-right: 2.75rem;
}

.password-field__toggle {
  position: absolute;
  top: 50%;
  right: 0.5rem;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--color-muted, #6b7280);
  padding: 0.25rem 0.35rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 6px;
}

.password-field__toggle:hover,
.password-field__toggle:focus-visible {
  color: var(--color-primary-dark);
  outline: none;
}

.password-field__toggle .bi {
  font-size: 1.05rem;
  pointer-events: none;
}

.auth-card .auth-footer {
  margin-top: 1.25rem;
  padding-top: 1rem;
  text-align: center;
}

.auth-card a.auth-link,
.auth-card a.auth-link:link,
.auth-card a.auth-link:visited {
  display: block;
  color: var(--color-primary-dark);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.75;
  transition: color 0.15s ease;
}

.auth-card a.auth-link:hover,
.auth-card a.auth-link:focus-visible {
  color: var(--color-primary);
  text-decoration: underline;
}

.auth-card .auth-footer p {
  margin: 0;
  line-height: 1.75;
}

.auth-card .auth-link-muted {
  color: var(--color-muted);
}

.auth-card .auth-link-muted:hover {
  color: var(--color-primary-dark);
}

/* FullCalendar — paleta neutra alinhada ao layout */
.calendar-filter-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.calendar-filter-bar__label {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
}

.calendar-filter-bar__select {
  max-width: 20rem;
  min-width: 12rem;
}

.calendar-wrap #calendar {
  min-height: 620px;
}

.calendar-wrap .fc .fc-view-harness-active {
  min-height: 520px;
}

.calendar-wrap {
  --fc-border-color: var(--color-border);
  --fc-page-bg-color: var(--color-surface);
  --fc-neutral-bg-color: var(--color-bg);
  --fc-neutral-text-color: var(--color-muted);
  --fc-button-bg-color: var(--color-surface);
  --fc-button-border-color: var(--color-border);
  --fc-button-text-color: var(--color-text);
  --fc-button-hover-bg-color: var(--color-primary-soft);
  --fc-button-hover-border-color: var(--color-primary);
  --fc-button-hover-text-color: var(--color-primary-dark);
  --fc-button-active-bg-color: var(--color-primary);
  --fc-button-active-border-color: var(--color-primary-dark);
  --fc-button-active-text-color: #ffffff;
  --fc-today-bg-color: var(--color-accent-soft);
  --fc-now-indicator-color: var(--color-primary);
}

.calendar-wrap .fc .fc-toolbar-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-text);
}

.calendar-wrap .fc .fc-button {
  font-size: 13px;
  font-weight: 500;
  padding: 0.35em 0.75em;
  box-shadow: none;
  text-transform: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.calendar-wrap .fc .fc-button-primary:not(:disabled):hover {
  background-color: var(--color-primary-soft);
  border-color: var(--color-primary);
  color: var(--color-primary-dark);
}

.calendar-wrap .fc .fc-button-primary:not(:disabled).fc-button-active,
.calendar-wrap .fc .fc-button-primary:not(:disabled):active {
  background-color: var(--color-primary);
  border-color: var(--color-primary-dark);
  color: #ffffff;
}

.calendar-wrap .fc .fc-button-primary:not(:disabled):focus-visible {
  background-color: var(--color-primary-soft);
  border-color: var(--color-primary);
  color: var(--color-primary-dark);
  outline: 2px solid var(--color-primary-soft);
  outline-offset: 1px;
}

.calendar-wrap .fc .fc-button-primary:not(:disabled).fc-button-active:focus-visible {
  background-color: var(--color-primary);
  border-color: var(--color-primary-dark);
  color: #ffffff;
  outline-color: var(--color-primary);
}

.calendar-wrap .fc .fc-col-header-cell-cushion,
.calendar-wrap .fc .fc-daygrid-day-number,
.calendar-wrap .fc a[data-navlink] {
  color: var(--color-muted);
  text-decoration: none;
}

.calendar-wrap .fc .fc-daygrid-day-number:hover,
.calendar-wrap .fc .fc-col-header-cell-cushion:hover {
  color: var(--color-text);
}

.calendar-wrap .fc .fc-daygrid-day.fc-day-today {
  background-color: var(--color-accent-soft);
}

.calendar-wrap .fc .fc-daygrid-day.fc-day-today .fc-daygrid-day-number {
  color: var(--color-primary-dark);
  font-weight: 600;
}

.calendar-wrap .fc .fc-timegrid-slot-label-cushion,
.calendar-wrap .fc .fc-timegrid-axis-cushion {
  color: var(--color-muted);
  font-size: 12px;
}

.calendar-wrap .fc .fc-event {
  border-radius: 4px;
  font-size: 12px;
  cursor: help;
}

.calendar-wrap .fc .fc-timegrid-event .fc-event-main {
  padding: 2px 4px;
}

.calendar-wrap .fc .fc-timegrid-event .fc-event-title--rich {
  white-space: normal;
  line-height: 1.35;
  font-size: 0.75rem;
  font-weight: 500;
  overflow: hidden;
}

.calendar-event-tooltip {
  position: fixed;
  z-index: 1080;
  max-width: 320px;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: 0 8px 24px rgba(31, 41, 51, 0.12);
  font-size: 13px;
  line-height: 1.45;
  pointer-events: none;
}

.calendar-event-tooltip-title {
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--color-text);
}

.calendar-event-tooltip span {
  color: var(--color-muted);
}

.procedure-color-swatch {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid var(--color-border);
  vertical-align: middle;
}

.appointment-situation-cell {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
}

.appointment-status-select {
  max-width: 100%;
}

.appointment-status-select__trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid transparent;
  max-width: 100%;
  white-space: nowrap;
}

.appointment-status-select__trigger span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.appointment-status-select__trigger.is-readonly {
  cursor: default;
}

.appointment-status-select__trigger.is-locked {
  cursor: help;
}

.appointment-status-select__lock {
  font-size: 0.75rem;
  opacity: 0.85;
}

.appointment-status-select__trigger--scheduled {
  background: #6b7280;
  border-color: #6b7280;
  color: #fff;
}

.appointment-status-select__trigger--confirmed {
  background: var(--color-success);
  border-color: var(--color-success);
  color: #fff;
}

.appointment-status-select__trigger--in-progress {
  background: #f59e0b;
  border-color: #d97706;
  color: #1f2933;
}

.appointment-status-select__trigger--completed {
  background: #2563eb;
  border-color: #1d4ed8;
  color: #fff;
}

.appointment-status-select__trigger--cancelled {
  background: #374151;
  border-color: #1f2937;
  color: #fff;
}

.appointment-status-select__trigger--no-show {
  background: var(--color-danger);
  border-color: var(--color-danger);
  color: #fff;
}

button.appointment-status-select__trigger.dropdown-toggle::after {
  margin-left: 0.15rem;
}

.appointment-status-menu-form {
  margin: 0;
}

.appointment-status-menu-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
}

.appointment-status-menu-item.is-current {
  font-weight: 600;
  cursor: default;
}

.appointment-status-menu-item.is-disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.appointment-status-menu-item .bi {
  width: 1.1rem;
  flex-shrink: 0;
}

.appointment-meta-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.appointment-status-btn,
.appointment-meta-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid transparent;
  background: var(--color-surface);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, opacity 0.15s ease, transform 0.1s ease;
}

.appointment-meta-btn.is-loading,
.btn.is-loading {
  pointer-events: none;
  opacity: 0.85;
}

.appointment-meta-btn.is-loading .spinner-border,
.btn.is-loading .spinner-border {
  width: 0.85rem;
  height: 0.85rem;
}

tr.list-row--deleting {
  opacity: 0.55;
}

.appointment-status-btn--scheduled { color: #6b7280; border-color: #d1d5db; }
.appointment-status-btn--scheduled:hover:not(.is-active):not(.is-disabled) { background: #f3f4f6; border-color: #6b7280; }
.appointment-status-btn--scheduled.is-active { background: #6b7280; border-color: #6b7280; color: #fff; }

.appointment-status-btn--confirmed { color: var(--color-success); border-color: #86efac; }
.appointment-status-btn--confirmed:hover:not(.is-active):not(.is-disabled) { background: #ecfdf3; border-color: var(--color-success); }
.appointment-status-btn--confirmed.is-active { background: var(--color-success); border-color: var(--color-success); color: #fff; }

.appointment-status-btn--in-progress { color: #d97706; border-color: #fcd34d; }
.appointment-status-btn--in-progress:hover:not(.is-active):not(.is-disabled) { background: #fffbeb; border-color: #f59e0b; }
.appointment-status-btn--in-progress.is-active { background: #f59e0b; border-color: #d97706; color: #1f2933; }

.calendar-wrap .fc .fc-event.fc-event-status--in-progress {
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.35);
  animation: calendar-pulse 2s ease-in-out infinite;
}

@keyframes calendar-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.82; }
}

.calendar-wrap .fc .fc-event .fc-event-status-icon {
  font-size: 0.85em;
  margin-right: 3px;
  opacity: 0.95;
  vertical-align: -1px;
}

.calendar-wrap .fc .fc-event.fc-event-status--cancelled .fc-event-title {
  text-decoration: line-through;
  opacity: 0.85;
}

.calendar-wrap .fc .fc-event.fc-event-status--no-show {
  position: relative;
  overflow: hidden;
}

.calendar-wrap .fc .fc-event.fc-event-status--no-show::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 4px,
    rgba(0, 0, 0, 0.18) 4px,
    rgba(0, 0, 0, 0.18) 5px
  );
}

.calendar-wrap .fc .fc-event.fc-event-block {
  font-size: 0.72rem;
  line-height: 1.25;
  white-space: normal;
  padding: 1px 4px;
  margin-bottom: 1px;
}

.calendar-wrap .fc .fc-daygrid-block-event.fc-event-block,
.calendar-wrap .fc .fc-daygrid-block-event.fc-event-block .fc-event-main {
  color: var(--fc-event-text-color);
}

.calendar-wrap .fc .fc-daygrid-block-event.fc-event-block .fc-event-title {
  color: inherit;
  font-weight: 500;
}

.calendar-wrap .fc .fc-daygrid-dot-event.fc-event-block {
  display: block;
  background-color: var(--fc-event-bg-color);
  border: 1px solid var(--fc-event-border-color);
  color: var(--fc-event-text-color);
  padding: 1px 4px;
  margin-bottom: 1px;
}

.calendar-wrap .fc .fc-daygrid-dot-event.fc-event-block .fc-daygrid-event-dot,
.calendar-wrap .fc .fc-daygrid-dot-event.fc-event-block .fc-event-time {
  display: none;
}

.calendar-wrap .fc .fc-daygrid-dot-event.fc-event-block .fc-event-title {
  color: inherit;
  font-weight: 500;
}

.calendar-wrap .fc .fc-daygrid-day-events {
  max-height: 7.5rem;
  overflow-y: auto;
  overflow-x: hidden;
}

.appointment-status-btn--completed { color: #2563eb; border-color: #bfdbfe; }
.appointment-status-btn--completed:hover:not(.is-active):not(.is-disabled) { background: #eff6ff; border-color: #2563eb; }
.appointment-status-btn--completed.is-active { background: #2563eb; border-color: #1d4ed8; color: #fff; }

.bg-status-completed {
  background-color: #2563eb;
  color: #fff;
}

.status-live-badge {
  animation: status-live-pulse 2s ease-in-out infinite;
}

@keyframes status-live-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.35); }
  50% { box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.15); }
}

.in-progress-spotlight {
  border-left: 4px solid #f59e0b;
  background: linear-gradient(135deg, #fffbeb 0%, #fff 55%);
}

.in-progress-spotlight__metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.in-progress-metric {
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  background: #fff;
  border: 1px solid #fde68a;
}

.in-progress-metric__value {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.3;
  color: #92400e;
}

.in-progress-metric__caption {
  margin-top: 0.25rem;
  font-size: 0.8125rem;
  color: #78716c;
}

.in-progress-metric--ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.in-progress-metric--ok .in-progress-metric__value {
  color: #166534;
}

.in-progress-metric--overrun {
  border-color: #fecaca;
  background: #fef2f2;
}

.in-progress-metric--overrun .in-progress-metric__value {
  color: #b91c1c;
}

@media (max-width: 575.98px) {
  .in-progress-spotlight__metrics {
    grid-template-columns: 1fr;
  }
}

.app-toast-stack {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 1080;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: min(100%, 22rem);
  pointer-events: none;
}

.app-toast {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: 0.875rem;
  border: 1px solid transparent;
  background: var(--color-surface, #fff);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
  opacity: 0;
  transform: translateX(1.25rem);
  transition: opacity 0.28s ease, transform 0.28s ease;
  pointer-events: auto;
}

.app-toast.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.app-toast.is-leaving {
  opacity: 0;
  transform: translateX(1.25rem);
}

.app-toast.is-updated {
  animation: app-toast-pulse 0.22s ease;
}

@keyframes app-toast-pulse {
  0%, 100% { transform: translateX(0) scale(1); }
  50% { transform: translateX(0) scale(1.02); }
}

.app-toast__icon {
  flex-shrink: 0;
  font-size: 1.125rem;
  margin-top: 0.125rem;
}

.app-toast__message {
  flex: 1;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--color-text, #1f2933);
}

.app-toast__close {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  opacity: 0.65;
  cursor: pointer;
}

.app-toast__close:hover {
  opacity: 1;
  background: rgba(15, 23, 42, 0.06);
}

.app-toast--success {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.app-toast--info {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.app-toast--error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

@media (max-width: 575.98px) {
  .app-toast-stack {
    right: 0.75rem;
    left: 0.75rem;
    width: auto;
  }
}

.appointment-status-btn--cancelled { color: #374151; border-color: #d1d5db; }
.appointment-status-btn--cancelled:hover:not(.is-active):not(.is-disabled) { background: #f3f4f6; border-color: #374151; }
.appointment-status-btn--cancelled.is-active { background: #374151; border-color: #1f2937; color: #fff; }

.appointment-status-btn--no-show { color: var(--color-danger); border-color: #fecaca; }
.appointment-status-btn--no-show:hover:not(.is-active):not(.is-disabled) { background: #fef2f2; border-color: var(--color-danger); }
.appointment-status-btn--no-show.is-active { background: var(--color-danger); border-color: var(--color-danger); color: #fff; }

.appointment-status-btn.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.user-list-email {
  min-width: 10rem;
  word-break: break-word;
}

.appointment-meta-btn--view {
  background: var(--action-view);
  border-color: var(--action-view);
  color: #fff;
}

.appointment-meta-btn--view:hover {
  background: var(--action-view-dark);
  border-color: var(--action-view-dark);
  color: #fff;
}

.appointment-meta-btn--view:active {
  background: var(--action-view-active);
  border-color: var(--action-view-active);
  color: #fff;
}

.appointment-meta-btn--primary {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.appointment-meta-btn--primary:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  color: #fff;
}

.appointment-meta-btn--primary:active {
  background: var(--color-primary-active);
  border-color: var(--color-primary-active);
  color: #fff;
}

.appointment-meta-btn--neutral {
  color: var(--color-muted);
  border-color: var(--color-border);
  background: var(--color-surface);
}

.appointment-meta-btn--neutral:hover {
  background: var(--color-bg);
  border-color: var(--color-muted);
  color: var(--color-text);
}

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

.appointment-meta-btn--danger:hover {
  background: var(--action-danger-dark);
  border-color: var(--action-danger-dark);
  color: #fff;
}

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

.appointment-meta-btn--success {
  background: var(--color-success);
  border-color: var(--color-success);
  color: #fff;
}

.appointment-meta-btn--success:hover {
  background: var(--action-success-dark);
  border-color: var(--action-success-dark);
  color: #fff;
}

.appointment-meta-btn--success:active {
  background: var(--action-success-active);
  border-color: var(--action-success-active);
  color: #fff;
}

.appointment-meta-btn--view:focus-visible,
.appointment-meta-btn--primary:focus-visible,
.appointment-meta-btn--danger:focus-visible,
.appointment-meta-btn--success:focus-visible,
.appointment-meta-btn--neutral:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.appointment-meta-btn.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.searchable-table-wrap .table-search-bar {
  padding: 16px 16px 0;
}

.searchable-table-wrap [data-search-empty] {
  padding: 16px;
}

.table-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--bs-border-color-translucent, rgba(0, 0, 0, 0.08));
}

.table-pagination__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.table-pagination__per-page {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.table-pagination__per-page-label {
  color: var(--bs-secondary-color);
  font-size: 0.875rem;
  white-space: nowrap;
}

.table-pagination__per-page .form-select {
  width: auto;
  min-width: 4.5rem;
}

/* Mobile list cards (tables become cards below md) */
.list-cards {
  display: none;
}

.list-card {
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.list-card--muted {
  opacity: 0.72;
}

.list-card__title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--color-text);
}

.list-card__fields {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.list-card__field {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
}

.list-card__label {
  margin: 0;
  flex: 0 0 auto;
  max-width: 42%;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-muted);
  line-height: 1.4;
}

.list-card__value {
  margin: 0;
  flex: 1 1 auto;
  text-align: right;
  font-size: 14px;
  line-height: 1.4;
  word-break: break-word;
}

.list-card__actions {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
}

.list-card__actions .appointment-meta-actions {
  width: 100%;
}

.list-card.list-row--deleting {
  opacity: 0.45;
  pointer-events: none;
}

.list-cards__empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--color-muted);
}

.skeleton-list-card {
  gap: 10px;
}

.skeleton-list-card .skeleton-block--title {
  height: 18px;
  width: 65%;
}

.skeleton-list-card .skeleton-block--line {
  height: 14px;
  width: 100%;
}

.skeleton-list-card .skeleton-block--line-short {
  width: 80%;
}

.skeleton-list-card .skeleton-block--actions {
  height: 34px;
  width: 120px;
  margin-left: auto;
  margin-top: 4px;
}

.page-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 767.98px) {
  .list-table-wrap {
    display: none !important;
  }

  .list-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
  }

  .searchable-table-wrap .table-search-bar {
    padding-bottom: 0;
  }

  .table-search-input {
    width: 100%;
  }

  .table-pagination {
    flex-direction: column;
    align-items: stretch;
  }

  .table-pagination__controls {
    justify-content: center;
  }

  .page-header-actions .btn {
    width: 100%;
  }

  .calendar-wrap #calendar {
    min-height: auto;
  }

  .calendar-wrap .fc .fc-view-harness-active {
    min-height: auto;
  }

  .calendar-wrap .fc .fc-toolbar-title {
    font-size: 1rem;
  }

  .calendar-wrap .fc .fc-button {
    padding: 0.3rem 0.55rem;
    font-size: 0.8rem;
  }

  .calendar-wrap .fc .fc-list-event {
    cursor: pointer;
  }

  .calendar-wrap .fc .fc-list-event .fc-list-event-title,
  .calendar-wrap .fc .fc-list-event .fc-list-event-time {
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .calendar-event-offcanvas .calendar-event-tooltip-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 12px;
  }

  .calendar-event-offcanvas .offcanvas-body > div {
    margin-bottom: 8px;
    font-size: 14px;
  }

  .calendar-event-offcanvas .offcanvas-body > div span {
    color: var(--color-muted);
    font-weight: 600;
  }
}

@media (min-width: 768px) {
  .page-header-actions .btn {
    width: auto;
  }
}

.skeleton-pending--cards [data-list-cards] > :not(.skeleton-zone__placeholder),
[data-list-cards].skeleton-zone--loading > :not(.skeleton-zone__placeholder) {
  display: none !important;
}

.skeleton-pending--cards [data-list-cards] > .skeleton-zone__placeholder,
[data-list-cards].skeleton-zone--loading > .skeleton-zone__placeholder {
  display: flex !important;
}

[data-list-cards].skeleton-zone--loading,
.skeleton-pending--cards [data-list-cards] {
  min-height: 320px;
}

.image-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}

.image-gallery-item {
  position: relative;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--color-bg);
}

.image-gallery-item--deleting {
  opacity: 0.55;
  pointer-events: none;
}

.image-gallery-item img {
  display: block;
  width: 100%;
  height: 120px;
  object-fit: cover;
  pointer-events: none;
}

.image-gallery-open {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: zoom-in;
  line-height: 0;
}

.image-gallery-open:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.image-gallery-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 1;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
}

.image-gallery-delete {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 2px 6px;
  line-height: 1;
}

.clinical-photo-upload {
  display: flex;
  flex-direction: column;
}

.clinical-upload-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.clinical-upload-stack .image-gallery-grid {
  margin-bottom: 0;
}

.clinical-upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 140px;
  padding: 1.25rem;
  border: 2px dashed var(--color-border, #cbd5e1);
  border-radius: 12px;
  background: var(--color-surface-soft, #f8fafc);
  color: var(--color-muted, #64748b);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
  text-align: center;
}

.clinical-upload-zone:hover,
.clinical-upload-zone:focus-visible,
.clinical-upload-zone.is-dragover {
  border-color: var(--color-primary, #6366f1);
  background: var(--color-primary-soft, #eef2ff);
  color: var(--color-text, #0f172a);
  outline: none;
}

.clinical-upload-zone-icon {
  font-size: 1.75rem;
  color: var(--color-primary, #6366f1);
}

.clinical-upload-zone-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text, #0f172a);
}

.clinical-upload-zone-hint {
  font-size: 0.8rem;
}

.clinical-upload-queue {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}

.clinical-upload-item {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 0.65rem;
  padding: 0.65rem;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 10px;
  background: var(--color-surface, #fff);
}

.clinical-upload-preview {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  background: #e2e8f0;
}

.clinical-upload-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.clinical-upload-item-body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}

.clinical-upload-item-name {
  font-size: 0.75rem;
  color: var(--color-muted, #64748b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.clinical-upload-remove {
  align-self: flex-start;
}

.treatment-summary .form-text {
  margin-top: 0.125rem;
}

.treatment-attention-points {
  margin-top: 0.25rem;
}

.treatment-attention-block {
  height: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(234, 179, 8, 0.35);
  border-radius: 0.75rem;
  background: rgba(254, 249, 195, 0.45);
}

.treatment-attention-block__title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #854d0e;
}

.treatment-attention-block__body {
  font-size: 0.875rem;
  line-height: 1.45;
  color: #422006;
  max-height: 10rem;
  overflow-y: auto;
}

.treatment-consumption-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.treatment-consumption-group__title {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--color-text-muted, #6c757d);
  margin: 0 0 0.55rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.treatment-consumption-group:not(.treatment-consumption-group--flat) {
  padding: 0.65rem 0.75rem 0.25rem;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 0.65rem;
  background: rgba(255, 255, 255, 0.45);
}

.inventory-lines-panel {
  margin-top: 0.5rem;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 0.85rem;
  background: rgba(248, 250, 252, 0.75);
}

.inventory-lines-panel__header {
  margin-bottom: 0.85rem;
}

.inventory-lines-panel__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem 1rem;
  margin-top: 0.85rem;
}

.inventory-lines-table__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  flex-wrap: nowrap;
}

.inventory-lines-panel__totals {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  font-size: 0.9375rem;
}

.inventory-lines-panel__totals--billing {
  min-width: min(100%, 18rem);
  padding: 0.75rem 0.9rem;
  border-radius: 0.65rem;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.inventory-lines-panel__total-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
}

.inventory-lines-panel__total-line--grand {
  margin-top: 0.15rem;
  padding-top: 0.45rem;
  border-top: 1px dashed rgba(15, 23, 42, 0.12);
  font-size: 1rem;
}

.inventory-lines-panel__total-line--grand strong {
  font-size: 1.05rem;
}

.inventory-lines-table__quantity .form-control {
  min-width: 4.5rem;
}

.inventory-lines-table__subtotal {
  font-weight: 600;
}

.inventory-lines-table__head {
  margin-bottom: 0.35rem;
  padding: 0 0.15rem;
}

.inventory-lines-table__label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: rgba(15, 23, 42, 0.55);
}

.inventory-lines-table__money {
  background: #fff;
  font-variant-numeric: tabular-nums;
}

.treatment-consumption-row .input-group-text,
.procedure-product-row .input-group-text {
  min-width: 4.5rem;
  justify-content: center;
  font-size: 0.8125rem;
}

.finance-payment-method-form {
  margin: 0;
  min-width: 8.5rem;
}

.finance-payment-method-select {
  min-width: 8.5rem;
  max-width: 10rem;
}

.clinic-theme-actions-preview {
  margin-top: 0.25rem;
}

.stock-row--low > td {
  background-color: var(--color-accent-soft);
}

.stock-row--low > td:first-child {
  box-shadow: inset 3px 0 0 var(--color-accent);
}

.table-hover > tbody > tr.stock-row--low:hover > * {
  --bs-table-accent-bg: var(--color-accent-border);
  background-color: var(--color-accent-border);
}

.list-card--low-stock {
  border-color: var(--color-accent);
  background: var(--color-accent-soft);
}

.stock-table-search-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 0;
}

.stock-table-search-row__search {
  flex: 1 1 16rem;
  min-width: min(100%, 16rem);
}

.stock-table-search-row .table-search-bar {
  padding: 0;
}

.stock-table-legend {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex: 0 0 auto;
  font-size: 0.8125rem;
  color: var(--color-muted);
  cursor: help;
  user-select: none;
  white-space: nowrap;
}

.stock-table-legend__swatch {
  width: 1rem;
  height: 0.85rem;
  border-radius: 0.2rem;
  background: var(--color-accent-soft);
  box-shadow: inset 2px 0 0 var(--color-accent);
  border: 1px solid var(--color-accent-border);
}

.stock-table-legend__icon {
  font-size: 0.875rem;
  opacity: 0.75;
}

.treatment-consumption--syncing {
  opacity: 0.85;
  pointer-events: none;
}

.lifecycle-code-wrap {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}

.lifecycle-code-wrap--compact {
  gap: 0;
}

.lifecycle-code-label {
  white-space: nowrap;
}

.lifecycle-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.875rem;
  letter-spacing: 0.03em;
  font-weight: 600;
}

a.lifecycle-code-link {
  color: var(--color-primary);
  text-decoration: none;
}

a.lifecycle-code-link:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

:root {
  --overlay-duration: 0.3s;
  --overlay-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1080;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  visibility: hidden;
  pointer-events: none;
}

.image-lightbox.is-open,
.image-lightbox.is-closing {
  visibility: visible;
  pointer-events: auto;
}

.image-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  opacity: 0;
  transition: opacity var(--overlay-duration) var(--overlay-ease);
}

.image-lightbox.is-open .image-lightbox-backdrop {
  opacity: 1;
}

.image-lightbox.is-closing .image-lightbox-backdrop {
  opacity: 0;
}

.image-lightbox-panel {
  position: relative;
  z-index: 1;
  width: min(100%, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  transform: scale(0.96) translateY(10px);
  opacity: 0;
  transition:
    transform var(--overlay-duration) var(--overlay-ease),
    opacity var(--overlay-duration) var(--overlay-ease);
}

.image-lightbox.is-open .image-lightbox-panel {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.image-lightbox.is-closing .image-lightbox-panel {
  transform: scale(0.98) translateY(6px);
  opacity: 0;
}

.image-lightbox-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 0 4px;
}

.image-lightbox-counter {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: #0f172a;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.2);
}

.image-lightbox-counter:empty {
  visibility: hidden;
}

.image-lightbox-close {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: #0f172a;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.125rem;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.image-lightbox-close:hover {
  transform: scale(1.06);
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.24);
}

.image-lightbox-body {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 0;
}

.image-lightbox-nav {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: #0f172a;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.35rem;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.image-lightbox-nav:hover {
  transform: scale(1.06);
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.24);
}

.image-lightbox-nav[hidden] {
  visibility: hidden;
  pointer-events: none;
}

.image-lightbox-stage {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: pan-y pinch-zoom;
}

.image-lightbox-frame {
  position: relative;
  display: inline-block;
  max-width: min(calc(100vw - 180px), 100%);
  max-height: calc(100vh - 220px);
  line-height: 0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.28);
}

.image-lightbox-image {
  display: block;
  width: auto;
  height: auto;
  max-width: min(calc(100vw - 180px), 100%);
  max-height: calc(100vh - 220px);
  vertical-align: middle;
  transition: opacity 0.22s ease;
}

.image-lightbox-image.is-loading {
  opacity: 0.35;
}

.image-lightbox-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 28px 16px 12px;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.72), transparent);
  color: #fff;
  font-size: 0.875rem;
  text-align: center;
}

.image-lightbox-caption:empty {
  display: none;
}

.image-lightbox-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 2px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  width: 100%;
  max-width: calc(100vw - 32px);
  justify-content: center;
}

.image-lightbox-thumb {
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
  scroll-snap-align: center;
  transition: border-color 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
  opacity: 0.72;
}

.image-lightbox-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.image-lightbox-thumb.is-active,
.image-lightbox-thumb:hover {
  border-color: #fff;
  opacity: 1;
  transform: translateY(-2px);
}

body.image-lightbox-open {
  overflow: hidden;
}

@media (max-width: 767px) {
  .image-lightbox {
    padding: 10px;
  }

  .image-lightbox-toolbar {
    min-height: 42px;
    padding: 0 2px;
  }

  .image-lightbox-body {
    gap: 8px;
  }

  .image-lightbox-frame,
  .image-lightbox-image {
    max-width: calc(100vw - 120px);
    max-height: calc(100vh - 188px);
  }

  .image-lightbox-nav {
    width: 42px;
    height: 42px;
    font-size: 1.15rem;
  }

  .image-lightbox-close {
    width: 42px;
    height: 42px;
    font-size: 1rem;
  }

  .image-lightbox-counter {
    min-height: 36px;
    padding: 0 12px;
    font-size: 0.75rem;
  }

  .image-lightbox-thumb {
    width: 60px;
    height: 60px;
  }
}

.app-overlay {
  position: fixed;
  inset: 0;
  z-index: 1090;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  visibility: hidden;
  pointer-events: none;
}

.app-overlay.is-open,
.app-overlay.is-closing {
  visibility: visible;
  pointer-events: auto;
}

.app-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  opacity: 0;
  transition: opacity var(--overlay-duration) var(--overlay-ease);
}

.app-overlay.is-open .app-overlay-backdrop {
  opacity: 1;
}

.app-overlay.is-closing .app-overlay-backdrop {
  opacity: 0;
}

.app-overlay-panel {
  position: relative;
  z-index: 1;
  transform: scale(0.96) translateY(10px);
  opacity: 0;
  transition:
    transform var(--overlay-duration) var(--overlay-ease),
    opacity var(--overlay-duration) var(--overlay-ease);
}

.app-overlay.is-open .app-overlay-panel {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.app-overlay.is-closing .app-overlay-panel {
  transform: scale(0.98) translateY(6px);
  opacity: 0;
}

.app-confirm-panel {
  width: min(100%, 420px);
  padding: 24px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.22);
}

.app-confirm-title {
  margin: 0 0 12px;
  font-size: 1.125rem;
  font-weight: 700;
  color: #0f172a;
}

.app-confirm-message {
  margin: 0 0 20px;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: #334155;
}

.app-confirm-message strong {
  font-weight: 700;
  color: #0f172a;
}

.app-confirm-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

body.app-overlay-open {
  overflow: hidden;
}

@media (max-width: 991px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar-desktop { display: none !important; }

  .main {
    height: auto;
    overflow: visible;
  }

  .calendar-wrap .fc .fc-toolbar {
    flex-wrap: wrap;
    gap: 8px;
  }

  .calendar-wrap .fc .fc-toolbar-chunk {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* Inline skeleton zones — driven by html.skeleton-pending--* for early paint */
.skeleton-zone__placeholder {
  display: none;
}

.skeleton-pending--dashboard #dashboard-sections .dashboard-widget .skeleton-zone__placeholder,
#dashboard-sections.skeleton-zone--loading .dashboard-widget .skeleton-zone__placeholder {
  display: block;
}

.skeleton-pending--dashboard #dashboard-sections .dashboard-widget .skeleton-zone__content,
#dashboard-sections.skeleton-zone--loading .dashboard-widget .skeleton-zone__content {
  visibility: hidden;
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.skeleton-pending--table tbody[data-skeleton-zone="table"] > tr:not(.skeleton-zone__placeholder),
tbody[data-skeleton-zone="table"].skeleton-zone--loading > tr:not(.skeleton-zone__placeholder) {
  display: none !important;
}

.skeleton-pending--table tbody[data-skeleton-zone="table"] > tr.skeleton-zone__placeholder,
tbody[data-skeleton-zone="table"].skeleton-zone--loading > tr.skeleton-zone__placeholder {
  display: table-row !important;
}

tbody[data-skeleton-zone="table"].skeleton-zone--loading,
.skeleton-pending--table tbody[data-skeleton-zone="table"] {
  min-height: 360px;
}

[data-skeleton-zone="calendar"] {
  position: relative;
  min-height: 580px;
}

.skeleton-pending--calendar [data-skeleton-zone="calendar"] .skeleton-zone__placeholder,
[data-skeleton-zone="calendar"].skeleton-zone--loading .skeleton-zone__placeholder {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  position: absolute;
  inset: 0;
  z-index: 2;
  background: var(--color-surface);
}

.skeleton-pending--calendar [data-skeleton-zone="calendar"] .skeleton-zone__content,
[data-skeleton-zone="calendar"].skeleton-zone--loading .skeleton-zone__content {
  visibility: hidden;
}

.dashboard-widget-skeleton {
  width: 100%;
}

.dashboard-widget-skeleton--card .skeleton-block--label {
  height: 14px;
  width: 55%;
  margin-bottom: 12px;
}

.dashboard-widget-skeleton--card .skeleton-block--value {
  height: 32px;
  width: 70%;
  margin-bottom: 10px;
}

.dashboard-widget-skeleton--card .skeleton-block--delta {
  height: 12px;
  width: 40%;
}

.dashboard-widget-skeleton--sparkline .skeleton-block--label,
.dashboard-widget-skeleton--chart .skeleton-block--label {
  height: 14px;
  width: 50%;
  margin-bottom: 8px;
}

.dashboard-widget-skeleton--sparkline .skeleton-block--value-sm,
.dashboard-widget-skeleton--chart .skeleton-block--value-sm {
  height: 24px;
  width: 45%;
  margin-bottom: 12px;
}

.dashboard-widget-skeleton--sparkline .skeleton-block--sparkline-chart {
  height: 40px;
  width: 100%;
}

.dashboard-widget-skeleton--chart .skeleton-block--chart-area {
  height: 180px;
  width: 100%;
}

.skeleton-block--cell {
  display: block;
  height: 20px;
  width: 100%;
}

.skeleton-table-row td {
  padding-top: 12px;
  padding-bottom: 12px;
}

.skeleton-block {
  border-radius: 10px;
  background: linear-gradient(
    90deg,
    var(--color-border) 0%,
    color-mix(in srgb, var(--color-border) 55%, var(--color-surface)) 50%,
    var(--color-border) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.2s ease-in-out infinite;
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-calendar {
  width: 100%;
  height: 100%;
}

.skeleton-block--calendar-toolbar {
  height: 48px;
}

.skeleton-block--calendar-grid {
  height: 520px;
}

@media (max-width: 991px) {
  .skeleton-block--calendar-grid {
    height: 420px;
  }
}

/* Submit progress button */
.btn.submit-progress--busy {
  cursor: wait;
  pointer-events: none;
}

.btn[data-submit-progress-button] {
  min-width: 11rem;
}

.submit-progress__inner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.submit-progress__error {
  width: 100%;
}

[data-submit-progress-actions] .btn-light.disabled {
  pointer-events: none;
  opacity: 0.65;
}

/* Telegram link QR code */
.telegram-link-card__qr-target canvas,
.telegram-link-card__qr-target img {
  display: block;
  margin: 0 auto;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: #fff;
  padding: 4px;
}

/* Help manual */
.help-page .help-search-wrap {
  min-width: min(100%, 320px);
}

.help-toc {
  position: sticky;
  top: 1rem;
}

.help-toc__link {
  display: inline-flex;
  align-items: center;
  color: var(--color-text);
  text-decoration: none;
  padding: 0.2rem 0;
}

.help-toc__link:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

.help-section-tip {
  background: var(--color-primary-soft);
  border-left: 3px solid var(--color-primary);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
}

.help-support-card {
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 1rem;
}

.help-accordion .accordion-button {
  font-weight: 600;
}

.help-accordion .accordion-button:not(.collapsed) {
  color: var(--color-primary-dark);
  background: var(--color-primary-soft);
}

/* Setup welcome journey modal */
.setup-welcome-overlay .setup-journey-panel {
  width: min(100%, 560px);
  max-height: min(90vh, 720px);
  display: flex;
  flex-direction: column;
  padding: 0;
  border-radius: 20px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.22);
}

.setup-journey-header {
  padding: 28px 28px 20px;
  background: linear-gradient(135deg, var(--color-primary-soft) 0%, #fff 55%, var(--color-secondary-soft) 100%);
  border-bottom: 1px solid var(--color-border);
}

.setup-journey-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(47, 125, 126, 0.12);
  color: var(--color-primary-dark);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.setup-journey-title {
  margin: 0 0 8px;
  font-size: 1.5rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: #0f172a;
}

.setup-journey-subtitle {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--color-muted);
  max-width: 46ch;
}

.setup-journey-body {
  padding: 8px 28px 12px;
  overflow-y: auto;
  flex: 1;
}

.setup-timeline {
  list-style: none;
  margin: 0;
  padding: 12px 0 4px;
}

.setup-step {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 0 14px;
  position: relative;
  padding-bottom: 18px;
}

.setup-step:last-child {
  padding-bottom: 0;
}

.setup-step:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 19px;
  top: 40px;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-border) 100%);
  opacity: 0.35;
}

.setup-step-marker {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--color-primary-soft);
  color: var(--color-primary-dark);
  font-size: 14px;
  font-weight: 700;
  border: 2px solid rgba(47, 125, 126, 0.2);
}

.setup-step.is-final .setup-step-marker {
  background: var(--color-success);
  color: #fff;
  border-color: transparent;
}

.setup-step-content {
  min-width: 0;
  padding-top: 2px;
}

.setup-step-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 3px;
  font-size: 0.9375rem;
  font-weight: 650;
  color: var(--color-text);
}

.setup-step-label .bi {
  color: var(--color-primary);
}

.setup-step-desc {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--color-muted);
}

.setup-step-action {
  align-self: center;
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-primary-dark);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}

.setup-step-action:hover {
  background: var(--color-primary-soft);
  border-color: rgba(47, 125, 126, 0.35);
  color: var(--color-primary-dark);
}

.setup-step.is-final .setup-step-action {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.setup-step.is-final .setup-step-action:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  color: #fff;
}

.setup-journey-note {
  margin: 8px 0 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(242, 193, 78, 0.14);
  border: 1px solid rgba(242, 193, 78, 0.35);
  font-size: 0.8125rem;
  line-height: 1.45;
  color: #7c5e12;
}

.setup-journey-note .bi {
  margin-right: 6px;
}

.setup-journey-footer {
  padding: 16px 28px 24px;
  border-top: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #fafbfb;
}

.setup-journey-primary {
  width: 100%;
  min-height: 46px;
  border: none;
  border-radius: 10px;
  background: var(--color-primary);
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 700;
}

.setup-journey-primary:hover {
  background: var(--color-primary-dark);
  color: #fff;
}

.setup-journey-secondary {
  margin: 0;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--color-muted);
}

.setup-journey-help-link {
  border: none;
  padding: 0;
  background: none;
  color: var(--color-primary-dark);
  font-size: inherit;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.setup-journey-help-link:hover {
  color: var(--color-primary);
}

@media (max-width: 600px) {
  .setup-step {
    grid-template-columns: 36px 1fr;
  }

  .setup-step-action {
    grid-column: 2;
    justify-self: start;
    margin-top: 6px;
  }

  .setup-journey-header,
  .setup-journey-body,
  .setup-journey-footer {
    padding-left: 20px;
    padding-right: 20px;
  }
}

/* Client profile (tabs + package progress) */
.client-profile-breadcrumb a { color: var(--color-muted); text-decoration: none; }
.client-profile-breadcrumb a:hover { color: var(--color-primary-dark); }
.client-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--color-success-soft);
  color: var(--action-success-dark);
  font-size: 12px;
  font-weight: 600;
}
.client-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-success);
}
.client-profile-tabs {
  gap: 4px;
  border-bottom: 1px solid var(--color-border);
  flex-wrap: nowrap;
  overflow-x: auto;
}
.client-profile-tabs .nav-link {
  color: var(--color-muted);
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 10px 14px;
  white-space: nowrap;
  font-weight: 600;
  font-size: 0.9375rem;
}
.client-profile-tabs .nav-link:hover { color: var(--color-primary-dark); }
.client-profile-tabs .nav-link.active {
  color: var(--color-primary-dark);
  border-bottom-color: var(--color-primary);
  background: transparent;
}
.package-progress-card {
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 20px;
  background: var(--color-surface);
}
.package-progress-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--color-primary);
  color: #fff;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.package-progress-bar {
  height: 8px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}
.package-progress-bar .progress-bar {
  background: var(--color-primary);
}
.package-session-list { display: grid; gap: 8px; }
.package-session-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.9375rem;
}
.package-session-row:last-child { border-bottom: 0; }
.package-session-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #e5e7eb;
  color: var(--color-muted);
  font-weight: 700;
  font-size: 13px;
}
.package-session-row.is-done .package-session-num {
  background: var(--color-primary);
  color: #fff;
}

.package-sessions-schedule {
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 16px;
  background: var(--color-surface);
}
.package-sessions-schedule-list {
  display: grid;
  gap: 12px;
}
.package-sessions-schedule-row {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
}
.package-sessions-schedule-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}
.package-sessions-schedule-label {
  font-weight: 600;
  margin-bottom: 2px;
}
.package-sessions-schedule-meta {
  font-size: 0.8125rem;
  color: var(--color-muted);
}

/* Package session editor */
.package-sessions-editor .accordion-button {
  font-weight: 600;
}
.package-sessions-editor .accordion-button:not(.collapsed) {
  color: var(--color-primary-dark);
  background: var(--color-primary-soft);
  box-shadow: none;
}
.package-sessions-editor .accordion-button:focus {
  box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--color-primary) 25%, transparent);
}
.package-sessions-editor .accordion-button::after {
  filter: none;
}
.package-procedure-list {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.5rem;
  max-height: calc(2.5rem * 5 + 1rem);
  overflow-y: auto;
  padding: 0;
  min-height: 0;
  border: 0;
  background: transparent;
}
.package-procedure-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex: 0 1 auto;
  width: max-content;
  max-width: min(100%, 18rem);
  padding: 0.4rem 0.35rem 0.4rem 0.65rem;
  border: 1px solid color-mix(in srgb, var(--color-primary) 22%, var(--color-border, #dee2e6));
  border-radius: 0.5rem;
  background: var(--color-primary-soft);
  color: var(--color-primary-dark);
  box-shadow: none;
}
.package-procedure-item-label {
  flex: 0 1 auto;
  min-width: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.package-procedure-item-label .package-procedure-duration {
  font-weight: 500;
  opacity: 0.75;
  margin-left: 0.15rem;
}
.package-procedure-remove {
  appearance: none;
  -webkit-appearance: none;
  border: 0 !important;
  background: transparent !important;
  color: var(--color-primary-dark);
  width: 1.5rem;
  height: 1.5rem;
  min-width: 1.5rem;
  border-radius: 0.35rem;
  display: inline-grid;
  place-items: center;
  line-height: 1;
  padding: 0;
  opacity: 0.7;
  box-shadow: none !important;
  flex-shrink: 0;
}
.package-procedure-remove:hover,
.package-procedure-remove:focus {
  opacity: 1;
  color: var(--color-danger, #b42318);
  background: color-mix(in srgb, var(--color-danger, #b42318) 12%, transparent) !important;
}
.package-procedure-remove i {
  font-size: 0.7rem;
}
.package-procedure-empty {
  width: 100%;
  padding: 0.35rem 0;
  margin: 0;
}
.package-session-procedure-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--color-border);
}
.package-procedure-modal-list {
  max-height: calc(2.35rem * 6);
  overflow-y: auto;
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  padding: 0.35rem 0.75rem;
}
.package-procedure-modal-list:empty {
  display: none;
}
.package-procedure-modal-row {
  padding: 0.4rem 0;
  margin: 0;
}
.package-procedure-modal-row .form-check-input {
  margin-top: 0.2rem;
}

/* Tom Select — alinhado ao tema (borda no wrapper; control sem borda) */
.ts-wrapper.single.form-select,
.ts-wrapper.form-select {
  padding: 0 !important;
  border: 1px solid var(--color-border, #ced4da) !important;
  border-radius: 0.375rem !important;
  background-color: var(--color-surface, #fff) !important;
  background-image: none !important;
  min-height: calc(1.5em + 0.75rem + 2px);
  box-shadow: none;
}
.ts-wrapper.form-select.form-select-sm {
  min-height: calc(1.5em + 0.5rem + 2px);
}
.ts-wrapper.form-select .ts-control {
  border: 0 !important;
  border-radius: 0.375rem;
  min-height: inherit;
  padding: 0.375rem 0.75rem;
  background: transparent !important;
  box-shadow: none !important;
}
.ts-wrapper.form-select.form-select-sm .ts-control {
  padding: 0.25rem 0.5rem;
}
.ts-wrapper.focus.form-select,
.ts-wrapper.dropdown-active.form-select {
  border-color: var(--color-primary) !important;
  box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--color-primary) 25%, transparent) !important;
}
.ts-wrapper.form-select .ts-control > input {
  min-width: 4rem !important;
}
.ts-dropdown {
  border: 1px solid var(--color-border, #ced4da) !important;
  border-radius: 0.375rem;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  z-index: 2000;
}
.ts-dropdown .option.active,
.ts-dropdown .option.selected {
  background: var(--color-primary-soft) !important;
  color: var(--color-primary-dark) !important;
}
.ts-dropdown .dropdown-input-wrap {
  padding: 0.5rem 0.5rem 0.35rem;
  border-bottom: 1px solid var(--color-border, #dee2e6);
}
.ts-dropdown .dropdown-input {
  width: 100%;
  border: 1px solid var(--color-border, #dee2e6) !important;
  border-radius: 0.375rem;
  padding: 0.4rem 0.65rem;
}
.ts-dropdown .dropdown-input:focus {
  outline: 0;
  border-color: var(--color-primary) !important;
}
.ts-dropdown .no-results {
  padding: 0.65rem 0.75rem;
  color: var(--color-muted, #6b7280);
  font-size: 0.875rem;
}
