/* ==========================================================================
   BARBEARIA MELO — Painel Administrativo
   Design system inspirado em Notion / Vercel: neutro, denso, com um
   acento azul-marinho que remete a marca. Suporta tema claro e escuro.
   ========================================================================== */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --gold: #3e63a0;
  --gold-strong: #2c4872;
  --gold-soft: rgba(62, 99, 160, 0.12);
  --on-gold: #fff; /* texto sobre fundo --gold (botao principal, chips selecionados) */

  /* Cores dos graficos de tendencia (ver .trend-line/.trend-dot em
     admin/js/pages/financeiro.js e barbeiros.js) - separadas de --gold/--success
     porque o tom escuro deles falha a checagem de saturacao minima da skill de
     dataviz (scripts/validate_palette.js) quando usado como marca fina de
     linha/ponto; o tema claro reaproveita --gold/--success sem alteracao.
     --chart-expense validado nos dois modos com o MESMO hex (scripts/validate_palette.js
     "#3e63a0,#16a34a,#a3540a" --mode light / "#5b8fe0,#1fae56,#a3540a" --mode dark
     --surface "#101012") - ao contrario dos outros dois, nao precisa de um tom
     separado pro escuro. */
  --chart-revenue: var(--gold);
  --chart-profit: var(--success);
  --chart-expense: #a3540a;

  --bg: #f6f6f7;
  --surface: #ffffff;
  --surface-2: #fbfbfc;
  --surface-hover: #f0f0f2;
  --border: #e4e4e7;
  --border-strong: #d4d4d8;
  --text: #18181b;
  --text-muted: #6b7280;
  --text-faint: #a1a1aa;

  --success: #16a34a;
  --success-soft: rgba(22, 163, 74, 0.12);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.1);
  --warning: #d97706;
  --warning-soft: rgba(217, 119, 6, 0.12);
  --info: #2563eb;
  --info-soft: rgba(37, 99, 235, 0.1);
  --violet: #7c3aed;
  --violet-soft: rgba(124, 58, 237, 0.1);
  --teal: #0d9488;
  --teal-soft: rgba(13, 148, 136, 0.1);
  --on-status-solid: #ffffff;
  --neutral-soft-2: rgba(107, 114, 128, 0.3);
  --success-soft-2: rgba(22, 163, 74, 0.34);
  --warning-soft-2: rgba(217, 119, 6, 0.34);
  --info-soft-2: rgba(37, 99, 235, 0.32);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.18);

  --sidebar-w: 260px;
  --topbar-h: 64px;
  --transition: 0.18s ease;

  color-scheme: light;
}

:root[data-theme="dark"] {
  --gold: #6d97d1;
  --gold-strong: #93b6e3;
  --gold-soft: rgba(109, 151, 209, 0.14);
  --chart-revenue: #5b8fe0;
  --chart-profit: #1fae56;

  --bg: #101012;
  --surface: #18181b;
  --surface-2: #1c1c1f;
  --surface-hover: #232327;
  --border: #2a2a2e;
  --border-strong: #38383e;
  --text: #f4f4f5;
  --text-muted: #a1a1aa;
  --text-faint: #6b7280;

  --success: #22c55e;
  --success-soft: rgba(34, 197, 94, 0.14);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.14);
  --warning: #fbbf24;
  --warning-soft: rgba(251, 191, 36, 0.14);
  --info: #60a5fa;
  --info-soft: rgba(96, 165, 250, 0.14);
  --violet: #a78bfa;
  --violet-soft: rgba(167, 139, 250, 0.16);
  --teal: #2dd4bf;
  --teal-soft: rgba(45, 212, 191, 0.14);
  --on-status-solid: #101012;
  --neutral-soft-2: rgba(161, 161, 170, 0.2);
  --success-soft-2: rgba(34, 197, 94, 0.22);
  --warning-soft-2: rgba(251, 191, 36, 0.22);
  --info-soft-2: rgba(96, 165, 250, 0.22);

  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.55);

  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --gold: #6d97d1;
    --gold-strong: #93b6e3;
    --gold-soft: rgba(109, 151, 209, 0.14);
    --chart-revenue: #5b8fe0;
    --chart-profit: #1fae56;
    --bg: #101012;
    --surface: #18181b;
    --surface-2: #1c1c1f;
    --surface-hover: #232327;
    --border: #2a2a2e;
    --border-strong: #38383e;
    --text: #f4f4f5;
    --text-muted: #a1a1aa;
    --text-faint: #6b7280;
    --success: #22c55e;
    --success-soft: rgba(34, 197, 94, 0.14);
    --danger: #f87171;
    --danger-soft: rgba(248, 113, 113, 0.14);
    --warning: #fbbf24;
    --warning-soft: rgba(251, 191, 36, 0.14);
    --info: #60a5fa;
    --info-soft: rgba(96, 165, 250, 0.14);
    --violet: #a78bfa;
    --violet-soft: rgba(167, 139, 250, 0.16);
    --teal: #2dd4bf;
    --teal-soft: rgba(45, 212, 191, 0.14);
    --on-status-solid: #101012;
    --neutral-soft-2: rgba(161, 161, 170, 0.2);
    --success-soft-2: rgba(34, 197, 94, 0.22);
    --warning-soft-2: rgba(251, 191, 36, 0.22);
    --info-soft-2: rgba(96, 165, 250, 0.22);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.55);
    color-scheme: dark;
  }
}

html, body {
  height: 100%;
  overflow-x: hidden;
}

html { touch-action: pan-x pan-y; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  transition: background var(--transition), color var(--transition);
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
img { max-width: 100%; display: block; }

/* iOS da zoom automatico ao focar campo com font-size < 16px - sobrescreve
   os varios font-size menores usados nos componentes (filtros, formularios
   de modal, login etc.) so' pra telas de celular. */
@media (max-width: 640px) {
  input, select, textarea { font-size: 16px !important; }
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- Layout geral ---------- */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 200;
  transition: transform var(--transition);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand .logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.sidebar-brand .logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-brand span {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.2px;
}

.sidebar-brand small {
  display: block;
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.72rem;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
}

.sidebar-section-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-faint);
  padding: 14px 10px 6px;
  font-weight: 600;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.87rem;
  font-weight: 500;
  margin-bottom: 2px;
  transition: background var(--transition), color var(--transition);
}

.sidebar-link i { width: 18px; text-align: center; font-size: 0.95rem; }

.sidebar-link:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.sidebar-link.active {
  background: var(--gold-soft);
  color: var(--gold-strong);
  font-weight: 600;
}

