:root {
  --primary: #0d6efd;
  --primary-dark: #0a58ca;
  --sidebar-width: 270px;
  --sidebar-width-collapsed: 76px;
  --bg-soft: #f4f7fb;
  --card-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg-soft);
  color: #1e293b;
}

.app-body { min-height: 100vh; }

.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: linear-gradient(180deg, #0f172a 0%, #1e3a5f 100%);
  color: #fff;
  position: sticky;
  top: 0;
  flex-shrink: 0;
  overflow-x: hidden;
  z-index: 1050;
}

html:not(.sidebar-js-ready) #sidebar,
html:not(.sidebar-js-ready) .sidebar-brand-text,
html:not(.sidebar-js-ready) .sidebar-label {
  transition: none !important;
}

html.sidebar-js-ready #sidebar {
  transition: width .2s ease, transform .2s ease;
}

.sidebar-brand-text {
  transition: opacity .18s ease;
  min-width: 0;
  line-height: 1.25;
}

.sidebar-brand-text small {
  white-space: normal;
  line-height: 1.35;
}

.sidebar-label {
  transition: opacity .18s ease;
  white-space: nowrap;
}

body.sidebar-collapsed #sidebar {
  width: var(--sidebar-width-collapsed);
}

body.sidebar-expanded #sidebar {
  width: var(--sidebar-width);
}

body.sidebar-collapsed .sidebar-brand {
  justify-content: center;
  align-items: center;
  gap: 0;
}

body.sidebar-collapsed .sidebar-brand-text,
body.sidebar-collapsed .sidebar-label {
  opacity: 0;
  width: 0;
  overflow: hidden;
  pointer-events: none;
}

body.sidebar-collapsed .sidebar-nav .nav-link {
  justify-content: center;
  gap: 0;
  padding-inline: .65rem;
  margin-inline: .45rem;
}

.sidebar-toggle {
  min-width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: 0 .65rem;
}

.sidebar-toggle-label {
  font-weight: 600;
  font-size: .85rem;
}

.sidebar-collapse-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 8px;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  flex-shrink: 0;
  padding: 0;
  transition: background .15s ease;
}

.sidebar-collapse-btn:hover {
  background: rgba(255, 255, 255, .16);
}

body.sidebar-show-collapse-btn .sidebar-collapse-btn {
  display: inline-flex;
}

body.sidebar-collapsed .sidebar-collapse-btn {
  display: none !important;
}

.app-sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .45);
  z-index: 1040;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}

