/* ==========================================================================
   Identidade visual baseada no layout do sistema.auraterapias.com.br
   Paleta: terracota (primária), verde profundo (secundária/sidebar), dourado (destaque)
   ========================================================================== */

:root {
  --brand-primary: #A65A3A;
  --brand-primary-dark: #8a4a2f;
  --brand-secondary: #1F4D3D;
  --brand-accent: #C9925E;
  --brand-sidebar: #14332A;
  --bg: #f1f5f9;

  /* aliases usados pelos componentes já existentes no HTML */
  --primary: var(--brand-primary);
  --primary-dark: var(--brand-primary-dark);
}

* { scrollbar-color: var(--brand-accent) transparent; }

body {
  background: var(--bg);
  font-family: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: #1e293b;
  -webkit-font-smoothing: antialiased;
}

a { transition: color .15s ease; }

/* Páginas públicas: texto não selecionável (ver assets/js/protecao.js), exceto em campos */
html.protegido body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
html.protegido input, html.protegido textarea, html.protegido select { -webkit-user-select: text; user-select: text; }
html.protegido img { -webkit-user-drag: none; pointer-events: auto; }

/* ---------- Marca do negócio (logotipo enviado ou selo padrão) ---------- */

.icon-badge {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--brand-accent) 25%, white);
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  margin: 0 auto .75rem;
  box-shadow: 0 8px 20px -6px color-mix(in srgb, var(--brand-primary) 45%, transparent);
}

.public-hero .icon-badge,
.aura-bg .icon-badge {
  background: color-mix(in srgb, var(--brand-accent) 25%, transparent);
  color: #fff;
}

.brand-logo {
  display: block;
  max-height: 64px;
  max-width: 240px;
  width: auto;
  object-fit: contain;
  margin: 0 auto .75rem;
}

.sidebar .brand-logo {
  max-height: 42px;
  max-width: 190px;
  margin: 0;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.3));
}

h1, h2, h3, h4, h5, h6,
.aura-title, .brand, .page-title {
  font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  font-weight: 600;
  letter-spacing: .01em;
  color: var(--brand-sidebar);
}

/* ---------- Sidebar (painel administrativo) ---------- */

.sidebar {
  width: 250px;
  min-width: 250px;
  max-width: 250px;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1030;
  overflow-y: auto;
  background: var(--brand-sidebar);
  background-image:
    radial-gradient(ellipse at 20% 0%, color-mix(in srgb, var(--brand-primary) 35%, transparent), transparent 55%),
    radial-gradient(ellipse at 100% 100%, color-mix(in srgb, var(--brand-accent) 22%, transparent), transparent 50%);
  color: #fff;
}

.sidebar .brand {
  font-weight: 600;
  font-size: 1.15rem;
  color: #fff;
}

.sidebar .nav-link {
  color: rgba(255,255,255,.80);
  border-radius: 10px;
  font-size: .92rem;
  font-weight: 500;
  padding: .55rem .8rem;
  transition: background .15s ease, color .15s ease, transform .15s ease;
  display: flex;
  align-items: center;
  gap: .55rem;
}

.sidebar .nav-link i { font-size: 1.05rem; width: 1.2rem; text-align: center; }

.sidebar .nav-link.active, .sidebar .nav-link:hover {
  background: color-mix(in srgb, var(--brand-primary) 55%, transparent);
  color: #fff;
  transform: translateX(2px);
}

/* Menu mobile: a sidebar vira um painel deslizante, aberto pelo botão hamburger */
.sidebar-toggle {
  display: none;
  align-items: center;
  gap: .5rem;
  background: var(--brand-sidebar);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: .5rem .9rem;
  font-weight: 600;
  font-size: .9rem;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .45);
  z-index: 1040;
}

@media (max-width: 991.98px) {
  .sidebar-toggle { display: inline-flex; }

  .sidebar {
    z-index: 1050;
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: none;
  }

  .sidebar.open { transform: translateX(0); box-shadow: 20px 0 40px rgba(0,0,0,.25); }

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

  /* !important: a regra base de .content-area (margem de 250px) vem mais abaixo no arquivo e venceria esta */
  .content-area { margin-left: 0 !important; padding-top: 1rem !important; }
}