.sidebar-footer {
  padding: 14px 20px 20px;
  border-top: 1px solid var(--border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

/* Icones customizados de servico (mesmas ilustracoes do site publico),
   usados como mascara CSS para herdar a cor do avatar (currentColor). */
.avatar-icon-img {
  width: 62%;
  height: 62%;
  display: block;
  background-color: currentColor;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}
.avatar-icon-img.avatar-icon-barba { -webkit-mask-image: url('/img/icons/barba.png'); mask-image: url('/img/icons/barba.png'); }
.avatar-icon-img.avatar-icon-sobrancelha { width: 72%; height: 72%; -webkit-mask-image: url('/img/icons/sobrancelha.svg'); mask-image: url('/img/icons/sobrancelha.svg'); }
.avatar-icon-img.avatar-icon-nariz { width: 54%; height: 54%; -webkit-mask-image: url('/img/icons/nariz.svg'); mask-image: url('/img/icons/nariz.svg'); }
.avatar-icon-img.avatar-icon-cabelo { width: 64%; height: 64%; -webkit-mask-image: url('/img/icons/cabelo.png'); mask-image: url('/img/icons/cabelo.png'); }
.avatar-icon-img.avatar-icon-combo { width: 58%; height: 58%; -webkit-mask-image: url('/img/icons/combo.svg'); mask-image: url('/img/icons/combo.svg'); }
.avatar-icon-img.avatar-icon-cabelo-sobrancelha { width: 70%; height: 70%; -webkit-mask-image: url('/img/icons/cabelo-sobrancelha.png'); mask-image: url('/img/icons/cabelo-sobrancelha.png'); }
.avatar-icon-img.avatar-icon-combo-sobrancelha { width: 58%; height: 58%; -webkit-mask-image: url('/img/icons/cabelo-barba-sobrancelha.png'); mask-image: url('/img/icons/cabelo-barba-sobrancelha.png'); }

/* Grafico de tendencia (area + linha) usado no perfil do barbeiro e no
   faturamento x lucro do Financeiro - ver renderProfileTrend/renderTrend em
   admin/js/pages/financeiro.js e barbeiros.js. Mark specs seguem a skill de
   dataviz: linha 2px, area a ~10% de opacidade, pontos com anel na cor da
   superficie, gridlines finas e recessivas. .expense/.profit sao a 2a/3a serie
   (despesas/lucro liquido) do grafico de ate 3 series - cor separada de
   .trend-line/.trend-dot (a serie "faturamento", sem classe extra). */
.trend-chart-wrap { position: relative; }
.trend-svg { width: 100%; height: auto; display: block; overflow: visible; }
.trend-gridline { stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.trend-gridline.zero { stroke: var(--border-strong); }
/* Contorno na cor do card: o valor do eixo fica legivel mesmo com a linha passando atras */
.trend-tick { font-size: 11px; fill: var(--text-faint); stroke: var(--surface); stroke-width: 3px; paint-order: stroke; stroke-linejoin: round; }
.trend-area { fill: var(--chart-revenue); opacity: 0.12; }
.trend-line { fill: none; stroke: var(--chart-revenue); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.trend-line.expense { stroke: var(--chart-expense); }
.trend-line.profit { stroke: var(--chart-profit); }
.trend-dot { fill: var(--chart-revenue); stroke: var(--surface); stroke-width: 2; transition: r var(--transition); vector-effect: non-scaling-stroke; }
.trend-dot.expense { fill: var(--chart-expense); }
.trend-dot.profit { fill: var(--chart-profit); }
.trend-dot.active { r: 6; }
.trend-svg.dense .trend-dot:not(.active) { opacity: 0; }
.trend-xlabel { font-size: 11px; fill: var(--text-muted); }
.trend-endlabel { font-size: 11px; font-weight: 700; fill: var(--text); }
.trend-crosshair { stroke: var(--border-strong); stroke-width: 1; opacity: 0; pointer-events: none; vector-effect: non-scaling-stroke; }
.trend-legend { display: flex; gap: 16px; margin-bottom: 10px; flex-wrap: wrap; }
.trend-legend-item { display: flex; align-items: center; gap: 6px; font-size: 0.76rem; color: var(--text-muted); }
.trend-legend-swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; background: var(--chart-revenue); }
.trend-legend-swatch.expense { background: var(--chart-expense); }
.trend-legend-swatch.profit { background: var(--chart-profit); }
.trend-tooltip-row { display: flex; align-items: center; gap: 6px; }
.trend-tooltip-key { width: 12px; height: 2px; border-radius: 1px; background: var(--chart-revenue); flex-shrink: 0; }
.trend-tooltip-key.expense { background: var(--chart-expense); }
.trend-tooltip-key.profit { background: var(--chart-profit); }
.trend-tooltip {
  position: absolute;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 10px));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  box-shadow: var(--shadow-md);
  display: none;
  white-space: nowrap;
  z-index: 5;
}
.trend-tooltip-month { color: var(--text-muted); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.3px; }
.trend-tooltip-value { font-weight: 700; font-size: 0.86rem; color: var(--text); }
.trend-tooltip-sub { color: var(--text-muted); font-size: 0.7rem; }
.profile-trend-title.with-delta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.profile-trend-title.with-delta .stat-delta { margin-top: 0; }

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--gold-soft);
  color: var(--gold-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.sidebar-user-info { overflow: hidden; }
.sidebar-user-info strong { display: block; font-size: 0.82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-info span { font-size: 0.72rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }

.btn-back-site,
.btn-logout {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  transition: var(--transition);
}
.btn-back-site { margin-bottom: 8px; }
.btn-back-site:hover { background: var(--gold-soft); color: var(--gold-strong); border-color: transparent; }
.btn-logout:hover { background: var(--danger-soft); color: var(--danger); border-color: transparent; }

/* "Entrar como barbeiro" (ver openLoginAsBarber em js/shell.js) */
.login-as-hint { margin: 0 0 12px; font-size: 0.82rem; color: var(--text-muted); }
.login-as-empty { margin: 0; font-size: 0.85rem; color: var(--text-muted); text-align: center; padding: 12px 0; }
.login-as-list { display: flex; flex-direction: column; gap: 8px; }
.login-as-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  transition: var(--transition);
}
.login-as-item:hover:not(:disabled) { border-color: var(--gold); background: var(--gold-soft); }
.login-as-item:disabled { cursor: default; opacity: 0.6; }
.login-as-item.loading { opacity: 1; border-color: var(--gold); }
.login-as-item .appt-barber-avatar { width: 36px; height: 36px; flex-shrink: 0; font-size: 0.8rem; }
.login-as-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.login-as-name strong { font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.login-as-name small { font-size: 0.74rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.login-as-item > i { color: var(--text-faint); font-size: 0.8rem; }
.login-as-item.loading > i::before { content: '\f110'; }
.login-as-item.loading > i { animation: spin 0.8s linear infinite; }

.main-area {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--topbar-h);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 16px;
}

.topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.topbar-title { font-size: 1.05rem; font-weight: 700; white-space: nowrap; }

.sidebar-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  color: var(--text);
}

.quick-search-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 0.82rem;
  min-width: 200px;
}
.quick-search-btn kbd {
  margin-left: auto;
  font-size: 0.68rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--text-faint);
}

.topbar-right { display: flex; align-items: center; gap: 10px; }

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.icon-btn:hover { background: var(--surface-hover); color: var(--text); }

.content {
  flex: 1;
  padding: 28px 32px 60px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.page-header h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 4px; }
.page-header p { color: var(--text-muted); font-size: 0.88rem; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-primary { background: var(--gold); color: var(--on-gold); }
.btn-primary:hover { background: var(--gold-strong); }

.btn-secondary { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-secondary:hover { background: var(--surface-hover); }

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

/* Verde da propria marca do WhatsApp, de proposito - reconhecimento imediato
   pesa mais aqui do que a paleta do app. */
.btn-whatsapp { background: rgba(37, 211, 102, 0.14); color: #1da851; }
.btn-whatsapp:hover { background: #25d366; color: #fff; }

.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-hover); color: var(--text); }

.btn-sm { padding: 6px 11px; font-size: 0.78rem; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* ---------- Cards / Grid de estatisticas ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}

.stat-card .stat-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--gold-soft);
  color: var(--gold-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  font-size: 1rem;
}

.stat-card .stat-value { font-size: 1.6rem; font-weight: 700; margin-bottom: 2px; }
.stat-card .stat-label { color: var(--text-muted); font-size: 0.8rem; }
.stat-card .stat-breakdown { color: var(--text-faint); font-size: 0.72rem; margin-top: 4px; }

/* Selo "meta de produtos batida" - tela Produtos (comissao por barbeiro) e
   modal de perfil do barbeiro (Financeiro/Barbeiros) - ver productGoalHit em
   src/utils/commission.js. */
.goal-hit-badge { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; font-size: 0.72rem; font-weight: 600; color: var(--success); }

/* Seletor de periodo do grafico de tendencia (1 mes/3/6/1 ano) - dashboard do
   Financeiro e modal de perfil do barbeiro (Financeiro/Barbeiros). */
.trend-range-toggle { display: flex; gap: 8px; margin-bottom: 14px; }
.trend-range-btn {
  padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-muted);
  font-size: 0.78rem; font-weight: 600; cursor: pointer;
  transition: border-color var(--transition), background var(--transition), color var(--transition);
}
.trend-range-btn:hover { background: var(--surface-hover); color: var(--text); }
.trend-range-btn.active { background: var(--gold); border-color: var(--gold); color: var(--on-gold); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 20px;
}

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

.card-header h2 { font-size: 1rem; font-weight: 700; }
.card-header p { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }

.two-col {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
  align-items: stretch;
}
/* Sem isso, um item de grid nao encolhe alem do conteudo minimo dos seus
   descendentes (ex: uma tabela larga) - em telas estreitas isso empurra o
   card inteiro (e a pagina) para fora da viewport em vez de deixar a
   propria tabela rolar horizontalmente dentro do .table-wrap. */
.two-col > * { min-width: 0; }

/* ---------- Tabelas ---------- */
.table-wrap { overflow-x: auto; }

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.data-table th {
  text-align: left;
  padding: 10px 14px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tbody tr { transition: var(--transition); }
.data-table tbody tr:hover { background: var(--surface-hover); }
.data-table tbody tr.row-clickable { cursor: pointer; }
.data-table tbody tr:last-child td { border-bottom: none; }

.cell-muted { color: var(--text-muted); }
.cell-strong { font-weight: 600; }

.stock-cell { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }

.table-avatar {
  display: flex;
  align-items: center;
  gap: 10px;
}
.table-avatar img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}
.table-avatar .avatar { font-size: 0.7rem; }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state i { font-size: 1.8rem; margin-bottom: 12px; color: var(--text-faint); }
.empty-state p { font-size: 0.88rem; }
/* Botao de acao dentro do estado vazio (ex.: "Agendar mesmo assim" na agenda) */
.empty-state .btn { margin-top: 14px; }
.empty-state .btn i { font-size: inherit; margin-bottom: 0; color: inherit; }