.app-sidebar-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.sidebar-brand {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.brand-icon {
  width: 44px;
  height: 44px;
  margin-top: 2px;
  border-radius: 12px;
  background: rgba(255,255,255,.12);
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.sidebar-nav .nav-link {
  color: rgba(255,255,255,.78);
  padding: .75rem 1.25rem;
  border-radius: 10px;
  margin: .15rem .75rem;
  display: flex;
  align-items: center;
  gap: .65rem;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
  background: rgba(255,255,255,.12);
  color: #fff;
}

.topbar {
  min-height: 64px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.content-area { min-height: calc(100vh - 64px); }

.stat-card {
  background: #fff;
  border-radius: 16px;
  padding: 1.1rem;
  box-shadow: var(--card-shadow);
  position: relative;
  overflow: hidden;
  height: 100%;
}

.stat-label {
  display: block;
  font-size: .78rem;
  color: #64748b;
  margin-bottom: .35rem;
}

.stat-value {
  font-size: 1.5rem;
  line-height: 1.2;
}

.stat-icon {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  font-size: 1.6rem;
  opacity: .15;
}

.card-modern {
  border: 0;
  border-radius: 18px;
  box-shadow: var(--card-shadow);
}

.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  background: linear-gradient(135deg, #e8f1ff 0%, #f8fbff 50%, #eef7f3 100%);
}

.login-card {
  border-radius: 24px;
  overflow: hidden;
}

.login-hero {
  background: linear-gradient(160deg, #0f172a, #2563eb);
}

.login-brand-icon {
  font-size: clamp(2.5rem, 8vw, 3.5rem);
  line-height: 1;
}

.login-brand-title {
  font-size: clamp(1.35rem, 5vw, 2rem);
  font-weight: 700;
  margin: 0;
}

.login-brand-tagline {
  font-size: clamp(.85rem, 3.2vw, 1rem);
  max-width: 22rem;
}

.remember-check {
  background: #f0f7ff;
  border: 1px solid #bfdbfe;
}
.remember-check .form-check-input:checked {
  background-color: var(--primary);
  border-color: var(--primary);
}

/* ── Portal do Cliente ── */
.portal-body {
  --portal-accent: #2563eb;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--portal-accent) 10%, #fff) 0%,
    #f8fafc 220px,
    #f8fafc 100%
  );
  color: #1e293b;
}

.portal-body .btn-primary {
  background-color: var(--portal-accent);
  border-color: var(--portal-accent);
}

.portal-body .btn-primary:hover,
.portal-body .btn-primary:focus {
  background-color: color-mix(in srgb, var(--portal-accent) 85%, #000);
  border-color: color-mix(in srgb, var(--portal-accent) 85%, #000);
}

.portal-body .text-primary {
  color: var(--portal-accent) !important;
}

.portal-top { position: sticky; top: 0; z-index: 1030; }

.portal-navbar {
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 16px rgba(15, 23, 42, .06);
  padding-block: .65rem;
}

.portal-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
  color: #0f172a !important;
}

.portal-brand small {
  color: #64748b;
  font-size: .72rem;
  font-weight: 500;
}

.portal-brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(
    135deg,
    var(--portal-accent),
    color-mix(in srgb, var(--portal-accent) 65%, #0ea5e9)
  );
  color: #fff;
  font-size: 1.15rem;
}

.portal-nav-link {
  display: inline-flex !important;
  align-items: center;
  gap: .45rem;
  font-weight: 600;
  color: #475569 !important;
  border-radius: 10px;
  padding: .55rem .85rem !important;
  transition: all .15s ease;
}

.portal-nav-link:hover,
.portal-nav-link.active {
  color: var(--portal-accent) !important;
  background: color-mix(in srgb, var(--portal-accent) 12%, #fff);
}

.portal-nav-logout { cursor: pointer; }

.portal-user-chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem .8rem;
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
  font-size: .85rem;
  font-weight: 600;
}

.portal-main { flex: 1; }

.portal-footer {
  padding: 1.25rem 0 1.5rem;
  color: #94a3b8;
}

.portal-hero {
  background: linear-gradient(
    135deg,
    #0f172a 0%,
    color-mix(in srgb, var(--portal-accent) 80%, #0f172a) 55%,
    color-mix(in srgb, var(--portal-accent) 55%, #0ea5e9) 100%
  );
  color: #fff;
  border-radius: 24px;
  padding: 2rem 1.75rem;
  box-shadow: 0 18px 40px color-mix(in srgb, var(--portal-accent) 28%, transparent);
}

.portal-hero-eyebrow {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  opacity: .78;
  margin-bottom: .5rem;
}

.portal-hero-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  margin-bottom: .5rem;
}

.portal-hero-text { opacity: .9; max-width: 42rem; }

.portal-quick-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 100%;
  padding: 1.15rem 1.2rem;
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--card-shadow);
  text-decoration: none;
  color: inherit;
  transition: transform .15s ease, box-shadow .15s ease;
}

.portal-quick-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(15, 23, 42, .1);
  color: inherit;
}

.portal-quick-card strong {
  display: block;
  font-size: 1rem;
}

.portal-quick-card span {
  display: block;
  color: #64748b;
  font-size: .85rem;
}

.portal-quick-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.portal-quick-icon-exercises {
  background: color-mix(in srgb, var(--portal-accent) 12%, #fff);
  color: var(--portal-accent);
}
.portal-quick-icon-financial { background: #ecfdf5; color: #059669; }
.portal-quick-icon-evolution { background: #fdf4ff; color: #a855f7; }

.portal-quick-arrow {
  margin-left: auto;
  color: #94a3b8;
}

.portal-panel {
  background: #fff;
  border-radius: 20px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.portal-panel-header {
  padding: 1.15rem 1.35rem;
  border-bottom: 1px solid #eef2f7;
}

.portal-panel-header h2 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
}

.portal-panel-body { padding: 1.35rem; }

.portal-page-title {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: .35rem;
}

.portal-appointment-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-radius: 16px;
  background: color-mix(in srgb, var(--portal-accent) 6%, #fff);
  border: 1px solid color-mix(in srgb, var(--portal-accent) 22%, #fff);
}

.portal-appointment-date {
  width: 72px;
  text-align: center;
  border-radius: 14px;
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--portal-accent) 22%, #fff);
  padding: .65rem .5rem;
  flex-shrink: 0;
}

.portal-appointment-day {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1;
  color: var(--portal-accent);
}

.portal-appointment-month {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  color: #64748b;
  margin-top: .2rem;
}

.portal-appointment-time {
  font-size: 1.1rem;
  font-weight: 700;
}

.portal-notification-item {
  padding: .9rem 0;
  border-bottom: 1px solid #eef2f7;
}

.portal-notification-item:last-child { border-bottom: 0; padding-bottom: 0; }

.portal-notification-item p {
  color: #64748b;
  font-size: .9rem;
  margin-top: .25rem;
}

.portal-plan-banner,
.portal-subscription-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.2rem 1.35rem;
  border-radius: 18px;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--portal-accent) 10%, #fff),
    #f8fbff
  );
  border: 1px solid color-mix(in srgb, var(--portal-accent) 24%, #fff);
}

.portal-subscription-card {
  background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
  border-color: #bbf7d0;
}

.portal-subscription-icon,
.portal-plan-banner > i {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--portal-accent);
  font-size: 1.4rem;
  flex-shrink: 0;
}

.portal-subscription-icon { color: #059669; }

.portal-subscription-label {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #64748b;
  font-weight: 700;
}

.portal-subscription-name { font-size: 1.25rem; font-weight: 800; }

.portal-subscription-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  color: #475569;
  font-size: .92rem;
}

.portal-exercise-day {
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.portal-exercise-day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.2rem;
  background: #f8fafc;
  border-bottom: 1px solid #eef2f7;
}

.portal-exercise-day-badge {
  font-weight: 700;
  color: var(--portal-accent);
}

.portal-exercise-list {
  list-style: none;
  margin: 0;
  padding: .5rem 0;
}

.portal-exercise-list li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .5rem;
  padding: .85rem 1.2rem;
  border-bottom: 1px solid #f1f5f9;
}

.portal-exercise-list li:last-child { border-bottom: 0; }

.portal-exercise-name { font-weight: 600; }

.portal-exercise-meta {
  color: #64748b;
  font-size: .88rem;
}

.portal-exercise-empty {
  color: #94a3b8 !important;
  font-style: italic;
}

.portal-payment-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.35rem;
  border-bottom: 1px solid #f1f5f9;
}

.portal-payment-row:last-child { border-bottom: 0; }

.portal-payment-status {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: .35rem .65rem;
  border-radius: 999px;
  white-space: nowrap;
}

.portal-payment-status-paid,
.portal-payment-status-pago { background: #dcfce7; color: #166534; }
.portal-payment-status-pending,
.portal-payment-status-pendente { background: #fef3c7; color: #92400e; }
.portal-payment-status-overdue,
.portal-payment-status-atrasado,
.portal-payment-status-late { background: #fee2e2; color: #991b1b; }

.portal-evolution-card {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 0;
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
  margin-bottom: 1rem;
}

.portal-evolution-date {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--portal-accent) 10%, #fff),
    #f8fbff
  );
  border-right: 1px solid color-mix(in srgb, var(--portal-accent) 22%, #fff);
  padding: 1.25rem 1rem;
  font-weight: 700;
  color: var(--portal-accent);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  text-align: center;
}

.portal-evolution-body { padding: 1.25rem 1.35rem; }

.portal-evolution-body h3 {
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #64748b;
  margin-bottom: .35rem;
}

.portal-evolution-body p { margin-bottom: 1rem; }
.portal-evolution-body p:last-child { margin-bottom: 0; }

.portal-empty-state,
.portal-empty-inline {
  text-align: center;
  color: #64748b;
}

.portal-empty-state {
  background: #fff;
  border-radius: 20px;
  box-shadow: var(--card-shadow);
  padding: 3rem 1.5rem;
}

.portal-empty-state > i,
.portal-empty-inline > i {
  display: block;
  font-size: 2.2rem;
  color: #cbd5e1;
  margin-bottom: .75rem;
}

.portal-empty-state h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #334155;
}

.portal-theme-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .85rem;
}

.portal-theme-swatch {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 16px;
  border: 3px solid #fff;
  box-shadow: 0 0 0 1px #e2e8f0, 0 6px 16px rgba(15, 23, 42, .08);
  background: var(--swatch-color);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}