/* ---------- Layout de menu "superior" (barra horizontal no topo) ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  min-height: 64px;
  padding-top: .5rem;
  padding-bottom: .5rem;
  background: var(--brand-sidebar);
  background-image:
    radial-gradient(ellipse at 20% 0%, color-mix(in srgb, var(--brand-primary) 35%, transparent), transparent 55%),
    radial-gradient(ellipse at 100% 100%, color-mix(in srgb, var(--brand-accent) 22%, transparent), transparent 50%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(0,0,0,.18);
}

.topbar .brand { font-weight: 600; font-size: 1.05rem; color: #fff; white-space: nowrap; }

.topbar-logo { max-height: 34px; max-width: 150px; margin: 0; }

.topbar .sidebar-toggle { background: transparent; border: none; padding: .4rem .5rem; }

.topbar-nav {
  overflow-x: auto;
  scrollbar-width: thin;
  flex-wrap: nowrap;
}

.topbar-nav .nav-link {
  color: rgba(255,255,255,.80);
  border-radius: 10px;
  font-size: .85rem;
  font-weight: 500;
  padding: .5rem .7rem;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: .4rem;
  transition: background .15s ease, color .15s ease;
}

.topbar-nav .nav-link i { font-size: 1rem; }

.topbar-nav .nav-link.active, .topbar-nav .nav-link:hover {
  background: color-mix(in srgb, var(--brand-primary) 55%, transparent);
  color: #fff;
}

.theme-toggle-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,.35);
  color: #fff;
  border-radius: 10px;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .15s ease;
}

.theme-toggle-btn:hover { background: rgba(255,255,255,.15); }

.sidebar-mobile-only { display: none; }

body.layout-superior .content-area { margin-left: 0; min-height: calc(100vh - 64px); }

@media (max-width: 991.98px) {
  body.layout-superior .topbar-nav { display: none; }
  body.layout-superior .sidebar-mobile-only { display: flex; }
}

/* ---------- Histórico do cliente (linha do tempo) ---------- */

.linha-tempo { position: relative; padding-left: 8px; }
.linha-tempo::before { content: ''; position: absolute; left: 21px; top: 6px; bottom: 6px; width: 2px; background: #e2e8f0; }
.linha-tempo-item { position: relative; display: flex; gap: .75rem; padding: .35rem 0; }
.linha-tempo-ponto {
  flex: 0 0 28px; width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: .8rem; z-index: 1;
}
[data-theme="dark"] .linha-tempo::before { background: #334155; }

/* ---------- Celular: barra inferior, toques maiores e telas mais compactas ---------- */

.bottom-nav { display: none; }

@media (max-width: 991.98px) {
  body { padding-bottom: 68px; }

  .bottom-nav {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 1035;
    background: var(--brand-sidebar);
    box-shadow: 0 -4px 14px rgba(0,0,0,.2);
    padding: .3rem .25rem calc(.3rem + env(safe-area-inset-bottom, 0px));
  }

  .bottom-nav a, .bottom-nav button {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: .35rem 0;
    color: rgba(255,255,255,.75);
    font-size: .68rem;
    background: none;
    border: none;
    text-decoration: none;
    border-radius: 10px;
  }

  .bottom-nav i { font-size: 1.25rem; line-height: 1; }
  .bottom-nav .ativo { color: #fff; background: color-mix(in srgb, var(--brand-primary) 55%, transparent); }

  .content-area { padding: .9rem !important; }
  .content-area h4 { font-size: 1.25rem; }
  .btn-sm { min-height: 36px; }
  .form-control, .form-select { min-height: 42px; }
  .agendamento-card, .lancamento-card { flex-wrap: wrap; }
  .card-rounded { padding: .85rem !important; }
  .cliente-acoes-rapidas { gap: 1rem; }
  #notifToastArea { top: .5rem !important; right: .5rem !important; }
}

/* ---------- Botões ---------- */

.btn, .btn-sm {
  border-radius: 10px;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .1s ease, box-shadow .15s ease;
}

.btn:active { transform: scale(.98); }

.btn-primary,
.btn-primary.active,
.btn-primary:active {
  background-color: var(--brand-primary) !important;
  border-color: var(--brand-primary) !important;
  font-weight: 700;
  box-shadow: 0 6px 16px -4px color-mix(in srgb, var(--brand-primary) 60%, transparent);
}
.btn-primary:hover, .btn-primary:focus {
  background-color: var(--brand-primary-dark) !important;
  border-color: var(--brand-primary-dark) !important;
}

.btn-outline-primary {
  color: var(--brand-primary);
  border-color: var(--brand-primary);
  font-weight: 700;
}
.btn-outline-primary:hover {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
}

.btn-success { background-color: var(--brand-secondary); border-color: var(--brand-secondary); }
.btn-success:hover { background-color: color-mix(in srgb, var(--brand-secondary) 85%, black); border-color: color-mix(in srgb, var(--brand-secondary) 85%, black); }

.slot-btn.active, .calendar-day.border-primary {
  box-shadow: 0 6px 16px -4px color-mix(in srgb, var(--brand-primary) 55%, transparent);
}

/* ---------- Formulários ---------- */

.form-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #475569;
}

.form-control, .form-select {
  border-radius: 10px;
  border-color: #cbd5e1;
}
.form-control:focus, .form-select:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--brand-primary) 25%, transparent);
}