/* ---------- Badges / Pills ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-neutral { background: var(--surface-hover); color: var(--text-muted); }

/* ---------- Formularios ---------- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.form-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.form-field.full { grid-column: 1 / -1; }

.form-field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-field .hint { font-size: 0.74rem; color: var(--text-faint); }
.form-field .field-optional { font-size: 0.7rem; font-weight: 500; color: var(--text-faint); text-transform: none; }

.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="tel"],
.form-field input[type="password"],
.form-field input[type="number"],
.form-field input[type="date"],
.form-field input[type="time"],
.form-field input[type="url"],
.form-field select,
.form-field .select-trigger,
.form-field textarea {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  transition: var(--transition);
}

.form-field input:focus,
.form-field select:focus,
.form-field .select-trigger.open,
.form-field textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
}

.form-field textarea { resize: vertical; min-height: 80px; }
.form-field .field-hint { color: var(--text-muted); font-size: 0.76rem; }
.form-field .field-error { color: var(--danger); font-size: 0.76rem; min-height: 1em; }

#clientPhoneField { position: relative; }
.client-match-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 20;
  margin-top: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  max-height: 220px;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}
.client-match-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: 8px 12px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.client-match-item:last-child { border-bottom: none; }
.client-match-item:hover, .client-match-item:focus { background: var(--surface-3, var(--gold-soft)); }
.client-match-item small { color: var(--text-muted); font-size: 0.76rem; }
.form-field.invalid input, .form-field.invalid select, .form-field.invalid .select-trigger, .form-field.invalid textarea { border-color: var(--danger); }

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* Switch (toggle) */
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch-track {
  position: absolute;
  inset: 0;
  background: var(--border-strong);
  border-radius: 20px;
  transition: var(--transition);
  cursor: pointer;
}
.switch-track::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: var(--transition);
}
.switch input:checked + .switch-track { background: var(--gold); }
.switch input:checked + .switch-track::before { transform: translateX(18px); }

.switch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
}
.switch-row span { font-size: 0.85rem; font-weight: 500; }
/* Sem o padding vertical proprio aqui - alinhado ao centro com outros
   filtros da barra (chips de marca etc) em vez de descer por causa dele. */
.filters-bar .switch-row { padding: 0; }

/* ---------- Grade de horários (agendamento) ---------- */
.time-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 38px;
}
.time-grid-hint {
  color: var(--text-muted);
  font-size: 0.82rem;
  padding: 6px 0;
}
.time-chip {
  padding: 7px 13px;
  border-radius: 20px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.time-chip:hover:not(:disabled) {
  border-color: var(--gold);
}
.time-chip.selected {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--on-gold);
}
.time-chip:disabled {
  opacity: 0.4;
  text-decoration: line-through;
  cursor: not-allowed;
}
/* Horario fora do expediente liberado por "Fora do expediente" - continua
   escolhivel, so' sinaliza que nao e' o horario normal do barbeiro. */
.time-chip.off-hours:not(.selected) {
  border-style: dashed;
  border-color: var(--warning);
  background: repeating-linear-gradient(135deg, var(--warning-soft) 0 4px, var(--surface-2) 4px 8px);
}
/* "Ou digite qualquer horario": dono/barbeiro marcam em qualquer minuto (o site do cliente so' de 30 em 30) */
.custom-time-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.custom-time-row input[type="time"] {
  width: auto;
  padding: 6px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
}
.custom-time-row input[type="time"].selected { background: var(--gold); border: 1px solid var(--gold); color: var(--on-gold); }
.custom-time-row input[type="time"].invalid { border: 1px solid var(--danger); }
.time-grid.invalid {
  outline: 2px solid var(--danger);
  outline-offset: 6px;
  border-radius: 10px;
}

/* ---------- Seletor de servicos (agendamento) ----------
   Antes era um <select multiple>: exige ctrl/cmd+clique no desktop e e'
   inconsistente no toque (mesmo problema ja resolvido no painel /barbeiro).
   Chips com "check" tocavel/clicavel resolvem os dois casos com o mesmo gesto. */
.service-picker { display: flex; flex-direction: column; gap: 6px; max-height: 230px; overflow-y: auto; }
.service-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
}
.service-chip:hover { background: var(--surface-hover); }
.service-chip-check {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1.5px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  color: transparent;
  transition: var(--transition);
}
.service-chip-text { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.service-chip-text strong { font-size: 0.86rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.service-chip-text small { font-size: 0.72rem; color: var(--text-muted); }
.service-chip-text small s { opacity: 0.7; }
/* Preco promocional da data escolhida (promocao de quarta etc.) */
.service-chip-promo { color: var(--success); font-weight: 700; }
.service-chip.selected { border-color: var(--violet); background: var(--violet-soft); }
.service-chip.selected .service-chip-text strong { color: var(--violet); }
.service-chip.selected .service-chip-check { background: var(--violet); border-color: var(--violet); color: #fff; }
.service-picker.invalid { outline: 2px solid var(--danger); outline-offset: 6px; border-radius: 10px; }

/* Upload de imagem */
.image-upload {
  display: flex;
  align-items: center;
  flex-wrap: wrap; /* foto + "Enviar foto" + "Ajustar foto" nao cabem em 375px */
  gap: 10px 14px;
}
.image-upload-preview {
  width: 84px;
  height: 84px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-strong);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--text-faint);
  flex-shrink: 0;
}
.image-upload-preview img { width: 100%; height: 100%; object-fit: cover; }
/* Foto de barbeiro: previa redonda, igual aos avatares onde ela aparece */
.image-upload-preview.round { border-radius: 50%; }

/* ---------- Editor de foto estilo Instagram (ver js/photoCropper.js) ----------
   Quadro quadrado com a foto por baixo e uma mascara escurecendo tudo fora do
   circulo - o circulo e' exatamente como a foto vai aparecer nos avatares.
   z-index acima do modal de editar barbeiro, que fica aberto por baixo. */
.photo-cropper-overlay { z-index: 1100; }
.photo-cropper { max-width: 400px; }
.photo-cropper-hint { margin: 0 0 12px; font-size: 0.82rem; }
.photo-cropper-stage {
  position: relative;
  width: 100%;
  max-width: 320px;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: #000;
  cursor: grab;
  touch-action: none; /* o arraste/pinça e' nosso, nao rolagem da pagina */
  user-select: none;
  -webkit-user-select: none;
}
.photo-cropper-stage.dragging { cursor: grabbing; }
.photo-cropper-stage img {
  position: absolute;
  top: 0;
  left: 0;
  max-width: none;
  transform-origin: 0 0;
  pointer-events: none;
  -webkit-user-drag: none;
}
.photo-cropper-mask {
  position: absolute;
  inset: 0;
  pointer-events: none;
  /* closest-side: 100% = raio do circulo que encosta nas bordas do quadro */
  background: radial-gradient(circle closest-side, transparent 0 calc(100% - 1px), rgba(0, 0, 0, 0.58) 100%);
}
.photo-cropper-mask::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.85);
}
.photo-cropper-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.photo-cropper-zoom {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 320px;
  margin: 14px auto 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.photo-cropper-zoom input[type="range"] { flex: 1; accent-color: var(--gold); }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 12, 0.55);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 6vh 16px;
  z-index: 1000;
  overflow-y: auto;
  backdrop-filter: blur(2px);
}
.modal-overlay.active { display: flex; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.18s ease;
}
.modal.modal-wide { max-width: 760px; }

@keyframes modalIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 1rem; font-weight: 700; }
.modal-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: transparent;
}
.modal-close:hover { background: var(--surface-hover); color: var(--text); }

.modal-body { padding: 22px; max-height: 70vh; overflow-y: auto; overflow-x: hidden; }
.modal-body p { color: var(--text-muted); font-size: 0.88rem; line-height: 1.6; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 22px;
  border-top: 1px solid var(--border);
}

/* Confirmacao de exclusao */
.confirm-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--danger-soft);
  color: var(--danger);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  margin-bottom: 14px;
}