.portal-theme-swatch:hover { transform: translateY(-2px); }

.portal-theme-swatch.is-active {
  box-shadow: 0 0 0 3px var(--portal-accent), 0 8px 20px rgba(15, 23, 42, .12);
}

.portal-color-input {
  width: 72px;
  height: 52px;
  padding: .25rem;
  border-radius: 12px;
}

.portal-theme-preview {
  --portal-accent: #2563eb;
  background: #fff;
  border-radius: 20px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.portal-theme-preview-hero {
  padding: 1.5rem;
  color: #fff;
  font-weight: 700;
  background: linear-gradient(
    135deg,
    #0f172a 0%,
    color-mix(in srgb, var(--portal-accent) 80%, #0f172a) 55%,
    color-mix(in srgb, var(--portal-accent) 55%, #0ea5e9) 100%
  );
}

.portal-theme-preview-card {
  padding: 1.25rem;
}

.portal-theme-preview-card span {
  display: block;
  color: #64748b;
  font-size: .9rem;
  margin-top: .25rem;
}

.portal-theme-preview .btn-primary {
  background-color: var(--portal-accent);
  border-color: var(--portal-accent);
}

@media (max-width: 767.98px) {
  .portal-hero { padding: 1.5rem 1.25rem; border-radius: 20px; }
  .portal-evolution-card { grid-template-columns: 1fr; }
  .portal-evolution-date {
    flex-direction: row;
    border-right: 0;
    border-bottom: 1px solid color-mix(in srgb, var(--portal-accent) 22%, #fff);
    justify-content: flex-start;
  }
  #portalNav.show { display: block !important; margin-top: .75rem; }
  .portal-theme-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.page-header h1 { font-weight: 700; }

.table-modern {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
}

.badge-status { font-weight: 700; }

.module-help {
  background: #f8fbff !important;
  border-left: 4px solid var(--primary) !important;
}

.field-box {
  background: #f8fafc;
  border-radius: 12px;
  padding: 1rem;
  height: 100%;
}

.form-section {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e2e8f0;
}
.form-section:last-of-type { border-bottom: 0; }
.form-section-title {
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 1rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid #eff6ff;
}

.address-display div { line-height: 1.5; }

.field-box strong {
  display: block;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: #64748b;
  margin-bottom: .35rem;
}

/* ── Navegação ── */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  color: #475569;
  text-decoration: none;
  font-weight: 600;
  font-size: .95rem;
  padding: .55rem 1rem;
  margin-bottom: 1.25rem;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .05);
  transition: all .15s ease;
}
.btn-back i { font-size: 1.15rem; color: var(--primary); }
.btn-back:hover {
  color: var(--primary);
  border-color: #bfdbfe;
  background: #f0f7ff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, .12);
}
.btn-back-emphasis {
  padding: .7rem 1.25rem;
  font-size: 1rem;
  border: 2px solid #bfdbfe;
  background: linear-gradient(135deg, #eff6ff 0%, #f8fbff 100%);
  box-shadow: 0 4px 14px rgba(37, 99, 235, .1);
}
.btn-back-emphasis i { font-size: 1.3rem; }
.btn-back-emphasis:hover {
  background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 100%);
  transform: translateX(-2px);
}

/* ── Gráficos (fix tremor) ── */
.chart-box {
  position: relative;
  height: 280px;
  width: 100%;
  overflow: hidden;
}
.chart-box-sm { height: 220px; }
.chart-box canvas {
  display: block;
  max-height: 100%;
}

/* Gráficos CSS — mesmo visual, sem JavaScript que trava */
.css-doughnut {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .08);
}
.css-doughnut-hole {
  position: absolute;
  inset: 28%;
  background: #fff;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.2;
}
.css-doughnut-hole strong {
  font-size: 1.5rem;
  color: #1e293b;
}
.css-doughnut-hole small {
  font-size: .72rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.css-doughnut-legend li {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .45rem 0;
  font-size: .92rem;
}
.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.css-bar-col {
  flex: 1;
  max-width: 72px;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: .35rem;
}
.css-bar-fill {
  width: 100%;
  min-height: 8px;
  background: linear-gradient(180deg, #4ade80, #22c55e);
  border-radius: 8px 8px 4px 4px;
  transition: height .3s ease;
}
.css-bar-label {
  display: block;
  font-size: .68rem;
  color: #64748b;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.css-bar-value {
  font-size: .78rem;
  font-weight: 700;
  color: #16a34a;
}

/* ── Avatares ── */
.avatar-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.avatar-lg { width: 64px; height: 64px; font-size: 1.5rem; }
.avatar-sm { width: 36px; height: 36px; font-size: .9rem; }

/* ── Hero de detalhe ── */
.detail-hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e40af 100%);
  color: #fff;
  border-radius: 20px;
  padding: 2rem;
}
.detail-hero-exercise { background: linear-gradient(135deg, #134e4a 0%, #0d9488 100%); }
.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,.15);
  padding: .25rem .75rem;
  border-radius: 20px;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .5rem;
}

/* ── Info blocks ── */
.info-block {
  background: #fff;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--card-shadow);
  height: 100%;
}
.info-block h5 { font-size: 1rem; margin-bottom: .75rem; }
.info-block-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  margin-bottom: .75rem;
  font-size: 1.1rem;
}

/* ── Stat cards coloridas ── */
.stat-card-blue { border-top: 3px solid #3b82f6; }
.stat-card-green { border-top: 3px solid #22c55e; }
.stat-card-orange { border-top: 3px solid #f59e0b; }
.stat-card-purple { border-top: 3px solid #8b5cf6; }
.stat-card-red { border-top: 3px solid #ef4444; }
.stat-card-teal { border-top: 3px solid #14b8a6; }

/* ── Status badges agenda ── */
.badge-status-scheduled { background: #dbeafe; color: #1d4ed8; }
.badge-status-confirmed { background: #dcfce7; color: #15803d; }
.badge-status-completed { background: #ede9fe; color: #6d28d9; }
.badge-status-cancelled { background: #fee2e2; color: #dc2626; }
.badge-status-no_show { background: #ffedd5; color: #c2410c; }

/* ── Gerenciar agendamento ── */
.appt-hero {
  border-radius: 20px;
  padding: 1.75rem 2rem;
  color: #fff;
  box-shadow: 0 16px 40px rgba(15, 23, 42, .14);
  margin-bottom: 1.5rem;
}
.appt-hero-scheduled { background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%); }
.appt-hero-confirmed { background: linear-gradient(135deg, #047857 0%, #10b981 100%); }
.appt-hero-completed { background: linear-gradient(135deg, #6d28d9 0%, #8b5cf6 100%); }
.appt-hero-cancelled { background: linear-gradient(135deg, #b91c1c 0%, #ef4444 100%); }
.appt-hero-no_show { background: linear-gradient(135deg, #c2410c 0%, #f97316 100%); }

.appt-hero-status {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .45rem 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .28);
  font-weight: 700;
  font-size: .92rem;
  letter-spacing: .02em;
}
.appt-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  margin-top: 1rem;
}
.appt-hero-meta-item {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-size: .95rem;
  opacity: .95;
}
.appt-hero-meta-item i { font-size: 1.1rem; opacity: .85; }

.appt-status-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  margin-bottom: 1.5rem;
}
.appt-status-step {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem .9rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #e2e8f0;
  color: #64748b;
  font-size: .82rem;
  font-weight: 600;
}
.appt-status-step.is-active {
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, .12);
}
.appt-status-step.is-active.step-scheduled { background: linear-gradient(135deg, #2563eb, #3b82f6); }
.appt-status-step.is-active.step-confirmed { background: linear-gradient(135deg, #059669, #10b981); }
.appt-status-step.is-active.step-completed { background: linear-gradient(135deg, #7c3aed, #8b5cf6); }
.appt-status-step.is-active.step-cancelled { background: linear-gradient(135deg, #dc2626, #ef4444); }
.appt-status-step.is-active.step-no_show { background: linear-gradient(135deg, #ea580c, #f97316); }

.appt-field-pair .form-text {
  font-size: .78rem;
  line-height: 1.35;
  min-height: 1.35em;
}
.appt-status-arrow { color: #cbd5e1; font-size: .85rem; }

.appt-status-card {
  background: #fff;
  border-radius: 18px;
  border: 2px solid #bfdbfe;
  box-shadow: 0 12px 32px rgba(37, 99, 235, .08);
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.appt-status-card-header {
  background: linear-gradient(135deg, #eff6ff 0%, #f8fbff 100%);
  border-bottom: 1px solid #dbeafe;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.appt-status-card-header h5 {
  margin: 0;
  font-weight: 700;
  color: #1e40af;
}
.appt-status-card-body { padding: 1.25rem; }
.appt-status-select {
  font-size: 1.05rem;
  font-weight: 600;
  padding: .75rem 1rem;
  border: 2px solid #93c5fd;
  border-radius: 12px;
  background: #f8fbff;
}
.appt-status-select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}
.appt-status-hint {
  background: #f8fafc;
  border-radius: 12px;
  padding: .85rem 1rem;
  font-size: .88rem;
  color: #475569;
  margin-top: 1rem;
}
.appt-status-hint strong { color: #1e293b; }

.appt-form-card {
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--card-shadow);
  padding: 1.25rem;
  height: 100%;
}
.appt-form-card h5 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: #1e293b;
}
.appt-summary-pill {
  background: #f8fafc;
  border-radius: 12px;
  padding: .85rem 1rem;
  margin-bottom: .75rem;
}
.appt-summary-pill strong {
  display: block;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #94a3b8;
  margin-bottom: .2rem;
}
.appt-summary-pill span { color: #1e293b; font-weight: 600; }

.appt-cancel-box {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 12px;
  padding: 1rem;
  margin-top: 1rem;
}
.appt-cancel-box.is-hidden { display: none; }

.appt-reagendar-hint {
  margin-top: 1rem;
  padding: .85rem 1rem;
  border-radius: 12px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  font-size: .9rem;
}
.appt-reagendar-hint.is-hidden { display: none; }

.appt-detail-actions-card {
  background: linear-gradient(180deg, #fff 0%, #f8fbff 100%);
  border: 2px solid #dbeafe;
  border-radius: 18px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 8px 24px rgba(37, 99, 235, .08);
}
.appt-detail-field { margin-bottom: 0; }
.appt-detail-label {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #94a3b8;
  font-weight: 700;
  margin-bottom: .35rem;
}
.appt-detail-value {
  font-size: 1rem;
  font-weight: 600;
  color: #1e293b;
  padding: .65rem .85rem;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}
.appt-detail-value-text {
  font-weight: 500;
  line-height: 1.55;
  white-space: pre-wrap;
}
.appt-edit-banner {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  padding: 1rem 1.25rem;
  border-radius: 14px;
  background: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 100%);
  border: 1px solid #bfdbfe;
  color: #1e40af;
}
.appt-edit-banner i {
  font-size: 1.35rem;
  margin-top: .1rem;
  flex-shrink: 0;
}
.appt-edit-banner strong {
  display: block;
  margin-bottom: .15rem;
}
.appt-edit-banner span {
  font-size: .9rem;
  opacity: .9;
}

.appt-schedule-card {
  border: 2px solid #dbeafe;
  background: linear-gradient(180deg, #fff 0%, #f8fbff 100%);
}
.appt-schedule-card.is-highlight {
  border-color: #3b82f6;
  box-shadow: 0 8px 24px rgba(37, 99, 235, .12);
}
.appt-schedule-card input[type="datetime-local"] {
  min-height: 46px;
  font-size: 1rem;
  font-weight: 600;
}

.appt-availability { border: 1px solid #e2e8f0; }
.availability-section-title {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: .5rem;
}
.availability-slots {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}
.availability-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: .35rem .75rem;
  font-size: .78rem;
  font-weight: 600;
  border: 1px solid transparent;
  line-height: 1.3;
}
.availability-chip strong { margin-right: .25rem; }
.availability-chip-occupied {
  background: #f8fafc;
  color: #475569;
  border-color: #e2e8f0;
}
.availability-chip-scheduled { background: #dbeafe; color: #1d4ed8; border-color: #bfdbfe; }
.availability-chip-confirmed { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.availability-chip-completed { background: #ede9fe; color: #6d28d9; border-color: #ddd6fe; }
.availability-chip-cancelled,
.availability-chip-no_show,
.availability-chip-freeable {
  background: #f1f5f9;
  color: #64748b;
  border-color: #e2e8f0;
  text-decoration: line-through;
  opacity: .85;
}
.availability-chip-free {
  background: #f0fdf4;
  color: #15803d;
  border-color: #86efac;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
.availability-chip-free:hover {
  background: #dcfce7;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(22, 163, 74, .15);
}
.availability-empty {
  font-size: .82rem;
  color: #94a3b8;
  font-style: italic;
}
.availability-loading.is-hidden,
.availability-error.is-hidden,
.availability-content.is-hidden { display: none; }

/* ── Lista da agenda ── */
.agenda-period-toggle {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .3rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, .06);
}
.agenda-period-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .55rem .95rem;
  border-radius: 10px;
  font-size: .84rem;
  font-weight: 700;
  color: #64748b;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.agenda-period-btn i {
  font-size: 1rem;
  line-height: 1;
}
.agenda-period-btn:hover {
  background: #f8fafc;
  color: #2563eb;
  text-decoration: none;
}
.agenda-period-btn.is-active {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #fff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, .28);
}
.agenda-period-btn.is-active:hover {
  color: #fff;
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
}

.agenda-filters .form-select { border-radius: 10px; }
.agenda-active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.agenda-filter-chip {
  display: inline-flex;
  align-items: center;
  padding: .3rem .7rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
  background: #f1f5f9;
  color: #475569;
}

.agenda-status-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
}
.agenda-legend-item {
  display: inline-flex;
  align-items: center;
  padding: .45rem .8rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
  text-decoration: none;
  border: 2px solid transparent;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
  cursor: pointer;
}
.agenda-legend-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(15, 23, 42, .1);
  text-decoration: none;
}
.agenda-legend-item.is-active {
  border-color: currentColor;
  box-shadow: 0 6px 18px rgba(15, 23, 42, .12);
  transform: translateY(-1px);
}
.agenda-legend-item strong { margin-left: .25rem; }

.agenda-list { display: flex; flex-direction: column; gap: .75rem; }

.agenda-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.25rem;
  background: #fff;
  border-radius: 16px;
  padding: 1rem 1.25rem;
  box-shadow: var(--card-shadow);
  border-left: 4px solid #3b82f6;
  transition: transform .12s ease, box-shadow .12s ease;
}
.agenda-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 36px rgba(15, 23, 42, .09);
}
.agenda-item-scheduled { border-left-color: #3b82f6; }
.agenda-item-confirmed { border-left-color: #10b981; }
.agenda-item-completed { border-left-color: #8b5cf6; }
.agenda-item-cancelled { border-left-color: #ef4444; }
.agenda-item-no_show { border-left-color: #f97316; }

.agenda-item-time {
  min-width: 72px;
  text-align: center;
  padding: .5rem .65rem;
  border-radius: 12px;
  background: #f8fafc;
  flex-shrink: 0;
}
.agenda-item-date {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: .03em;
}
.agenda-item-hour {
  display: block;
  font-size: 1.15rem;
  font-weight: 800;
  color: #1e293b;
  line-height: 1.2;
}
.agenda-item-duration {
  display: block;
  font-size: .7rem;
}
.agenda-item-body { flex: 1; min-width: 180px; }
.agenda-item-client { font-size: 1rem; color: #1e293b; }
.agenda-badge-upcoming {
  background: #dcfce7;
  color: #15803d;
  font-size: .65rem;
  font-weight: 700;
}

.agenda-item-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: .5rem;
  margin-left: auto;
}
.agenda-status-badge {
  font-size: .78rem;
  font-weight: 700;
  padding: .45rem .8rem;
  border-radius: 999px;
}

.agenda-btn-manage {
  font-weight: 600;
  border-radius: 10px;
  padding: .35rem .9rem;
  border: 1px solid;
}
.agenda-btn-scheduled { border-color: #93c5fd; color: #1d4ed8; background: #f8fbff; }
.agenda-btn-scheduled:hover { background: #dbeafe; border-color: #3b82f6; color: #1e40af; }
.agenda-btn-confirmed { border-color: #86efac; color: #15803d; background: #f0fdf4; }
.agenda-btn-confirmed:hover { background: #dcfce7; border-color: #22c55e; color: #166534; }
.agenda-btn-completed { border-color: #c4b5fd; color: #6d28d9; background: #faf5ff; }
.agenda-btn-completed:hover { background: #ede9fe; border-color: #8b5cf6; color: #5b21b6; }
.agenda-btn-cancelled { border-color: #fca5a5; color: #dc2626; background: #fef2f2; }
.agenda-btn-cancelled:hover { background: #fee2e2; border-color: #ef4444; color: #b91c1c; }
.agenda-btn-no_show { border-color: #fdba74; color: #c2410c; background: #fff7ed; }
.agenda-btn-no_show:hover { background: #ffedd5; border-color: #f97316; color: #9a3412; }

@media (max-width: 767.98px) {
  .agenda-item { padding: .9rem 1rem; }
  .agenda-item-actions {
    width: 100%;
    justify-content: space-between;
    margin-left: 0;
    padding-top: .5rem;
    border-top: 1px solid #f1f5f9;
  }
}

/* ── Timeline ── */
.timeline-list { padding: .5rem 0; }
.timeline-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .85rem 1.25rem;
  border-bottom: 1px solid #f1f5f9;
}
.timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}

/* ── Prontuário cards ── */
.evolution-card { transition: transform .15s, box-shadow .15s; }
.evolution-card:hover { transform: translateY(-2px); box-shadow: 0 14px 40px rgba(15,23,42,.1); }
.evolution-label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #94a3b8;
  font-weight: 600;
}
.evolution-section p { color: #334155; }

.edit-action-bar {
  background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
  border: 2px solid #bfdbfe;
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
}

/* ── Ficha do paciente ── */
.client-hero {
  border-radius: 20px;
  padding: 1.75rem 2rem;
  color: #fff;
  box-shadow: 0 16px 40px rgba(15, 23, 42, .14);
}
.client-hero-active { background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%); }
.client-hero-inactive { background: linear-gradient(135deg, #475569 0%, #64748b 100%); }
.client-hero-suspended { background: linear-gradient(135deg, #c2410c 0%, #f97316 100%); }
.client-hero-eyebrow {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  opacity: .75;
  margin-bottom: .35rem;
}
.client-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .85rem 1.25rem;
  margin-top: .5rem;
}
.client-hero-meta-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .92rem;
  opacity: .95;
}
.client-hero-meta-item i { opacity: .85; }
.client-hero-status {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .45rem 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .28);
  font-weight: 700;
  font-size: .92rem;
}
.client-hero-status i { font-size: .55rem; }

.client-detail-actions-card {
  background: linear-gradient(180deg, #fff 0%, #f8fbff 100%);
  border: 2px solid #dbeafe;
  border-radius: 18px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 8px 24px rgba(37, 99, 235, .08);
}

.client-info-card {
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
  width: 100%;
}
.client-info-card-fill {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.client-info-card-fill .client-info-card-body {
  flex: 1;
}
.client-info-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, #f8fafc 0%, #fff 100%);
  border-bottom: 1px solid #e2e8f0;
}
.client-info-card-header h5 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
}
.client-info-card-body { padding: 1.25rem; }
.client-info-card-sub {
  font-size: .82rem;
  color: #94a3b8;
  margin: -.25rem 0 1rem;
}

.client-info-row {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  padding: .85rem 0;
  border-bottom: 1px solid #f1f5f9;
}
.client-info-row:last-child { border-bottom: 0; padding-bottom: 0; }
.client-info-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 1rem;
  background: #eff6ff;
  color: #2563eb;
}
.client-info-icon-whatsapp { background: #dcfce7; color: #16a34a; }
.client-info-icon-email { background: #ede9fe; color: #7c3aed; }
.client-info-icon-address { background: #fee2e2; color: #dc2626; }
.client-info-icon-prof { background: #f1f5f9; color: #475569; }
.client-info-label {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #94a3b8;
  font-weight: 700;
  margin-bottom: .2rem;
}
.client-info-value {
  font-weight: 600;
  color: #1e293b;
  line-height: 1.45;
}
.client-info-value-text { font-weight: 500; }

.client-clinical-field {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 1rem 1rem 1rem 3.25rem;
  height: 100%;
  position: relative;
}
.client-clinical-icon {
  position: absolute;
  left: .85rem;
  top: .85rem;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #dbeafe;
  color: #2563eb;
  font-size: .95rem;
}
.client-clinical-icon-warn { background: #ffedd5; color: #c2410c; }
.client-clinical-field strong {
  display: block;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: #64748b;
  margin-bottom: .35rem;
}
.client-clinical-field p {
  color: #334155;
  line-height: 1.5;
  white-space: pre-wrap;
}

.client-appt-item {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .75rem;
  margin-bottom: .5rem;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.client-appt-item:last-child { margin-bottom: 0; }
.client-appt-item:hover {
  border-color: #93c5fd;
  box-shadow: 0 6px 18px rgba(37, 99, 235, .1);
  transform: translateY(-1px);
  color: inherit;
}
.client-appt-time {
  min-width: 52px;
  text-align: center;
  padding: .4rem .5rem;
  border-radius: 10px;
  background: #f8fafc;
}
.client-appt-time strong {
  display: block;
  font-size: .82rem;
  color: #64748b;
}
.client-appt-time span {
  display: block;
  font-size: 1rem;
  font-weight: 800;
  color: #1e293b;
  line-height: 1.2;
}
.client-appt-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  min-width: 0;
}
.client-appt-link {
  font-size: .78rem;
  font-weight: 600;
  color: #2563eb;
  white-space: nowrap;
}

.client-history-item {
  padding: .85rem 0;
  border-bottom: 1px solid #f1f5f9;
}
.client-history-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.client-history-date {
  font-weight: 700;
  color: #1e293b;
  font-size: .92rem;
  margin-bottom: .4rem;
}
.client-history-date i { color: #3b82f6; margin-right: .25rem; }
.client-history-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .65rem;
  font-size: .82rem;
  color: #64748b;
}
.client-history-metrics span {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  background: #f8fafc;
  border-radius: 999px;
  padding: .2rem .55rem;
}
.client-history-text {
  color: #475569;
  font-size: .88rem;
  line-height: 1.5;
}

.client-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  padding: 1.5rem 1rem;
  color: #94a3b8;
  text-align: center;
}
.client-empty-state i { font-size: 1.75rem; opacity: .65; }

.client-history-section {
  margin-top: 1.75rem;
  padding-top: .25rem;
  clear: both;
}
.client-history-note {
  display: flex;
  align-items: flex-start;
  gap: .25rem;
  margin-bottom: 1rem;
  padding: .85rem 1rem;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #64748b;
  font-size: .88rem;
  line-height: 1.5;
}
.client-history-note i {
  color: #3b82f6;
  margin-top: .15rem;
  flex-shrink: 0;
}

.info-block-editable {
  border: 1px solid #f1f5f9;
  transition: border-color .15s;
}
.info-block-editable:hover {
  border-color: #bfdbfe;
}

/* ── Avaliações ── */
.assessment-card { transition: transform .15s; }
.assessment-card:hover { transform: translateY(-2px); }
.metrics-row { display: flex; gap: .5rem; }
.metric-pill {
  flex: 1;
  background: #f8fafc;
  border-radius: 12px;
  padding: .6rem;
  text-align: center;
}
.metric-pill strong { display: block; font-size: 1.1rem; }
.metric-pill strong small { font-size: .65rem; font-weight: 400; }
.metric-label { font-size: .65rem; color: #94a3b8; text-transform: uppercase; }
.metric-danger { background: #fef2f2; }
.metric-danger strong { color: #dc2626; }
.metric-warning { background: #fffbeb; }
.metric-warning strong { color: #d97706; }
.metric-success { background: #f0fdf4; }
.metric-success strong { color: #16a34a; }
.mini-metric {
  background: #f8fafc;
  border-radius: 10px;
  padding: .75rem;
  text-align: center;
  font-size: .75rem;
  color: #64748b;
}
.mini-metric strong { display: block; font-size: 1.2rem; color: #1e293b; }

/* ── Exercício detail ── */
.exercise-hero-img {
  width: 100%;
  border-radius: 16px;
  aspect-ratio: 4/3;
  object-fit: cover;
}
.exercise-hero-placeholder {
  width: 100%;
  aspect-ratio: 4/3;
  border-radius: 16px;
  background: rgba(255,255,255,.1);
  display: grid;
  place-items: center;
  font-size: 4rem;
  opacity: .5;
}
.lead-text { font-size: 1rem; line-height: 1.7; color: #334155; }

/* ── Protocolo ── */
.protocol-exercise-card { border-left: 3px solid var(--primary); }
.exercise-order {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: .8rem;
  font-weight: 700;
  flex-shrink: 0;
}
.exercise-order-sm {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #475569;
  display: grid;
  place-items: center;
  font-size: .7rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* ── Plano semanal ── */
.plan-card { overflow: hidden; position: relative; }
.plan-card-header {
  height: 60px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1.5rem;
}
.weekday-dots { display: flex; gap: .35rem; flex-wrap: wrap; }
.weekday-dot {
  font-size: .65rem;
  padding: .2rem .5rem;
  border-radius: 6px;
  background: #e2e8f0;
  color: #475569;
  font-weight: 600;
}
.weekday-dot.wd-0, .weekday-dot.wd-1 { background: #dbeafe; color: #1d4ed8; }
.weekday-dot.wd-2, .weekday-dot.wd-3 { background: #dcfce7; color: #15803d; }
.weekday-dot.wd-4, .weekday-dot.wd-5 { background: #fef3c7; color: #b45309; }

.weekday-card {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  background: #fff;
}
.weekday-card-header {
  padding: 1rem 1.25rem;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.weekday-name { font-weight: 700; font-size: 1rem; }
.weekday-count { font-size: .75rem; opacity: .85; }
.weekday-card-body { padding: 1rem 1.25rem; }
.weekday-exercise {
  padding: .6rem 0;
  border-bottom: 1px solid #f1f5f9;
}
.weekday-exercise:last-child { border-bottom: 0; }
.weekday-0 .weekday-card-header { background: linear-gradient(135deg, #2563eb, #3b82f6); }
.weekday-1 .weekday-card-header { background: linear-gradient(135deg, #0891b2, #06b6d4); }
.weekday-2 .weekday-card-header { background: linear-gradient(135deg, #059669, #10b981); }
.weekday-3 .weekday-card-header { background: linear-gradient(135deg, #d97706, #f59e0b); }
.weekday-4 .weekday-card-header { background: linear-gradient(135deg, #7c3aed, #8b5cf6); }
.weekday-5 .weekday-card-header { background: linear-gradient(135deg, #db2777, #ec4899); }
.weekday-6 .weekday-card-header { background: linear-gradient(135deg, #64748b, #94a3b8); }

.weekday-edit-card {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  background: #fff;
}
.weekday-edit-header {
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.weekday-edit-body { padding: 1.25rem; }
.weekday-edit-disabled .weekday-edit-body { opacity: .45; pointer-events: none; }
.weekday-edit-card.weekday-0 .weekday-edit-header { background: linear-gradient(135deg, #2563eb, #3b82f6); }
.weekday-edit-card.weekday-1 .weekday-edit-header { background: linear-gradient(135deg, #0891b2, #06b6d4); }
.weekday-edit-card.weekday-2 .weekday-edit-header { background: linear-gradient(135deg, #059669, #10b981); }
.weekday-edit-card.weekday-3 .weekday-edit-header { background: linear-gradient(135deg, #d97706, #f59e0b); }
.weekday-edit-card.weekday-4 .weekday-edit-header { background: linear-gradient(135deg, #7c3aed, #8b5cf6); }
.weekday-edit-card.weekday-5 .weekday-edit-header { background: linear-gradient(135deg, #db2777, #ec4899); }
.weekday-edit-card.weekday-6 .weekday-edit-header { background: linear-gradient(135deg, #64748b, #94a3b8); }

.sticky-save-bar {
  position: sticky;
  bottom: 0;
  background: rgba(244, 247, 251, .95);
  padding: 1rem 0;
  margin-top: 1rem;
  border-top: 1px solid #e2e8f0;
  z-index: 10;
}

/* ── Diálogo de confirmação (custom — não usa Bootstrap modal) ── */
.app-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 1080;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(15, 23, 42, .52);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease;
}
.app-confirm-overlay.is-open {
  opacity: 1;
  visibility: visible;
}
.app-confirm-dialog {
  width: min(100%, 420px);
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .22);
  padding: 1.75rem 1.75rem 1.5rem;
  text-align: center;
  transform: translateY(12px) scale(.97);
  transition: transform .22s ease;
}
.app-confirm-overlay.is-open .app-confirm-dialog {
  transform: translateY(0) scale(1);
}
.app-confirm-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.65rem;
  color: #fff;
  background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
  box-shadow: 0 12px 28px rgba(220, 38, 38, .32);
}
.app-confirm-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: .45rem;
}
.app-confirm-message {
  color: #64748b;
  font-size: .95rem;
  margin-bottom: 1rem;
  line-height: 1.5;
}
.app-confirm-detail {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: .9rem 1rem;
  margin-bottom: 1rem;
  text-align: left;
}
.app-confirm-detail strong {
  display: block;
  color: #0f172a;
  font-size: 1rem;
  margin-bottom: .2rem;
}
.app-confirm-detail span {
  display: flex;
  align-items: center;
  gap: .4rem;
  color: #64748b;
  font-size: .88rem;
}
.app-confirm-warning {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 12px;
  padding: .7rem .85rem;
  margin-bottom: 1.25rem;
  text-align: left;
  font-size: .84rem;
  color: #b91c1c;
  line-height: 1.45;
}
.app-confirm-warning i { margin-top: .1rem; flex-shrink: 0; }
.app-confirm-actions {
  display: flex;
  gap: .65rem;
}
.app-confirm-actions .btn {
  flex: 1;
  padding: .7rem 1rem;
  font-weight: 600;
  border-radius: 12px;
}
.app-confirm-actions .btn-danger {
  background: linear-gradient(135deg, #dc2626, #ef4444);
  border: none;
  box-shadow: 0 8px 20px rgba(220, 38, 38, .28);
}
.app-confirm-actions .btn-danger:hover {
  background: linear-gradient(135deg, #b91c1c, #dc2626);
  box-shadow: 0 10px 24px rgba(220, 38, 38, .34);
}

/* ── Financeiro ── */
.finance-highlight {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  border-radius: 16px;
  color: #fff;
}
.finance-highlight > i { font-size: 2rem; opacity: .8; }
.finance-highlight span { display: block; font-size: .8rem; opacity: .85; }
.finance-highlight strong { display: block; font-size: 1.6rem; line-height: 1.2; }
.finance-highlight small { font-size: .75rem; opacity: .75; }
.finance-highlight-green { background: linear-gradient(135deg, #059669, #10b981); }
.finance-highlight-orange { background: linear-gradient(135deg, #d97706, #f59e0b); }
.finance-highlight-red { background: linear-gradient(135deg, #dc2626, #ef4444); }

.pricing-card {
  background: #fff;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--card-shadow);
  text-align: center;
  position: relative;
  height: 100%;
}
.pricing-card-featured {
  border: 2px solid var(--primary);
  transform: scale(1.02);
}
.pricing-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: #fff;
  font-size: .7rem;
  padding: .2rem .75rem;
  border-radius: 20px;
}
.pricing-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  margin: .5rem 0;
}
.pricing-value small { font-size: .9rem; font-weight: 400; color: #94a3b8; }

.card-header-custom {
  padding: 1rem 1.25rem;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.card-header-warning { background: linear-gradient(135deg, #d97706, #f59e0b); }
.card-header-danger { background: linear-gradient(135deg, #dc2626, #ef4444); }
.card-header-success { background: linear-gradient(135deg, #059669, #10b981); }

.payment-list { max-height: 320px; overflow-y: auto; }
.payment-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .85rem 1.25rem;
  border-bottom: 1px solid #f1f5f9;
}

/* ── Relatórios ── */
.export-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-radius: 16px;
  text-decoration: none;
  color: inherit;
  transition: transform .15s, box-shadow .15s;
  box-shadow: var(--card-shadow);
}
.export-card:hover { transform: translateY(-2px); box-shadow: 0 14px 40px rgba(15,23,42,.1); color: inherit; }
.export-card > i:first-child { font-size: 2rem; }
.export-card strong { display: block; }
.export-card span { font-size: .8rem; color: #64748b; }
.export-card-pdf { background: #fff; border-left: 4px solid #ef4444; }
.export-card-pdf > i:first-child { color: #ef4444; }
.export-card-excel { background: #fff; border-left: 4px solid #22c55e; }
.export-card-excel > i:first-child { color: #22c55e; }

.ranking-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .75rem 0;
  border-bottom: 1px solid #f1f5f9;
}
.ranking-position {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f1f5f9;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: .85rem;
  color: #64748b;
  flex-shrink: 0;
}
.ranking-bar {
  height: 6px;
  background: #f1f5f9;
  border-radius: 3px;
  margin-top: .35rem;
  overflow: hidden;
}
.ranking-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #22c55e);
  border-radius: 3px;
  min-width: 4px;
}
.ranking-count {
  font-size: .85rem;
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
}

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--card-shadow);
}
.empty-state > i { font-size: 3rem; color: #cbd5e1; display: block; margin-bottom: 1rem; }

.portal-access-login-box {
  padding: .85rem 1rem;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  word-break: break-all;
}

/* Login no celular: marca visível no topo do card */
@media (max-width: 991.98px) {
  .login-page {
    align-items: stretch !important;
    padding: max(1rem, env(safe-area-inset-top)) 0 max(1rem, env(safe-area-inset-bottom));
  }

  .login-page .page-wrap {
    width: 100%;
    max-width: 100%;
    padding-left: .85rem;
    padding-right: .85rem;
  }

  .login-card {
    border-radius: 20px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .14) !important;
  }

  .login-hero {
    padding: 1.75rem 1.25rem 1.5rem !important;
  }

  .login-page .col-lg-7 {
    padding: 1.35rem 1.25rem 1.5rem !important;
  }

  .login-page h3 {
    font-size: 1.25rem;
  }

  .login-page .btn-primary {
    min-height: 48px;
    font-size: 1.05rem;
    font-weight: 600;
  }
}

/* Celular: sidebar em gaveta, abre pelo botão do topo ou barra inferior */
@media (max-width: 767.98px) {
  #wrapper {
    display: block;
    width: 100%;
    max-width: 100%;
  }

  #page-content {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding-bottom: calc(4.5rem + env(safe-area-inset-bottom));
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
  }

  #sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    height: 100%;
    height: 100dvh;
    transform: translateX(-105%);
    width: min(var(--sidebar-width), 88vw) !important;
    z-index: 1060;
    box-shadow: 8px 0 32px rgba(15, 23, 42, .25);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  body.sidebar-open #sidebar {
    transform: translateX(0);
  }

  body.sidebar-open {
    overflow: hidden;
  }

  body.sidebar-open .sidebar-brand-text,
  body.sidebar-open .sidebar-label {
    opacity: 1 !important;
    width: auto !important;
    overflow: visible !important;
    pointer-events: auto !important;
  }

  body.sidebar-open .sidebar-brand {
    justify-content: flex-start !important;
    align-items: flex-start !important;
    gap: 12px !important;
  }

  body.sidebar-open .sidebar-nav .nav-link {
    justify-content: flex-start !important;
    gap: .75rem !important;
    padding-inline: 1rem !important;
    margin-inline: .5rem !important;
  }

  body.sidebar-open .sidebar-collapse-btn {
    display: inline-flex !important;
  }

  .app-sidebar-backdrop.is-visible {
    z-index: 1055;
  }

  .mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1045;
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    gap: .15rem;
    padding: .35rem .25rem calc(.35rem + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .97);
    backdrop-filter: blur(12px);
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -6px 24px rgba(15, 23, 42, .08);
  }

  .mobile-nav-item {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .15rem;
    padding: .35rem .15rem;
    border: 0;
    background: transparent;
    color: #64748b;
    text-decoration: none;
    font-size: .68rem;
    font-weight: 600;
    line-height: 1.1;
    border-radius: 10px;
  }

  .mobile-nav-item i {
    font-size: 1.15rem;
    line-height: 1;
  }

  .mobile-nav-item.active,
  .mobile-nav-item:active {
    color: var(--primary);
    background: rgba(13, 110, 253, .08);
  }

  .chart-box {
    height: auto;
    min-height: 0;
    overflow: visible;
    padding: .5rem 0 1rem;
    gap: 1.25rem !important;
  }

  .css-doughnut {
    width: min(176px, 62vw);
    height: min(176px, 62vw);
  }

  .css-doughnut-legend {
    width: 100%;
    max-width: 100%;
  }

  .css-doughnut-legend li {
    font-size: .88rem;
    flex-wrap: wrap;
  }

  .card-modern .card-body {
    overflow: visible;
  }
}

/* Tablet: sidebar recolhida por padrão (só ícones), expande ao tocar no menu */
@media (min-width: 768px) and (max-width: 1199.98px) {
  :root { --sidebar-width: 240px; }

  .sidebar-brand {
    padding-top: 1.25rem !important;
    padding-bottom: 1.25rem !important;
  }

  .sidebar-brand strong { font-size: .95rem; }
  .sidebar-brand small { font-size: .68rem; }

  .brand-icon {
    width: 38px;
    height: 38px;
    font-size: 1.15rem;
  }

  .sidebar-nav .nav-link {
    font-size: .88rem;
    padding: .6rem 1rem;
    margin-inline: .5rem;
  }
}

@media (max-width: 991.98px) {
  .pricing-card-featured { transform: none; }
}