/* ---------- Cards ---------- */

.content-area {
  min-height: 100vh;
  margin-left: 250px;
  width: 100%;
}

.card-stat {
  border: none;
  border-radius: 16px;
  box-shadow: 0 6px 18px rgba(20,51,42,.08);
  transition: transform .18s ease, box-shadow .18s ease;
}

.card-stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(20,51,42,.14);
}

.card-stat .icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  color: #fff;
}

.card-rounded {
  border-radius: 16px;
  border: none;
  box-shadow: 0 10px 30px rgba(20,51,42,.10);
}

/* ---------- Tabelas ---------- */

.table > tbody > tr {
  transition: background-color .12s ease;
}
.table-hover > tbody > tr:hover,
.table > tbody > tr:hover {
  background-color: color-mix(in srgb, var(--brand-accent) 8%, transparent);
}
.table thead th {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #64748b;
  border-bottom-width: 1px;
}

/* ---------- Etiquetas de status (estilo "aura-tag": pílula, texto em maiúsculas) ---------- */

.badge-status-confirmado,
.badge-status-cancelado,
.badge-status-concluido,
.badge-status-nao_compareceu {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .2rem .6rem;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  border: 1px solid transparent;
}

.badge-status-confirmado {
  background: color-mix(in srgb, var(--brand-primary) 12%, white);
  color: color-mix(in srgb, var(--brand-primary) 80%, black);
  border-color: color-mix(in srgb, var(--brand-primary) 30%, white);
}
.badge-status-cancelado {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fca5a5;
}
.badge-status-concluido {
  background: #f1f5f9;
  color: #475569;
  border-color: #e2e8f0;
}
.badge-status-nao_compareceu {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}

/* ---------- Agenda / calendário ---------- */