/* ---------- Toasts ---------- */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2000;
  max-width: 340px;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--info);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  box-shadow: var(--shadow-md);
  font-size: 0.84rem;
  animation: toastIn 0.2s ease;
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast i { margin-top: 1px; }
.toast.success i { color: var(--success); }
.toast.error i { color: var(--danger); }
.toast.warning i { color: var(--warning); }
.toast.info i { color: var(--info); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ---------- Quick search (Ctrl+K) ---------- */
.command-palette {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 12, 0.5);
  z-index: 1500;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
}
.command-palette.active { display: flex; }
.command-box {
  width: 100%;
  max-width: 520px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.command-input {
  width: 100%;
  padding: 16px 18px;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 0.95rem;
}
.command-input:focus { outline: none; }
.command-list { max-height: 320px; overflow-y: auto; padding: 8px; }
.command-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  color: var(--text);
}
.command-item i { color: var(--text-muted); width: 16px; }
.command-item:hover, .command-item.selected { background: var(--surface-hover); }

/* ---------- Filtros ---------- */
.filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
  align-items: center;
}
.filters-bar input,
.filters-bar select,
.filters-bar .select-trigger {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.83rem;
}
.filters-bar input:focus, .filters-bar select:focus, .filters-bar .select-trigger.open { outline: none; border-color: var(--gold); }

@media (max-width: 640px) {
  .filters-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .filters-bar input,
  .filters-bar select,
  .filters-bar .select-trigger {
    width: 100%;
    min-width: 0;
    padding: 10px 12px;
    font-size: 0.86rem;
  }
  /* Agendamentos tem 6 filtros - grade nomeada em vez de empilhar tudo. */
  .filters-bar-appointments {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "date    status"
      "search  search"
      "barber  service"
      "clear   clear";
    gap: 8px;
  }
  #filterDate { grid-area: date; }
  #filterStatus { grid-area: status; }
  #filterSearch { grid-area: search; }
  #filterBarber { grid-area: barber; }
  #filterService { grid-area: service; }
  #clearFiltersBtn { grid-area: clear; justify-content: center; }
}

/* ---------- Lista de agendamentos (cards) ---------- */
.appt-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.appt-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong);
  border-radius: var(--radius-md);
  transition: var(--transition);
}
.appt-card:hover { background: var(--surface-hover); box-shadow: var(--shadow-sm); }
.appt-card[data-status="PENDING"] { border-left-color: var(--text-faint); }
.appt-card[data-status="CONFIRMED"] { border-left-color: var(--info); }
.appt-card[data-status="IN_PROGRESS"] { border-left-color: var(--warning); }
.appt-card[data-status="DONE"] { border-left-color: var(--success); }
.appt-card[data-status="CANCELED"] { border-left-color: var(--danger); opacity: 0.7; }

.appt-date-badge {
  flex-shrink: 0;
  width: 58px;
  height: 58px;
  border-radius: var(--radius-md);
  background: var(--gold-soft);
  color: var(--gold-strong);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
}
.appt-date-badge .appt-day { font-size: 1.15rem; font-weight: 800; }
.appt-date-badge .appt-month { font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; }
.appt-date-badge .appt-time { font-size: 0.68rem; font-weight: 600; color: var(--text-muted); margin-top: 2px; }

.appt-body {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 14px;
  align-items: center;
}

.appt-client strong { display: block; font-size: 0.88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appt-client span { font-size: 0.76rem; color: var(--text-muted); }
.appt-client .nowrap { white-space: nowrap; font-size: inherit; }
/* Agendado junto com outras pessoas pelo site (ver groupBadgeHtml em pages/agendamentos.js) */
.appt-client .appt-group {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--violet-soft);
  color: var(--violet);
  font-size: 0.7rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: help;
}

.appt-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
}
.appt-tag span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appt-tag i { color: var(--text-faint); width: 14px; text-align: center; flex-shrink: 0; }

.appt-barber-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 700;
  overflow: hidden;
}
.appt-barber-avatar img { width: 100%; height: 100%; object-fit: cover; }

.avatar-c0 { background: var(--gold-soft); color: var(--gold-strong); }
.avatar-c1 { background: var(--info-soft); color: var(--info); }
.avatar-c2 { background: var(--success-soft); color: var(--success); }
.avatar-c3 { background: var(--violet-soft); color: var(--violet); }
.avatar-c4 { background: var(--teal-soft); color: var(--teal); }
.avatar-c5 { background: var(--warning-soft); color: var(--warning); }

.appt-price-col { display: flex; flex-direction: column; align-items: flex-end; }
.appt-price { font-weight: 700; font-size: 0.92rem; }

.appt-side {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-select,
.payment-select,
.commission-paid-select {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}
.status-select:focus,
.payment-select:focus,
.commission-paid-select:focus { outline: none; box-shadow: 0 0 0 2px var(--gold-soft); }

.status-select[data-status="PENDING"] { color: var(--text-muted); border-color: var(--border-strong); background: var(--surface-hover); }
.status-select[data-status="CONFIRMED"] { color: var(--info); border-color: var(--info); background: var(--info-soft); }
.status-select[data-status="IN_PROGRESS"] { color: var(--warning); border-color: var(--warning); background: var(--warning-soft); }
.status-select[data-status="DONE"] { color: var(--success); border-color: var(--success); background: var(--success-soft); }
.status-select[data-status="CANCELED"] { color: var(--danger); border-color: var(--danger); background: var(--danger-soft); }

.payment-select[data-set="no"] { color: var(--text-muted); border-style: dashed; border-color: var(--border-strong); background: var(--surface-hover); }
.payment-select[data-set="yes"] { color: var(--success); border-color: var(--success); background: var(--success-soft); }

.commission-paid-select[data-paid="no"] { color: var(--warning); border-color: var(--warning); background: var(--warning-soft); }
.commission-paid-select[data-paid="yes"] { color: var(--success); border-color: var(--success); background: var(--success-soft); }

/* ---------- Select customizado (admin/js/customSelect.js) ----------
   O <select> nativo continua no DOM (fonte de verdade, escondido - nao
   display:none pra preservar "required"); o trigger herda as classes do
   select original (ex.: status-select/payment-select), entao a aparencia de
   caixa de cada contexto (.form-field, .filters-bar etc.) e' so estendida
   nos seletores acima, nao duplicada aqui. */
.select-wrap { display: contents; }
.select-native {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  pointer-events: none;
}
.select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-width: 0;
  text-align: left;
  cursor: pointer;
}
.select-trigger:disabled { opacity: 0.55; cursor: not-allowed; }
.select-trigger-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.select-trigger-chevron { flex-shrink: 0; font-size: 0.76rem; color: var(--text-muted); transition: transform 0.18s ease; }
.select-trigger.open .select-trigger-chevron { transform: rotate(180deg); color: var(--gold); }

.select-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 1200;
  animation: selectPanelIn 0.15s ease;
}
.select-panel-dropdown { position: fixed; padding: 6px; }
.select-panel-list { overflow-y: auto; max-height: inherit; }
@keyframes selectPanelIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.select-panel-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  border-radius: 16px 16px 0 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  animation: selectSheetIn 0.2s ease;
}
.select-panel-sheet .select-panel-list { flex: 1; max-height: none; padding: 6px; }
@keyframes selectSheetIn {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.select-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 0.92rem;
  flex-shrink: 0;
}
.select-panel-close {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--surface-hover);
  color: var(--text-muted);
  cursor: pointer;
}

.select-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  min-height: 44px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  color: var(--text);
  cursor: pointer;
  box-sizing: border-box;
}
.select-option.highlighted, .select-option:hover { background: var(--surface-hover); }
.select-option.selected { background: var(--gold-soft); color: var(--gold); font-weight: 600; }
.select-option.is-disabled { color: var(--text-faint); cursor: default; }
.select-option-check { opacity: 0; font-size: 0.76rem; color: var(--gold); flex-shrink: 0; }
.select-option.selected .select-option-check { opacity: 1; }

.select-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5); z-index: 1199; }
body.select-sheet-lock { position: fixed; overflow: hidden; width: 100%; }

@media (max-width: 900px) {
  .appt-card { flex-wrap: wrap; }
  .appt-body { grid-template-columns: 1fr 1fr; row-gap: 8px; }
  .appt-price-col { align-items: flex-start; grid-column: 1 / -1; flex-direction: row; gap: 6px; }
  .appt-side { margin-left: auto; }
}
@media (max-width: 560px) {
  .appt-body { grid-template-columns: 1fr; }
  /* Preco + status + pagamento + acoes num flex so, sem wrap, ficava
     espremido/colado em ~360-430px - deixa quebrar em varias linhas. */
  .appt-side { flex-wrap: wrap; width: 100%; justify-content: flex-start; row-gap: 8px; }
  .appt-side .row-actions { width: 100%; }
}