/* Calendário mensal: cada dia lista horário, cliente e serviço */
.calendar-day.cal-cell {
  min-height: 128px;
  min-width: 0;
  overflow: hidden;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cal-item {
  display: block;
  font-size: .72rem;
  line-height: 1.2;
  padding: 2px 5px;
  border-left: 3px solid var(--brand-primary);
  border-radius: 5px;
  background: color-mix(in srgb, var(--brand-accent) 14%, transparent);
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.cal-item:hover { background: color-mix(in srgb, var(--brand-primary) 18%, transparent); color: inherit; }
.cal-item-concluido { opacity: .6; }
.cal-hora { font-weight: 700; margin-right: 3px; }
.cal-nome { font-weight: 600; }
.cal-serv { display: block; opacity: .75; font-size: .66rem; overflow: hidden; text-overflow: ellipsis; }
.cal-mais { font-size: .68rem; color: var(--brand-primary); font-weight: 700; }

@media (max-width: 575.98px) {
  .calendar-day.cal-cell { min-height: 84px; padding: 3px; }
  .cal-serv { display: none; }
}

.calendar-day.cal-selecionado { border-color: var(--brand-primary); border-width: 2px; box-shadow: 0 6px 14px rgba(20,51,42,.15); }

/* Calendário deitado: uma linha por dia */
.cal-linha {
  display: flex;
  align-items: stretch;
  gap: .75rem;
  padding: .5rem .75rem;
  margin-bottom: 4px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.cal-linha:hover { border-color: var(--brand-primary); }
.cal-linha.cal-selecionado { border-color: var(--brand-primary); border-width: 2px; }
.cal-linha-hoje { background: color-mix(in srgb, var(--brand-primary) 8%, #fff); }
.cal-linha-fechado { background: #fee2e2; }
.cal-linha-dia { width: 44px; flex-shrink: 0; text-align: center; }
.cal-linha-num { font-size: 1.2rem; font-weight: 700; line-height: 1; }
.cal-linha-dow { font-size: .7rem; text-transform: uppercase; color: #64748b; }
.cal-linha-itens { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-width: 0; }
.cal-chip {
  font-size: .75rem;
  padding: 2px 8px;
  border-left: 3px solid var(--brand-primary);
  border-radius: 6px;
  background: color-mix(in srgb, var(--brand-accent) 14%, transparent);
}

/* Painel expandido com as informações do dia */
.cal-expandido {
  border: 2px solid var(--brand-primary);
  border-radius: 12px;
  padding: 1rem;
  margin: 6px 0 10px;
  background: #fff;
}
.cal-exp-item {
  border-left: 4px solid var(--brand-primary);
  border-radius: 8px;
  padding: .4rem .7rem;
  margin-bottom: .4rem;
  background: color-mix(in srgb, var(--brand-accent) 8%, transparent);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.calendar-day {
  min-height: 90px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #e5e7eb;
  padding: 6px;
  cursor: pointer;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}

.calendar-day:hover {
  border-color: var(--brand-primary);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(20,51,42,.10);
}

.calendar-day.blocked {
  background: #fee2e2;
}

.calendar-day.today {
  border-color: var(--brand-primary);
  border-width: 2px;
}

.slot-btn {
  min-width: 76px;
  border-radius: 10px;
  transition: all .15s ease;
}

.slot-btn:hover { transform: translateY(-1px); }

/* ---------- Agenda / visão semanal (grade por horário) ---------- */

.week-grid-wrap {
  overflow-x: auto;
}

.week-grid {
  display: grid;
  min-width: 760px;
}

.week-corner {
  border-bottom: 1px solid #e5e7eb;
}

.week-day-header {
  text-align: center;
  padding: .5rem .25rem;
  border-bottom: 1px solid #e5e7eb;
  border-left: 1px solid #f1f5f9;
  color: #1e293b;
  transition: background-color .12s ease;
}

.week-day-header:hover { background: color-mix(in srgb, var(--brand-accent) 10%, transparent); }

.week-day-header.today { color: var(--brand-primary); }

.week-day-header.selected {
  background: color-mix(in srgb, var(--brand-primary) 10%, transparent);
  border-radius: 10px 10px 0 0;
}

.week-hours {
  position: relative;
  border-right: 1px solid #e5e7eb;
}

.week-hour-label {
  font-size: .7rem;
  color: #94a3b8;
  text-align: right;
  padding-right: .4rem;
  transform: translateY(-7px);
}

.week-day-col {
  position: relative;
  border-left: 1px solid #f1f5f9;
}

.week-hour-line {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px solid #f1f5f9;
}

.week-now-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 0;
  border-top: 2px solid #dc2626;
  z-index: 5;
}

.week-now-line::before {
  content: '';
  position: absolute;
  left: -4px;
  top: -4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #dc2626;
}

.week-event {
  position: absolute;
  left: 3px;
  right: 3px;
  overflow: hidden;
  border-radius: 6px;
  border-left: 4px solid var(--brand-primary);
  padding: .2rem .4rem;
  font-size: .74rem;
  line-height: 1.15;
  color: #1e293b;
  box-shadow: 0 2px 6px rgba(20,51,42,.10);
  transition: transform .12s ease, box-shadow .12s ease, z-index .12s ease;
}

.week-event:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(20,51,42,.18);
  z-index: 10;
  color: #1e293b;
}

.week-event-concluido { opacity: .65; }

.week-event-off {
  background: repeating-linear-gradient(
    45deg,
    #e2e8f0,
    #e2e8f0 8px,
    #eef2f6 8px,
    #eef2f6 16px
  );
  border-left: 4px solid #94a3b8;
  color: #64748b;
  font-size: .72rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* ---------- Financeiro (lançamentos em lista) ---------- */

.btn-fab-inline {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  padding: 0;
}

.lancamento-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: #fff;
  border-radius: 12px;
  border-left: 4px solid transparent;
  box-shadow: 0 3px 10px rgba(20,51,42,.06);
  padding: .75rem 1rem;
  margin-bottom: .5rem;
  transition: box-shadow .15s ease, transform .15s ease;
}

.lancamento-card:hover {
  box-shadow: 0 6px 16px rgba(20,51,42,.12);
  transform: translateY(-1px);
}

.lancamento-receita { border-left-color: #16a34a; }
.lancamento-despesa { border-left-color: #dc2626; }

/* ---------- Clientes (lista + detalhe) ---------- */

.clientes-layout {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.clientes-lista {
  width: 360px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 140px);
}

.clientes-scroll {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding-right: .25rem;
}

.clientes-detalhe {
  flex-grow: 1;
  min-height: calc(100vh - 140px);
}

.cliente-card {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem .7rem;
  border-radius: 12px;
  border: 1px solid #eef2f6;
  color: #1e293b;
  transition: background-color .12s ease, border-color .12s ease;
}

.cliente-card:hover {
  background: color-mix(in srgb, var(--brand-accent) 8%, transparent);
  border-color: color-mix(in srgb, var(--brand-accent) 30%, transparent);
}

.cliente-card.active {
  background: color-mix(in srgb, var(--brand-primary) 10%, transparent);
  border-color: var(--brand-primary);
}

.cliente-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--brand-secondary) 12%, white);
  color: var(--brand-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .85rem;
  flex-shrink: 0;
}

.cliente-avatar-lg {
  width: 64px;
  height: 64px;
  font-size: 1.3rem;
}

@media (max-width: 991.98px) {
  .clientes-layout { flex-direction: column; }
  .clientes-lista, .clientes-detalhe { width: 100%; max-height: none; min-height: 0; }
}

.cliente-acoes-rapidas {
  display: flex;
  justify-content: center;
  gap: 1.75rem;
}

.acao-rapida {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  color: #1e293b;
  text-decoration: none;
}

.acao-rapida-icone {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  color: var(--brand-primary);
  transition: all .15s ease;
  box-shadow: 0 3px 8px rgba(20,51,42,.06);
}

.acao-rapida:hover .acao-rapida-icone {
  background: var(--brand-primary);
  color: #fff;
  border-color: var(--brand-primary);
  transform: translateY(-2px);
}

.acao-rapida.disabled {
  opacity: .4;
  pointer-events: none;
}

.cliente-tabs .nav-link {
  border: none;
  border-bottom: 2px solid transparent;
  color: #64748b;
  font-weight: 600;
  padding: .5rem .25rem;
  margin-right: 1.25rem;
  border-radius: 0;
}

.cliente-tabs .nav-link.active {
  color: var(--brand-primary);
  border-bottom-color: var(--brand-primary);
  background: none;
}

.nav-pills.nav-sm .nav-link {
  font-size: .82rem;
  padding: .3rem .7rem;
  color: #475569;
}

.nav-pills.nav-sm .nav-link.active {
  background: var(--brand-primary);
}

.agendamento-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: #fff;
  border: 1px solid #eef2f6;
  border-left: 4px solid var(--brand-primary);
  border-radius: 12px;
  padding: .75rem 1rem;
  margin-bottom: .5rem;
}

.agendamento-card.status-cancelado { border-left-color: #dc2626; opacity: .75; }
.agendamento-card.status-concluido { border-left-color: #94a3b8; }

/* ---------- Telas públicas (login, instalador, agendamento) ---------- */

.aura-bg {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: var(--brand-sidebar);
  background-image:
    radial-gradient(ellipse at 20% 0%, color-mix(in srgb, var(--brand-primary) 35%, transparent), transparent 55%),
    radial-gradient(ellipse at 100% 100%, color-mix(in srgb, var(--brand-accent) 22%, transparent), transparent 50%);
}

.aura-card {
  background: #fff;
  max-width: 440px;
  width: 100%;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,.35);
  overflow: hidden;
}

.aura-card-header {
  padding: 1.5rem;
  text-align: center;
  border-bottom: 1px solid #f1f5f9;
}

.aura-card-header .icon-badge {
  background: color-mix(in srgb, var(--brand-primary) 12%, white);
  color: var(--brand-primary);
  box-shadow: none;
}

.public-hero {
  background: var(--brand-sidebar);
  background-image:
    radial-gradient(ellipse at 20% 0%, color-mix(in srgb, var(--brand-primary) 35%, transparent), transparent 55%),
    radial-gradient(ellipse at 100% 100%, color-mix(in srgb, var(--brand-accent) 22%, transparent), transparent 50%);
  color: #fff;
  border-radius: 0 0 28px 28px;
  box-shadow: 0 12px 30px -10px rgba(0,0,0,.35);
}

.public-hero .aura-title { color: #fff; }

/* ---------- Entrada suave dos cartões (mais "fluido") ---------- */

@keyframes aura-fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.card-rounded, .card-stat, .aura-card {
  animation: aura-fade-up .35s ease both;
}

@media (prefers-reduced-motion: reduce) {
  .card-rounded, .card-stat, .aura-card,
  .calendar-day, .slot-btn, .btn, .sidebar .nav-link {
    animation: none !important;
    transition: none !important;
  }
}

/* ==========================================================================
   Modo escuro — ativado via [data-theme="dark"] no <html> (painel admin)
   ========================================================================== */

:root[data-theme="dark"] {
  --bg: #0f172a;
}

[data-theme="dark"] body { color: #e2e8f0; }

[data-theme="dark"] h1, [data-theme="dark"] h2, [data-theme="dark"] h3,
[data-theme="dark"] h4, [data-theme="dark"] h5, [data-theme="dark"] h6,
[data-theme="dark"] .aura-title, [data-theme="dark"] .page-title,
[data-theme="dark"] .brand { color: #f1f5f9; }

[data-theme="dark"] .card,
[data-theme="dark"] .card-rounded,
[data-theme="dark"] .card-stat,
[data-theme="dark"] .modal-content,
[data-theme="dark"] .dropdown-menu,
[data-theme="dark"] .list-group-item,
[data-theme="dark"] .lancamento-card,
[data-theme="dark"] .cliente-card,
[data-theme="dark"] .agendamento-card,
[data-theme="dark"] .calendar-day,
[data-theme="dark"] .acao-rapida-icone,
[data-theme="dark"] .offcanvas {
  background-color: #1e293b;
  color: #e2e8f0;
  border-color: #334155;
}

[data-theme="dark"] .cliente-card:hover { background-color: #24324a; }
[data-theme="dark"] .acao-rapida { color: #e2e8f0; }

[data-theme="dark"] .calendar-day.blocked { background-color: #3f1d1d; }
[data-theme="dark"] .cal-linha,
[data-theme="dark"] .cal-expandido { background-color: #1e293b; border-color: #334155; color: #e2e8f0; }
[data-theme="dark"] .cal-linha-hoje { background-color: #24324a; }
[data-theme="dark"] .cal-linha-fechado { background-color: #3f1d1d; }
[data-theme="dark"] .cal-linha.cal-selecionado,
[data-theme="dark"] .cal-expandido { border-color: var(--brand-primary); }

[data-theme="dark"] .week-event { color: #e2e8f0; }
[data-theme="dark"] .week-event-off {
  background: repeating-linear-gradient(45deg, #1e293b, #1e293b 8px, #24324a 8px, #24324a 16px);
  border-left-color: #475569;
  color: #94a3b8;
}
[data-theme="dark"] .week-corner,
[data-theme="dark"] .week-day-header,
[data-theme="dark"] .week-hours,
[data-theme="dark"] .week-day-col,
[data-theme="dark"] .week-hour-line { border-color: #334155; color: #e2e8f0; }
[data-theme="dark"] .week-hour-label { color: #64748b; }

[data-theme="dark"] .table {
  --bs-table-bg: transparent;
  --bs-table-color: #e2e8f0;
  --bs-table-striped-bg: #24324a;
  --bs-table-hover-bg: #24324a;
  --bs-table-border-color: #334155;
  color: #e2e8f0;
}
[data-theme="dark"] .table thead th { color: #94a3b8; }

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
  background-color: #0f172a;
  border-color: #334155;
  color: #e2e8f0;
}
[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
  background-color: #0f172a;
  color: #e2e8f0;
}
[data-theme="dark"] .form-control::placeholder { color: #64748b; }
[data-theme="dark"] .form-control:disabled,
[data-theme="dark"] .form-select:disabled { background-color: #1e293b; color: #64748b; }
[data-theme="dark"] .form-label { color: #94a3b8; }
[data-theme="dark"] .input-group-text { background-color: #1e293b; border-color: #334155; color: #e2e8f0; }

[data-theme="dark"] .text-muted { color: #94a3b8 !important; }
[data-theme="dark"] .border, [data-theme="dark"] .border-top,
[data-theme="dark"] .border-bottom { border-color: #334155 !important; }
[data-theme="dark"] .bg-light { background-color: #1e293b !important; color: #e2e8f0; }

[data-theme="dark"] .badge-status-concluido {
  background: #334155;
  color: #cbd5e1;
  border-color: #475569;
}

[data-theme="dark"] .cliente-tabs .nav-link { color: #94a3b8; }
[data-theme="dark"] .nav-pills.nav-sm .nav-link { color: #94a3b8; }

[data-theme="dark"] .dropdown-item { color: #e2e8f0; }
[data-theme="dark"] .dropdown-item:hover,
[data-theme="dark"] .dropdown-item:focus { background-color: #24324a; color: #f1f5f9; }

[data-theme="dark"] hr { border-color: #334155; opacity: 1; }

/* Arrastar e soltar na visão semanal */
.week-arrastavel { cursor: grab; }
.week-arrastavel.arrastando { opacity: .45; }
.week-day-col.alvo-soltar { background: rgba(166, 90, 58, .10); outline: 2px dashed var(--cor-primaria, #A65A3A); outline-offset: -2px; }
.week-fantasma { position: absolute; left: 2px; right: 2px; border: 2px dashed var(--cor-primaria, #A65A3A); background: rgba(166, 90, 58, .18); border-radius: 6px; pointer-events: none; z-index: 5; font-size: .72rem; padding: 1px 4px; }

/* Mapa de dor (anamnese) */
.mapa-corpo { position: relative; max-width: 300px; margin: 0 auto; cursor: crosshair; user-select: none; }
.mapa-corpo svg { width: 100%; height: 100%; display: block; }
.mc-forma { fill: #f6ebe2; stroke: #b08968; stroke-width: 1.5; }
.mc-detalhe { fill: none; stroke: #c9a98c; stroke-width: 1.2; }
.mc-rotulo { fill: #b08968; font: 600 9px system-ui, sans-serif; letter-spacing: .1em; }
[data-theme="dark"] .mc-forma { fill: #3a332e; stroke: #8a7360; }
[data-theme="dark"] .mc-detalhe { stroke: #6b5a4a; }
/* Estilos de boneco (Configuração > Modelos): Silhueta e Manequim. As cores saem destas variáveis. */
.bs { --bs-fill: #f0d9c8; --bs-linha: #b78767; --bs-junta: #d6b693; --bs-det: #c99f80; }
.bs-man { --bs-fill: #eddac7; --bs-linha: #9a7452; --bs-junta: #d6b693; --bs-det: #b8946f; }
[data-theme="dark"] .bs { --bs-fill: #4a3d35; --bs-linha: #8a7360; --bs-junta: #5d4a3a; --bs-det: #6b5a4a; }
.bs-le { fill: var(--bs-linha); stroke: none; } .bs-fe { fill: var(--bs-fill); stroke: none; } .bs-je { fill: var(--bs-junta); stroke: none; }
.bs-lf { fill: var(--bs-linha); stroke: var(--bs-linha); } .bs-ff { fill: var(--bs-fill); stroke: var(--bs-fill); } .bs-jf { fill: var(--bs-junta); stroke: var(--bs-junta); }
.bs-ls { fill: none; stroke: var(--bs-linha); } .bs-fs { fill: none; stroke: var(--bs-fill); } .bs-js { fill: none; stroke: var(--bs-junta); }
.bs-det { fill: none; stroke: var(--bs-det); stroke-width: 1.3; stroke-linecap: round; }
.bs-pt { fill: var(--bs-det); stroke: none; }
.bs-marca { fill: none; stroke: var(--bs-linha); stroke-width: 3; stroke-linecap: round; }
/* Estilo Regiões: áreas nomeadas que acendem ao passar o mouse */
.reg { fill: transparent; stroke: #a67c5b; stroke-opacity: .32; stroke-width: .9; stroke-dasharray: 3 3; transition: fill .12s; }
.reg:hover { fill: color-mix(in srgb, var(--cor-primaria, #A65A3A) 30%, transparent); stroke-opacity: .9; }
.reg-o { stroke-opacity: 0; }
.reg-o:hover { stroke-opacity: .6; }
.reg-l { fill: none; stroke: transparent; stroke-width: 22; stroke-linecap: round; pointer-events: stroke; transition: stroke .12s; }
.reg-l:hover { stroke: color-mix(in srgb, var(--cor-primaria, #A65A3A) 30%, transparent); }
.mapa-pin { position: absolute; transform: translate(-50%, -50%); width: 26px; height: 26px; padding: 0; border-radius: 50%; border: 2px solid #fff; color: #fff; font: 700 12px/1 system-ui, sans-serif; box-shadow: 0 2px 6px rgba(0,0,0,.35); cursor: pointer; }
.mapa-pin:hover { transform: translate(-50%, -50%) scale(1.15); }
.mapa-item { display: flex; align-items: flex-start; gap: .6rem; padding: .45rem 0; border-bottom: 1px solid var(--bs-border-color, #e2e8f0); }
.mapa-num { flex: 0 0 22px; height: 22px; border-radius: 50%; color: #fff; font: 700 11px/22px system-ui, sans-serif; text-align: center; }
@media print { .mapa-corpo { max-width: 220px; } }

/* Mapa de dor: sessões e comparativo */
.mapa-pin-ok { font-size: 13px; }
.mapa-mini-faixa { display: flex; gap: .75rem; overflow-x: auto; padding-bottom: .5rem; }
.mapa-mini-item { flex: 0 0 auto; width: 96px; cursor: pointer; }
.mapa-mini-item:hover .mapa-mini { outline: 2px solid var(--cor-primaria, #A65A3A); }
.mapa-mini { position: relative; width: 100%; border-radius: 8px; }
.mapa-mini svg { width: 100%; height: 100%; display: block; }
.mapa-pin-mini { position: absolute; transform: translate(-50%, -50%); min-width: 16px; height: 16px; padding: 0 3px; border-radius: 8px; border: 1.5px solid #fff; color: #fff; font: 700 9px/13px system-ui, sans-serif; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.comp-linha { padding: .6rem 0; border-bottom: 1px solid var(--bs-border-color, #e2e8f0); }
.comp-serie { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; margin-top: .35rem; }
.comp-chip { border: 2px solid; border-radius: 999px; padding: .1rem .55rem; font-size: .8rem; white-space: nowrap; }
.comp-seta { color: #94a3b8; }