/* ---------- Agenda em grade ---------- */
.agenda-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.agenda-toolbar input[type="date"] {
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.83rem;
}

.agenda-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--text-muted);
}
.agenda-legend span { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.agenda-legend i { width: 9px; height: 9px; border-radius: 50%; background: var(--surface-hover); }
.agenda-legend i[data-status="PENDING"] { background: var(--text-muted); }
.agenda-legend i[data-status="CONFIRMED"] { background: var(--info); }
.agenda-legend i[data-status="IN_PROGRESS"] { background: var(--warning); }
.agenda-legend i[data-status="DONE"] { background: var(--success); }
.agenda-legend i[data-status="BLOCKED"] { background: var(--danger); }

.agenda-wrap {
  overflow: auto;
  max-height: 65vh;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.agenda-grid {
  display: grid;
  position: relative;
  min-width: max-content;
}

.agenda-corner {
  position: sticky;
  top: 0;
  left: 0;
  z-index: 6;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

.agenda-header-cell {
  position: sticky;
  top: 0;
  /* Acima da barrinha "agora" (.now-line, z-index 4): ao rolar pra baixo a
     linha passa por baixo do cabecalho fixo, nao por cima dos nomes. */
  z-index: 5;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  border-left: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  font-size: 0.74rem;
  font-weight: 600;
  overflow: hidden;
  white-space: nowrap;
}
.agenda-header-cell span { overflow: hidden; text-overflow: ellipsis; }
.agenda-header-cell .appt-barber-avatar { width: 20px; height: 20px; font-size: 0.58rem; }

.agenda-time-col {
  position: sticky;
  left: 0;
  z-index: 3;
  background: var(--surface);
  border-right: 1px solid var(--border);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 2px;
  font-size: 0.62rem;
  color: var(--text-muted);
}

.agenda-slot {
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
  min-width: 0;
  /* Abaixo da coluna de horario sticky (z-index 3), que precisa cobrir os
     cards ao rolar horizontalmente, e da barrinha "agora" (.now-line, z-index
     4). position: relative tambem ancora a alca de duracao do card. */
  position: relative;
  z-index: 2;
}

.agenda-slot.empty {
  background: var(--surface-2);
  cursor: pointer;
  transition: background var(--transition);
}
.agenda-slot.empty:hover { background: var(--gold-soft); }

.agenda-slot.off {
  background: repeating-linear-gradient(45deg, var(--surface-hover), var(--surface-hover) 6px, var(--surface-2) 6px, var(--surface-2) 12px);
  color: var(--text-faint);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.66rem;
  font-weight: 600;
}

.agenda-slot.lunch {
  background: var(--surface-hover);
  color: var(--text-faint);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.agenda-slot.lunch:hover,
.agenda-slot.lunch.drag-active {
  background: var(--border);
  color: var(--text-muted);
}

.agenda-slot.booked {
  margin: 1px;
  border-radius: 4px;
  border-top: none;
  border-left: none;
  padding: 2px 5px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  background: var(--surface-hover);
  color: var(--text-muted);
  transition: filter var(--transition);
}
.agenda-slot.booked:hover { filter: brightness(0.95); }
.agenda-slot.booked strong { font-size: 0.82rem; font-weight: 700; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agenda-slot.booked span { font-size: 0.72rem; line-height: 1.15; opacity: 0.92; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Cor suave por status do agendamento, para localizar rapidamente na grade */
.agenda-slot.booked[data-status="PENDING"] { background: var(--neutral-soft-2); color: var(--text-muted); }
.agenda-slot.booked[data-status="CONFIRMED"] { background: var(--info-soft-2); color: var(--info); }
.agenda-slot.booked[data-status="IN_PROGRESS"] { background: var(--warning-soft-2); color: var(--warning); }
.agenda-slot.booked[data-status="DONE"] { background: var(--success-soft-2); color: var(--success); }
.agenda-slot.booked.blocked { background: var(--danger-soft); color: var(--danger); }

/* Horario fora do expediente com "Fora do expediente" ligado: listrado como
   .off, mas clicavel pra agendar mesmo assim. */
.agenda-slot.off-hours {
  background: repeating-linear-gradient(45deg, var(--surface-hover), var(--surface-hover) 6px, var(--surface-2) 6px, var(--surface-2) 12px);
  color: var(--text-faint);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.66rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}
.agenda-slot.off-hours:hover {
  background: repeating-linear-gradient(45deg, var(--gold-soft), var(--gold-soft) 6px, var(--surface-2) 6px, var(--surface-2) 12px);
}

.agenda-offhours-toggle.active {
  background: var(--gold-soft);
  border-color: var(--gold);
  color: var(--gold-strong);
}

.agenda-closed-note {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

/* Cards da agenda do dono: posicionados pelo minuto exato (margin-top/height
   em px vindos de placeCard em js/pages/agenda.js), podendo passar da propria
   linha da grade. */
.agenda-grid .agenda-card {
  align-self: start;
  position: relative;
  margin-left: 2px;
  margin-right: 2px;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.agenda-grid .agenda-card.booked:not(.blocked) { cursor: grab; }
.agenda-grid .agenda-card.drag-source { opacity: 0.35; }

/* Botao do WhatsApp no card (ver agendaWhatsappHtml em js/pages/agenda.js):
   verde da propria marca, igual ao da agenda do barbeiro - reconhecimento
   imediato pesa mais que a paleta do painel. Fica centralizado na direita e o
   texto do card ganha recuo pra nao passar por baixo dele. --wa-size vem do JS
   no proprio card (acompanha a altura dele). z-index 1: acima da alca de duracao. */
.agenda-grid .agenda-card.has-whatsapp { padding-right: calc(var(--wa-size, 24px) + 9px); }
.agenda-grid .agenda-card-whatsapp {
  position: absolute;
  top: 50%;
  right: 5px;
  z-index: 1;
  width: var(--wa-size, 24px);
  height: var(--wa-size, 24px);
  margin-top: calc(var(--wa-size, 24px) / -2);
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: calc(var(--wa-size, 24px) * 0.55);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform var(--transition), filter var(--transition);
}
.agenda-grid .agenda-card-whatsapp:hover { transform: scale(1.08); filter: brightness(1.05); }
.agenda-grid .agenda-card.conflict,
.agenda-grid .agenda-ghost.conflict {
  outline: 2px solid var(--danger);
  outline-offset: -2px;
  background: var(--danger-soft) !important;
  color: var(--danger) !important;
}
.agenda-grid .agenda-ghost {
  pointer-events: none;
  outline: 2px dashed var(--gold-strong);
  outline-offset: -2px;
  opacity: 0.92;
  z-index: 2;
}
.agenda-card-adjusted { font-size: 0.85em; opacity: 0.85; }

/* Alca de duracao na borda de baixo do card */
.agenda-resize-handle {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 8px;
  cursor: ns-resize;
  touch-action: none;
}
.agenda-resize-handle::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 22px;
  height: 3px;
  margin-left: -11px;
  border-radius: 2px;
  background: currentColor;
  opacity: 0;
  transition: opacity var(--transition);
}
.agenda-card:hover .agenda-resize-handle::after,
.agenda-card.resizing .agenda-resize-handle::after { opacity: 0.55; }

/* Agendamento SELECIONADO na agenda do dono (segurar o card - ver
   selectAppointment em js/pages/agenda.js): contorno + uma bolinha em cima
   (muda o inicio) e outra embaixo (muda o fim). overflow visivel pras
   bolinhas ficarem em cima da borda; z-index 3 pra elas nao sumirem atras
   do card/celula vizinha (a barrinha "agora", z-index 4, continua por cima). */
.agenda-grid .agenda-card.selected {
  overflow: visible;
  z-index: 3;
  box-shadow: 0 0 0 2px var(--gold-strong), var(--shadow-md);
}
.agenda-resize-dot {
  display: none;
  position: absolute;
  left: 50%;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--gold-strong);
  box-shadow: var(--shadow-sm);
  cursor: ns-resize;
  touch-action: none;
  z-index: 2;
}
.agenda-resize-dot.top { top: -8px; }
.agenda-resize-dot.bottom { bottom: -8px; }
/* Area de toque bem maior que a bolinha - o dedo cobre 14px inteiros */
.agenda-resize-dot::before { content: ''; position: absolute; inset: -13px; }
.agenda-grid .agenda-card.selected .agenda-resize-dot { display: block; }
/* No toque nao existe hover: alca sempre visivel e com area maior pro dedo */
@media (hover: none) and (pointer: coarse) {
  .agenda-resize-handle { height: 14px; }
  .agenda-resize-handle::after { opacity: 0.45; }
}

body.agenda-dragging,
body.agenda-dragging * { cursor: grabbing !important; user-select: none; }
body.agenda-resizing,
body.agenda-resizing * { cursor: ns-resize !important; user-select: none; }

/* Tooltip flutuante do arraste (horario de destino / nova duracao) */
.agenda-drag-tooltip {
  display: none;
  position: fixed;
  z-index: 500;
  background: var(--text);
  color: var(--bg);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: var(--radius-sm);
  pointer-events: none;
  transform: translate(14px, -130%);
  box-shadow: var(--shadow-md);
  white-space: nowrap;
}

/* ---------- Indicador "agora": barrinha na posicao exata do horario atual,
   atravessando todas as colunas de barbeiro - facilita achar de relance onde
   estamos no dia sem precisar ler cada horario da coluna da esquerda. ---------- */
.agenda-grid .now-line {
  position: absolute;
  left: 56px;
  right: 0;
  height: 0;
  /* Vermelho (e nao a cor da marca): o tema e os cards "Confirmado" sao
     azuis e a linha sumia no meio deles. */
  border-top: 2px solid var(--danger);
  /* POR CIMA de tudo da grade - celulas de fundo e cards (.agenda-slot,
     z-index 2) e coluna de horario (z-index 3). Embaixo das celulas a linha
     ficava invisivel: o fundo das celulas livres e' opaco, e no horario
     ocupado o card cobria. So' o cabecalho fixo (z-index 5) fica acima. */
  z-index: 4;
  pointer-events: none;
}
.agenda-grid .now-line-dot {
  position: absolute;
  left: -5px;
  top: -4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 2px var(--surface);
}

/* ---------- Loading ---------- */
.spinner {
  width: 22px;
  height: 22px;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-row { display: flex; align-items: center; justify-content: center; padding: 50px 0; }

/* ---------- Login ---------- */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 20px;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: var(--shadow-md);
}
.login-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
  text-align: center;
}
.login-logo .logo-mark {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.login-logo .logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.login-logo h1 { font-size: 1.1rem; font-weight: 700; }
.login-logo p { font-size: 0.8rem; color: var(--text-muted); }

.login-form .form-field { margin-bottom: 16px; }
.login-error {
  background: var(--danger-soft);
  color: var(--danger);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  margin-bottom: 16px;
  display: none;
}
.login-error.active { display: block; }
.login-submit { width: 100%; justify-content: center; padding: 11px; }
.login-hint {
  margin-top: 18px;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-faint);
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 14px;
  color: var(--text-faint);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.login-barber-link { width: 100%; justify-content: center; padding: 11px; text-decoration: none; }

/* ---------- Utilidades ---------- */
.text-right { text-align: right; }
.mt-0 { margin-top: 0; }
.flex-gap { display: flex; gap: 8px; align-items: center; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }

.gallery-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}
.gallery-admin-item {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  aspect-ratio: 1;
  background: var(--surface-2);
}
.gallery-admin-item img { width: 100%; height: 100%; object-fit: cover; }
.gallery-admin-item .gallery-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--gold);
  color: #16130a;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
}
.gallery-admin-item .gallery-actions {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  gap: 4px;
  padding: 8px;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
  opacity: 0;
  transition: var(--transition);
}
.gallery-admin-item:hover .gallery-actions { opacity: 1; }
.gallery-actions button {
  flex: 1;
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 0;
  font-size: 0.78rem;
  backdrop-filter: blur(4px);
}
.gallery-actions button:hover { background: rgba(255,255,255,0.3); }

.color-swatch-input { display: flex; align-items: center; gap: 10px; }
.color-swatch-input input[type="color"] {
  width: 40px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: none;
  padding: 2px;
}

/* ---------- Responsivo ---------- */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 190;
}

/* Trava o scroll de fundo enquanto o menu mobile esta aberto (ver
   admin/js/shell.js openSidebar/closeSidebar) - sem isso o conteudo por
   tras do overlay rola junto do dedo. */
body.sidebar-lock { overflow: hidden; }

@media (max-width: 980px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.active { display: block; }
  .main-area { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .quick-search-btn { min-width: 0; width: 160px; }
  .two-col { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .content { padding: calc(var(--topbar-h) + 20px) 16px 40px; }
  .form-grid { grid-template-columns: 1fr; }
  .quick-search-btn span.label-text { display: none; }
  /* No mobile "position:sticky" nao gruda de verdade: "html, body" tem
     overflow-x:hidden (linha ~134), e por regra da spec CSS isso faz o
     overflow-y computar como "auto" - criando um scroll container que o
     Safari/Chrome mobile tratam com bugs conhecidos de sticky. "fixed" nao
     depende de scroll container e sempre funciona; o padding-top acima no
     .content compensa o espaco que o topbar deixava de ocupar no fluxo. */
  .topbar { padding: 0 14px; position: fixed; top: 0; left: 0; right: 0; }
  .agenda-legend { margin-left: 0; }

  /* Alvo de toque maior no celular - botoes, campos de formulario e os
     selects de status/pagamento ficavam abaixo de ~44px, dificeis de tocar
     com precisao. So dentro deste breakpoint: desktop/tablet nao mudam. */
  .btn { padding: 11px 18px; font-size: 0.88rem; }
  .btn-sm { padding: 9px 13px; font-size: 0.82rem; }
  .form-field input[type="text"],
  .form-field input[type="email"],
  .form-field input[type="tel"],
  .form-field input[type="password"],
  .form-field input[type="number"],
  .form-field input[type="date"],
  .form-field input[type="time"],
  .form-field input[type="url"],
  .form-field select,
  .form-field .select-trigger,
  .form-field textarea {
    padding: 12px 14px;
  }
  .status-select, .payment-select, .commission-paid-select { padding: 9px 12px; font-size: 0.82rem; }
  .row-actions { flex-wrap: wrap; }

  /* Menos espaco perdido em padding fixo nas telas pequenas. */
  .card { padding: 16px; }
  .modal-body { padding: 16px; }
  .modal-header { padding: 16px; }
  /* Rodape quebra linha em vez de vazar da tela: o modal de editar
     agendamento tem 3 botoes (Fechar conta + Cancelar + Salvar) e eles nao
     cabem lado a lado em 375px - o primeiro sumia cortado pela esquerda. Os
     botoes dividem a largura; "Fechar conta" fica numa linha so' dele. */
  .modal-footer { padding: 12px 16px; flex-wrap: wrap; }
  .modal-footer > .btn { flex: 1 1 auto; justify-content: center; }
  .modal-footer > .ap-checkout-btn { flex-basis: 100%; margin-right: 0; }

  /* ---------- Tabelas -> cartao empilhado ----------
     Cada <tr> vira um cartao e cada <td> mostra seu rotulo (attr(data-label),
     preenchido no JS de cada pagina) em vez de depender das colunas do
     <thead>, que nao cabem em 375px. Linhas de estado vazio/carregando
     (colspan) ficam como estavam, sem virar campo com rotulo. */
  .responsive-cards table.data-table thead { display: none; }
  .responsive-cards table.data-table,
  .responsive-cards table.data-table tbody,
  .responsive-cards table.data-table tr,
  .responsive-cards table.data-table td { display: block; width: 100%; }
  .responsive-cards table.data-table tr {
    border: 1px solid var(--border); border-radius: var(--radius-md);
    padding: 4px 14px; margin-bottom: 10px;
  }
  .responsive-cards table.data-table td {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 9px 0; border-bottom: 1px solid var(--border); text-align: right;
  }
  .responsive-cards table.data-table td:last-child { border-bottom: none; }
  .responsive-cards table.data-table td::before {
    content: attr(data-label); flex-shrink: 0;
    font-weight: 600; font-size: 0.74rem; color: var(--text-muted); text-align: left;
  }
  /* Celula de cabecalho do cartao (nome + avatar/foto) nao leva rotulo.
     flex-direction:column garante que, quando essa celula tem mais de um
     filho direto (ex: Promocoes: nome + descricao + linha de servico, sem
     um wrapper como o .table-avatar das outras paginas), eles empilhem em
     vez de tentar ficar lado a lado - nas paginas com so 1 filho isso nao
     muda nada visualmente. */
  .responsive-cards table.data-table td.cell-avatar {
    justify-content: flex-start; padding-bottom: 10px;
    flex-direction: column; align-items: flex-start;
  }
  .responsive-cards table.data-table td.cell-avatar::before { content: none; }
  .responsive-cards table.data-table td.cell-avatar .table-avatar { width: 100%; }
  .responsive-cards table.data-table td[colspan] { display: block; text-align: left; }
  .responsive-cards .row-actions { justify-content: flex-end; }

  /* Texto que em desktop trunca com "..." (style inline, pensado pra uma
     coluna estreita de tabela) - no cartao mobile o max-width fixo daquele
     inline e maior que a largura real do cartao e o texto estoura pra fora
     em vez de so cortar. !important e o unico jeito de vencer um style=""
     sem tocar no HTML/JS que gera esse inline. */
  .cell-clip {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    max-width: 100% !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    overflow-wrap: break-word;
    word-break: break-word;
  }
}

/* ---------- Venda rápida (venda-rapida.html) + filtro de marca (produtos.html) ---------- */
/* Filtro de marca - varios produtos (El Guapo, Fox, ...) misturados na mesma
   grade dificultavam achar rapido. */
.brand-filter { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; margin-bottom: 12px; scrollbar-width: none; }
.brand-filter::-webkit-scrollbar { display: none; }
.brand-filter:empty { display: none; margin-bottom: 0; }
.brand-chip {
  flex-shrink: 0; padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-muted);
  font-size: 0.8rem; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.brand-chip:hover { background: var(--surface-hover); color: var(--text); }
.brand-chip.active { background: var(--gold); border-color: var(--gold); color: var(--on-gold); }

/* Grade mobile-first: 1 card por linha em telas pequenas, evoluindo pra
   varias colunas conforme sobra espaco. Grid garante altura igual entre os
   cards de uma mesma linha mesmo quando um nome quebra em 2 linhas. */
.quick-sell-row { display: grid; grid-template-columns: 1fr; gap: 10px; }
.product-chip {
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 4px;
  width: 100%; min-height: 64px; padding: 12px 14px;
  border-radius: var(--radius-md); border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); cursor: pointer; text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}
.product-chip:hover:not(:disabled) { border-color: var(--gold); background: var(--surface-hover); }
.product-chip:disabled { opacity: 0.45; cursor: not-allowed; }
.product-chip strong {
  font-size: 0.88rem; line-height: 1.3; width: 100%;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.product-chip small { font-size: 0.74rem; color: var(--text-muted); }
/* object-fit:cover em vez de contain: as fotos sao bem mais altas que largas
   (potes/frascos em pe), entao "contain" numa caixa larga e baixa encolhia o
   produto a uma tirinha fina. object-position enviesa o corte pra baixo, onde
   fica o rotulo na maioria das fotos. */
.product-chip-photo { width: 100%; height: 140px; object-fit: cover; object-position: center 65%; border-radius: var(--radius-sm); margin-bottom: 4px; background: var(--surface); }

@media (min-width: 481px) {
  .quick-sell-row { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}
@media (min-width: 769px) {
  .quick-sell-row { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .product-chip { min-height: 0; padding: 9px 14px; }
  .product-chip strong { font-size: 0.85rem; }
}

/* ==========================================================================
   BARBEARIA DEMO (demo.classbarber.com.br) - dourado no lugar do azul, pra nao
   parecer a Barbearia Melo. A classe vem de admin/js/ui.js, so no subdominio
   demo. Despesa vira vermelho: marrom/laranja ficaria parecido demais com a
   receita dourada nos graficos do Financeiro.
   ========================================================================== */
/* Login da demo: entra sozinho (admin/js/login.js e barbeiro/js/login.js) -
   o cartao so aparece se o acesso livre falhar. */
html.is-demo .login-card { visibility: hidden; }

html.is-demo {
  --gold: #8a6a2f;
  --gold-strong: #6e5323;
  --gold-soft: rgba(138, 106, 47, 0.12);
  --chart-expense: #b42318;
}

html.is-demo[data-theme="dark"] {
  --gold: #c8a15a;
  --gold-strong: #e0c48a;
  --gold-soft: rgba(200, 161, 90, 0.14);
  --on-gold: #16130a;
  --chart-revenue: #c8a15a;
  --chart-expense: #f0766b;
}

@media (prefers-color-scheme: dark) {
  html.is-demo:not([data-theme="light"]) {
    --gold: #c8a15a;
    --gold-strong: #e0c48a;
    --gold-soft: rgba(200, 161, 90, 0.14);
    --on-gold: #16130a;
    --chart-revenue: #c8a15a;
    --chart-expense: #f0766b;
  }
}

/* ---------- Fechar conta (checkout) - ver js/checkoutModal.js ----------
   Mobile-first: no celular o modal ocupa a tela inteira e o rodape (total +
   botao) fica preso embaixo; no desktop vira um modal normal. */
.paid-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  align-self: flex-start;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
}
.agenda-grid .agenda-card .paid-badge { margin-top: 2px; font-size: 0.64rem; }
.single-agenda-grid .agenda-slot.booked .paid-badge { align-self: center; flex-shrink: 0; }
.ap-checkout-btn { margin-right: auto; }

/* Remarcar / Cancelar agendamento - topo do modal de edicao (ver appointmentModal.js) */
.ap-edit-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.ap-reschedule-current {
  margin-bottom: 18px;
  line-height: 1.45;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-hover);
  color: var(--text-muted);
  font-size: 0.85rem;
}
.ap-reschedule-current strong { color: var(--text); }
.ap-reschedule-current i { margin-right: 6px; }
.confirm-icon:has(.fa-whatsapp) { background: rgba(37, 211, 102, 0.14); color: #1da851; }
.detail-checkout-btn { width: 100%; justify-content: center; margin-bottom: 12px; }

.checkout-modal { max-width: 620px; display: flex; flex-direction: column; }
.checkout-body { display: flex; flex-direction: column; gap: 18px; }
.checkout-when { color: var(--text-muted); font-size: 0.8rem; margin-top: -6px; }
.checkout-section { display: flex; flex-direction: column; gap: 8px; }
.checkout-section-title { font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-muted); }

.checkout-lines { display: flex; flex-direction: column; gap: 6px; }
.checkout-line {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.checkout-line.courtesy { border-style: dashed; }
.checkout-line-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.checkout-line-main strong { font-size: 0.86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.checkout-line-main small { font-size: 0.72rem; color: var(--text-muted); }
.checkout-line-price { font-weight: 700; font-size: 0.86rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.checkout-covered { color: var(--info); font-size: 0.74rem; font-weight: 600; }
.checkout-tag { color: var(--gold-strong); font-weight: 700; }
.checkout-subtotal { display: flex; justify-content: space-between; gap: 8px; font-size: 0.78rem; color: var(--text-muted); padding: 0 4px; }
/* Sugestao "Usar o combo Cabelo + Barba" quando os servicos avulsos formam um combo */
.checkout-combo-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px dashed var(--gold);
  border-radius: var(--radius-sm);
  background: var(--gold-soft);
  color: var(--text);
  font-size: 0.8rem;
  text-align: left;
  cursor: pointer;
}
.checkout-combo-hint i { color: var(--gold-strong); }
/* aviso "Nenhum produto/bebida" ocupa a linha toda da grade do catalogo */
.checkout-catalog > .time-grid-hint { grid-column: 1 / -1; }
.checkout-combo-hint:hover { filter: brightness(1.05); }
.checkout-empty { font-size: 0.8rem; color: var(--text-faint); padding: 4px; }

.checkout-icon-btn {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
}
.checkout-icon-btn:hover { border-color: var(--gold); color: var(--text); }
.checkout-icon-btn.active { background: var(--gold-soft); border-color: var(--gold); color: var(--gold-strong); }
.checkout-qty { display: flex; align-items: center; gap: 6px; font-weight: 700; font-variant-numeric: tabular-nums; }
.checkout-qty span { min-width: 18px; text-align: center; }

.checkout-tabs { display: flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; align-self: flex-start; }
.checkout-tabs button { border: none; background: var(--surface); color: var(--text-muted); font-weight: 600; font-size: 0.82rem; padding: 8px 16px; cursor: pointer; }
.checkout-tabs button.active { background: var(--gold-soft); color: var(--gold-strong); }
.checkout-search { padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font-size: 0.86rem; }

.checkout-catalog { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; max-height: 260px; overflow-y: auto; padding: 2px; }
.checkout-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  color: var(--text);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), transform var(--transition);
}
.checkout-card:hover { border-color: var(--gold); }
.checkout-card:active { transform: scale(0.97); }
.checkout-card.in-cart { border-color: var(--gold); background: var(--gold-soft); }
.checkout-card-photo { width: 44px; height: 44px; border-radius: 8px; overflow: hidden; display: flex; align-items: center; justify-content: center; background: var(--surface-hover); color: var(--text-faint); }
.checkout-card-photo img { width: 100%; height: 100%; object-fit: cover; }
.checkout-card-name { font-size: 0.78rem; font-weight: 600; line-height: 1.2; }
.checkout-card-price { font-size: 0.8rem; font-weight: 700; color: var(--gold-strong); }
.checkout-stock { font-size: 0.66rem; color: var(--text-faint); }
.checkout-stock.out { color: var(--danger); font-weight: 600; }
.checkout-card-count {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--on-gold);
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.checkout-add-service { align-self: flex-start; }
/* "Servico a mais": grade de opcoes do mesmo tamanho (nome + preco/duracao) */
.checkout-service-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.checkout-service-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.checkout-service-option:hover { border-color: var(--gold); background: var(--gold-soft); }
.checkout-service-plus {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gold-soft);
  color: var(--gold-strong);
  font-size: 0.72rem;
}
.checkout-service-text { display: flex; flex-direction: column; min-width: 0; }
.checkout-service-text strong { font-size: 0.82rem; line-height: 1.25; }
.checkout-service-text small { font-size: 0.72rem; color: var(--text-muted); }
.checkout-brand-filter { margin-bottom: 0; }
/* "Quem vendeu os produtos?" + comissao calculada */
.checkout-seller { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-2); }
.checkout-seller[hidden] { display: none; }
.checkout-seller-label { font-size: 0.82rem; font-weight: 700; }
.checkout-seller-options { display: flex; flex-wrap: wrap; gap: 6px; }
.checkout-commission { font-size: 0.8rem; color: var(--text-muted); line-height: 1.45; }
.checkout-commission strong { color: var(--success); }
.checkout-commission i { margin-right: 4px; }
/* display:flex/grid acima venceria o atributo hidden */
.checkout-cash[hidden],
.checkout-service-picker[hidden] { display: none; }
.checkout-card-brand { font-size: 0.64rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; color: var(--text-faint); }

.checkout-payments { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.checkout-payment {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 12px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
  font-size: 0.84rem;
  cursor: pointer;
}
.checkout-payment.active { background: var(--gold); border-color: var(--gold); color: var(--on-gold); }
.checkout-cash { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 0.84rem; }
.checkout-cash input { width: 130px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font-weight: 600; }
.checkout-change { font-weight: 700; }
.checkout-change.ok { color: var(--success); }
.checkout-change.short { color: var(--danger); }

/* Desconto em R$ do dono (ver renderCheckoutDiscount em checkoutModal.js) */
.checkout-discount { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.checkout-discount-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: text;
}
.checkout-discount-field:focus-within { border-color: var(--gold); }
.checkout-discount-field.invalid { border-color: var(--danger); }
.checkout-discount-field span { color: var(--text-muted); font-weight: 600; font-size: 0.9rem; }
.checkout-discount-field input { width: 110px; padding: 9px 0; border: 0; outline: 0; background: transparent; color: var(--text); font-weight: 700; font-size: 1rem; }
.checkout-discount-hint { font-size: 0.76rem; color: var(--text-muted); }
.checkout-discount-hint.error { color: var(--danger); font-weight: 600; }
.checkout-discount [hidden],
.checkout-total-discount[hidden] { display: none; }
.checkout-total-discount { display: flex; justify-content: space-between; font-size: 0.86rem; color: var(--success); font-weight: 600; }
.checkout-total-discount i { margin-right: 4px; }

/* Pagamento em duas formas (ver renderCheckoutSplit em checkoutModal.js) */
.checkout-split-toggle { align-self: flex-start; }
.checkout-split[hidden] { display: none; }
.checkout-split {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.checkout-split-row,
.checkout-split-rest { display: flex; flex-direction: column; gap: 6px; }
.checkout-split-label { font-size: 0.82rem; color: var(--text-muted); }
.checkout-split-label strong { color: var(--text); }
.checkout-split-row .checkout-discount-field { align-self: flex-start; }
.checkout-split-methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.checkout-split-method {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}
.checkout-split-method.active { background: var(--gold); border-color: var(--gold); color: var(--on-gold); }

.checkout-footer { flex-direction: column; align-items: stretch; gap: 10px; }
.checkout-total { display: flex; justify-content: space-between; align-items: baseline; }
.checkout-total span { color: var(--text-muted); font-size: 0.84rem; }
.checkout-total strong { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.checkout-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

.checkout-paid-total { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 0; }
.checkout-paid-total strong { font-size: 1.7rem; font-variant-numeric: tabular-nums; }
.checkout-paid-total small { color: var(--text-muted); }
.checkout-receipt {
  margin: 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: 0.82rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.checkout-share { display: flex; gap: 8px; flex-wrap: wrap; }

/* Estoque negativo (vendeu com "Vender mesmo assim"): lembrete de atualizar */
.stock-negative { color: var(--danger); font-weight: 700; }

@media (max-width: 640px) {
  .checkout-overlay { padding: 0; }
  /* Tela cheia: o corpo rola por dentro e o rodape (total + botao) fica sempre visivel */
  .checkout-modal { max-width: none; height: 100%; border-radius: 0; border: none; }
  .checkout-modal .modal-body { flex: 1 1 auto; min-height: 0; max-height: none; }
  .checkout-footer { background: var(--surface); box-shadow: 0 -6px 16px rgba(0, 0, 0, 0.12); }
  .checkout-actions .btn { flex: 1; justify-content: center; }
  .checkout-catalog { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
  /* Item da conta: nome inteiro em cima, quantidade/valor/botoes embaixo */
  #checkoutItemLines .checkout-line { flex-wrap: wrap; row-gap: 6px; }
  #checkoutItemLines .checkout-line-main { flex: 1 0 100%; }
  #checkoutItemLines .checkout-line-main strong { white-space: normal; }
  #checkoutItemLines .checkout-line-price { margin-left: auto; }
}

/* ---------- Membros: mes pago ---------- */
.member-months { display: flex; flex-wrap: wrap; gap: 8px; }
.member-payment-preview {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--success-soft);
  color: var(--text);
  font-size: 0.85rem;
  line-height: 1.45;
}
.member-payment-preview i { color: var(--success); margin-top: 3px; }
.member-payment-preview small { display: block; margin-top: 4px; color: var(--text-muted); }
.member-detail-footer { flex-wrap: wrap; }
/* "Ja pago no mes do membro" no Fechar conta */
.checkout-prepaid {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--success-soft);
  color: var(--success);
  font-size: 0.82rem;
}
.checkout-prepaid i { margin-right: 4px; }
.member-pay-badge { white-space: nowrap; }

/* Promocoes: onde o banner fino aparece no site (SiteSettings.promoBannerPosition) */
.promo-position-card { padding: 16px 20px; margin-bottom: 20px; }
.promo-position-card .form-field { max-width: 420px; }

/* Botao "Perfil" no modal de editar agendamento (admin/js/appointmentModal.js) */
.ap-profile-btn { margin-left: 10px; margin-right: auto; flex-shrink: 0; }

/* Etiqueta "Membro" ao lado do nome na pagina Clientes (admin/js/pages/clientes.js) */
.member-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--violet-soft);
  color: var(--violet);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  vertical-align: middle;
}
.member-tag.is-paused { background: var(--surface-hover); color: var(--text-muted); }

/* "Ja e cliente?" no Novo Membro: busca pelo final do telefone (admin/js/pages/membros.js) */
#mbClientLookup { max-width: 160px; }
.client-lookup-results { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.client-lookup-results:empty { display: none; }
.client-lookup-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.85rem;
  text-align: left;
  cursor: pointer;
}
.client-lookup-item:hover { background: var(--surface-hover); border-color: var(--violet); }
.client-lookup-item span { color: var(--text-muted); font-size: 0.8rem; white-space: nowrap; }
.client-lookup-empty { font-size: 0.8rem; color: var(--text-muted); }

/* "Outras pessoas" no Novo Agendamento / Encaixe (admin/js/appointmentModal.js) */
.ap-guests-list { display: flex; flex-direction: column; gap: 10px; }
.ap-guests-list:not(:empty) { margin-bottom: 10px; }
.ap-add-guest-btn { align-self: flex-start; }
.ap-guest {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
}
.ap-guest-head { display: flex; align-items: center; justify-content: space-between; font-size: 0.85rem; }
.ap-guest-remove {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.ap-guest-remove:hover { background: var(--surface-hover); color: var(--danger); }
.ap-guest .service-picker { max-height: 170px; }
.ap-guest .time-grid { max-height: 190px; overflow-y: auto; }
