/* ===== RESET & BASE ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #F8F8F6;
  --surface-input: #F9FAFB;
  --surface-card: var(--bg-card);
  --surface-dropdown: var(--bg-card);
  --surface-modal: var(--surface-card);
  --modal-text: var(--text);
  --modal-label: var(--text);
  --modal-border: var(--border);
  --bg-card: #FFFFFF;
  --bg-card-hover: #F0F0EE;
  --gold: #6C3AED;
  --gold-light: #8B5CF6;
  --gold-dark: #5B21B6;
  --gold-bg: rgba(108,58,237,0.08);
  --gold-border: rgba(108,58,237,0.20);
  --text: #1A1A2E;
  --text-muted: #6B7280;
  --border: #E5E7EB;
  --sidebar-bg: #1B1340;
  --sidebar-active: #291D58;
  --sidebar-text: #C4B5FD;
  --sidebar-text-active: #FFFFFF;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Inter', Georgia, serif;
  --radius: 12px;
  --transition: 0.2s ease;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
  /* === RGB helpers (preenchidos dinamicamente pelo applySidebarThemeRGB) === */
  --gold-rgb: 108, 58, 237;
  --sidebar-bg-rgb: 27, 19, 64;
}

html, body {
  max-width: 100%;
  overflow-x: hidden; /* trava qualquer overflow horizontal global */
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ===== PAGE VISIBILITY ===== */
.page { display: none; min-width: 0; }
.page.active { display: block; }

/* ===== LOGIN PAGE ===== */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1B1340 0%, #291D58 50%, #3B2780 100%);
  padding: 20px;
}

.login-card {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.login-card .logo-img {
  width: 110px;
  height: 110px;
  border-radius: 16px;
  object-fit: contain;
  margin: 0 auto 14px;
  display: block;
}

.login-card h1 {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 800;
  margin-bottom: 6px;
  letter-spacing: -0.5px;
  line-height: 1;
  text-align: center;
}

.login-card .brand-title .brand-dark {
  color: #1A1A2E;
}

.login-card .brand-title .brand-accent {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--gold);
}

.login-card .subtitle {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 32px;
  text-align: center;
}
.login-card .form-group { margin-bottom: 16px; }

.login-card input {
  width: 100%; padding: 14px 16px; background: var(--surface-input); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: 0.95rem; font-family: var(--font); outline: none;
  transition: border var(--transition);
}

.login-card input:focus { border-color: var(--gold); }
.login-card input::placeholder { color: var(--text-muted); }

.btn-login {
  width: 100%; padding: 14px; background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: #fff; border: none; border-radius: 8px; font-size: 1rem; font-weight: 600;
  cursor: pointer; transition: all var(--transition); margin-top: 8px; font-family: var(--font);
}

.btn-login:hover {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  transform: translateY(-1px); box-shadow: 0 4px 20px rgba(108,58,237,0.3);
}

.login-error { color: #DC2626; font-size: 0.85rem; margin-top: 12px; display: none; }

/* ===== MAIN LAYOUT ===== */
.app-layout { display: flex; min-height: 100vh; }

/* ===== SIDEBAR ===== */
.sidebar {
  width: 250px; min-height: 100vh; background: var(--sidebar-bg);
  border-right: none; display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; z-index: 100;
}

.sidebar-header { display: flex; align-items: center; gap: 12px; padding: 24px 20px 32px; }
.sidebar-header img { width: 48px; height: 48px; border-radius: 12px; object-fit: contain; }
.sidebar-header .brand h2 { font-family: var(--font-display); color: #FFFFFF; font-size: 1.15rem; font-weight: 600; }
.sidebar-header .brand p { color: var(--sidebar-text); font-size: 0.8rem; }

.sidebar-nav { display: flex; flex-direction: column; gap: 4px; padding: 0 12px; flex: 1; }

.nav-btn {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: none;
  background: transparent; color: var(--sidebar-text); font-size: 0.95rem; font-family: var(--font);
  font-weight: 500; border-radius: 8px; cursor: pointer; transition: all var(--transition);
  text-align: left; width: 100%;
}

/* === MENU LATERAL: hover + selecionado UNIFICADOS (cor de destaque) ===
   Estrutura real: <button class="nav-btn"><i class="fa-..."></i> Texto</button>
   Texto = text node direto do <button>. Por isso a regra precisa estar no
   PRÓPRIO .nav-btn (não em filhos). Cobrimos também i/svg/span por garantia. */
.nav-btn {
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  border-left: 3px solid transparent;
}
.nav-btn:hover,
.nav-btn.active {
  background: rgba(var(--gold-rgb), 0.18) !important;
  border-left: 3px solid var(--gold) !important;
  font-weight: 600 !important;
  color: var(--gold) !important;
  -webkit-text-fill-color: var(--gold) !important; /* Safari/iOS */
  text-shadow: none !important;
}
/* Filhos diretos: ícones FA (<i>), SVG e qualquer span/strong/p herdam */
.nav-btn:hover i,
.nav-btn:hover span,
.nav-btn:hover strong,
.nav-btn:hover p,
.nav-btn.active i,
.nav-btn.active span,
.nav-btn.active strong,
.nav-btn.active p {
  color: var(--gold) !important;
  -webkit-text-fill-color: var(--gold) !important;
}
.nav-btn:hover svg,
.nav-btn.active svg,
.nav-btn:hover svg *,
.nav-btn.active svg * {
  fill: var(--gold) !important;
  stroke: var(--gold) !important;
  color: var(--gold) !important;
}
/* Override de seletores mais específicos do escopo .sidebar (caso existam) */
.sidebar .nav-btn:hover,
.sidebar .nav-btn.active,
.sidebar-nav .nav-btn:hover,
.sidebar-nav .nav-btn.active { color: var(--gold) !important; -webkit-text-fill-color: var(--gold) !important; }
.sidebar .nav-btn:hover i,
.sidebar .nav-btn.active i,
.sidebar-nav .nav-btn:hover i,
.sidebar-nav .nav-btn.active i { color: var(--gold) !important; }
.nav-btn i { width: 20px; text-align: center; font-size: 1rem; }

.sidebar-footer { padding: 20px; border-top: 1px solid rgba(255,255,255,0.1); }

.user-info { margin-bottom: 12px; font-size: 0.9rem; }

.btn-sair {
  display: flex; align-items: center; gap: 8px; background: none; border: none;
  color: var(--sidebar-text); font-family: var(--font); font-size: 0.9rem; cursor: pointer;
  transition: color var(--transition);
}
.btn-sair:hover { color: #FFFFFF; }

/* ===== MAIN CONTENT ===== */
.main-content { flex: 1; min-width: 0; margin-left: 250px; padding: 32px 40px; }

.page-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px;
}

.page-header h2 { font-family: var(--font-display); color: var(--text); font-size: 1.8rem; font-weight: 700; }

.page-header-actions { display: flex; gap: 10px; align-items: center; }

.btn-novo {
  display: flex; align-items: center; gap: 8px; padding: 10px 24px;
  background: linear-gradient(135deg, var(--gold), var(--gold-light)); color: #fff;
  border: none; border-radius: 24px; font-size: 0.9rem; font-weight: 600; cursor: pointer;
  font-family: var(--font); transition: all var(--transition); box-shadow: var(--shadow-sm);
}
.btn-novo:hover { transform: translateY(-1px); box-shadow: 0 4px 16px var(--gold-bg); }

.btn-filter {
  display: flex; align-items: center; gap: 6px; padding: 10px 20px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 24px;
  color: var(--gold); font-size: 0.9rem; font-weight: 500; cursor: pointer;
  font-family: var(--font); transition: all var(--transition); box-shadow: var(--shadow-sm);
}
.btn-filter:hover { background: var(--gold-bg); border-color: var(--gold-border); }

/* ===== FILTER BAR ===== */
.filter-bar {
  display: flex; gap: 8px; margin-bottom: 20px; padding: 12px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius); flex-wrap: wrap; box-shadow: var(--shadow-sm);
}

.filter-chip {
  padding: 8px 16px; border-radius: 20px; border: 1px solid var(--border); background: transparent;
  color: var(--text-muted); font-size: 0.85rem; cursor: pointer; font-family: var(--font);
  transition: all var(--transition); display: flex; align-items: center; gap: 8px;
}
.filter-chip.active { background: var(--gold); color: #fff; border-color: var(--gold); font-weight: 600; }
.filter-chip:hover { border-color: var(--gold); }

/* ===== AGENDAMENTOS ===== */
.agenda-grid { display: flex; gap: 24px; }

.calendar-card, .day-detail-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow-sm);
}

.calendar-card { min-width: 340px; }
.day-detail-card { flex: 1; min-height: 400px; position: relative; }

.calendar-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }

.calendar-nav button {
  background: none; border: none; color: var(--text-muted); font-size: 1.2rem;
  cursor: pointer; padding: 4px 8px; border-radius: 6px; transition: all var(--transition);
}
.calendar-nav button:hover { background: var(--bg-card-hover); color: var(--text); }
.calendar-nav .month-year { font-size: 1.1rem; font-weight: 600; color: var(--text); }

.calendar-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 8px; }
.calendar-weekdays span { text-align: center; font-size: 0.8rem; color: var(--text-muted); font-weight: 500; padding: 8px 0; }

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

.calendar-day {
  position: relative; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  border-radius: 8px; border: none; background: transparent; color: var(--text); font-size: 0.9rem;
  font-weight: 500; cursor: pointer; transition: all var(--transition); margin: 0 auto; font-family: var(--font);
}

.calendar-day:hover { background: var(--bg-card-hover); }
.calendar-day.today { border: 1px solid var(--gold); color: var(--gold); }
.calendar-day.selected { background: var(--gold); color: #fff; font-weight: 700; }
.calendar-day.today.selected { background: var(--gold); color: var(--cal-selected-text, #fff); font-weight: 700; }
.calendar-day.empty { cursor: default; }
.calendar-day.has-appointment::after {
  content: ''; position: absolute; bottom: 2px; width: 4px; height: 4px;
  background: var(--gold); border-radius: 50%;
}

.day-detail-header { font-size: 1.15rem; font-weight: 600; margin-bottom: 20px; color: var(--text); }

.no-appointments {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 200px; color: var(--text-muted);
}
.no-appointments i { font-size: 3rem; margin-bottom: 12px; opacity: 0.5; }

/* ===== TIMELINE ===== */
.timeline-container { position: relative; overflow-y: auto; max-height: 600px; }

.timeline { position: relative; min-height: 900px; }

.timeline-row {
  display: flex; align-items: flex-start; height: 60px; border-bottom: 1px solid rgba(0,0,0,0.05);
}

.timeline-hour {
  width: 60px; flex-shrink: 0; font-size: 0.8rem; color: var(--text-muted);
  padding-top: 2px; text-align: right; padding-right: 12px;
}

.timeline-slot { flex: 1; height: 100%; position: relative; }

.timeline-blocks {
  position: absolute; top: 0; left: 60px; right: 0; bottom: 0; pointer-events: none;
}

.timeline-block {
  position: absolute; left: 4px; right: 4px; background: linear-gradient(135deg, var(--gold-bg), rgba(108,58,237,0.12));
  border: 1px solid var(--gold-border); border-left: 3px solid var(--gold);
  border-radius: 8px; padding: 6px 10px; cursor: pointer; pointer-events: all;
  overflow: hidden; transition: background var(--transition); min-height: 0;
}

.timeline-block:hover { background: rgba(108,58,237,0.15); }

.tb-time { font-size: 0.75rem; color: var(--gold); font-weight: 700; }
.tb-client { font-size: 0.85rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-service { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tb-truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-row-compact { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.7rem; }
.tb-row-compact .tb-time { font-size: 0.7rem; }
.tb-row-compact .tb-client { font-size: 0.7rem; }
.tb-row-compact .tb-service { font-size: 0.7rem; }

/* ✅ FIX 2: Bloco "tiny" (≤ 22px) — para serviços muito curtos (ex: 10min) */
.timeline-block.tb-tiny {
  padding: 0 6px;
  border-radius: 6px;
  border-left-width: 2px;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}
.timeline-block.tb-tiny .tb-row-tiny {
  display: flex; align-items: center; gap: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  line-height: 1; width: 100%;
}
.timeline-block.tb-tiny .tb-time {
  font-size: 0.55rem; line-height: 1; flex-shrink: 0;
  color: var(--gold); font-weight: 700;
}
.timeline-block.tb-tiny .tb-client {
  font-size: 0.55rem; font-weight: 600; line-height: 1;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  min-width: 0; flex: 1;
}

/* ===== MULTI-AGENDA ===== */
.multi-agenda-container { position: relative; overflow-y: auto; max-height: 600px; }

.multi-agenda { position: relative; min-height: 900px; }

.multi-agenda-header {
  display: flex; position: sticky; top: 0; z-index: 5; background: var(--bg-card);
  border-bottom: 2px solid var(--gold-border); padding-bottom: 8px; margin-bottom: 4px;
}

.timeline-hour-header { width: 60px; flex-shrink: 0; }

.multi-agenda-col-header {
  flex: 1; text-align: center; font-size: 0.9rem; font-weight: 600; color: var(--gold);
  padding: 8px 0; display: flex; align-items: center; justify-content: center; gap: 8px;
}

.multi-agenda-body { position: relative; }

.multi-agenda-row {
  display: flex; height: 60px; border-bottom: 1px solid rgba(0,0,0,0.05);
}

.multi-agenda-cell {
  flex: 1; height: 100%; border-left: 1px solid rgba(0,0,0,0.05); position: relative;
}

.multi-agenda-blocks {
  position: absolute; top: 0; left: 60px; right: 0; bottom: 0; pointer-events: none;
}

/* ===== SERVICO BLOCK (modal) ===== */
.servico-block {
  background: var(--surface-input); border: 1px solid var(--border); border-radius: 10px;
  padding: 16px; margin-bottom: 12px; position: relative;
}

.servico-block-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px;
}

.servico-block-title { font-size: 0.85rem; color: var(--gold); font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }

.servico-remove-btn {
  background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1rem;
  padding: 2px 6px; transition: color var(--transition);
}
.servico-remove-btn:hover { color: #DC2626; }

.btn-add-servico {
  background: none; border: 1px dashed var(--gold-border); border-radius: 8px;
  color: var(--gold); font-family: var(--font); font-size: 0.9rem; cursor: pointer;
  padding: 10px; display: flex; align-items: center; justify-content: center;
  gap: 8px; width: 100%; margin-bottom: 16px; transition: all var(--transition);
}
.btn-add-servico:hover { background: var(--gold-bg); border-color: var(--gold); }

/* ===== GRID DROPDOWN ===== */
.pig-dropdown,
.base-grid-dropdown {
  position: absolute; top: 100%; left: 0; right: 0; background: var(--surface-card);
  border: 1px solid var(--border); border-radius: 10px; margin-top: 4px;
  z-index: 210; display: none; padding: 10px;
  /* Grid responsivo: cards entre 48px e 64px */
  grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
  gap: 8px;
  max-height: 260px; overflow-y: auto;
  box-shadow: var(--shadow-md);
  justify-items: stretch;
}

.pig-dropdown.open,
.base-grid-dropdown.open { display: grid; }

.pig-option,
.base-grid-option {
  width: 100%;
  height: 56px;            /* altura fixa moderada */
  max-width: 64px;         /* nunca explode em telas largas */
  border-radius: 8px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  border: 2px solid transparent;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.04);
}

.pig-option:hover,
.base-grid-option:hover {
  border-color: var(--gold);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.10);
}

.pig-code,
.base-grid-code {
  font-size: 0.68rem;
  color: #fff;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0,0,0,0.85);
  text-align: center;
  padding: 0 4px;
  line-height: 1.1;
  word-break: break-word;
}

@media (max-width: 600px) {
  .pig-dropdown,
  .base-grid-dropdown {
    grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
    padding: 8px;
    gap: 6px;
  }
  .pig-option,
  .base-grid-option {
    height: 48px;
    max-width: 56px;
  }
  .pig-code,
  .base-grid-code { font-size: 0.62rem; }
}

.pig-item, .base-item { position: relative; margin-bottom: 8px; }

.base-qtd-badge {
  font-size: 0.8rem; color: var(--gold); font-weight: 600; margin-left: auto; padding-right: 8px;
}

/* ===== CLIENTES ===== */
.birthday-banner {
  background: linear-gradient(135deg, var(--gold), var(--gold-light)); color: #fff;
  border-radius: var(--radius); padding: 16px 24px; margin-bottom: 24px;
  display: flex; align-items: center; gap: 12px; font-weight: 600; animation: fadeIn 0.5s ease;
}
.birthday-banner i { font-size: 1.5rem; }
.birthday-banner .names { font-weight: 400; margin-left: 4px; }

.clients-table-wrapper {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.clients-table { width: 100%; border-collapse: collapse; }

.clients-table th {
  text-align: left; padding: 14px 20px; font-size: 0.8rem; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text-muted); border-bottom: 1px solid var(--border); font-weight: 600;
}

.clients-table td {
  padding: 14px 20px; border-bottom: 1px solid var(--border); font-size: 0.95rem; cursor: pointer;
}

.clients-table tr:last-child td { border-bottom: none; }
.clients-table tr:hover td { background: var(--bg-card-hover); }
.clients-table .birthday-icon { color: var(--gold); margin-left: 6px; }


/* ===== AVATAR SYSTEM ===== */
.avatar {
  position: relative;
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  border: 2px solid var(--gold);
  box-shadow: 0 2px 10px rgba(108,58,237,0.22), 0 0 0 1px rgba(108,58,237,0.08);
  vertical-align: middle;
}

.avatar img {
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  border-radius: 50%;
  transform: none;
  filter: none;
}

/* Size variants */
.avatar--sm { width: 28px; height: 28px; min-width: 28px; min-height: 28px; font-size: 0.7rem; border-width: 1px; }
.avatar--md { width: 40px; height: 40px; min-width: 40px; min-height: 40px; font-size: 1rem; border-width: 2px; }
.avatar--lg { width: 56px; height: 56px; min-width: 56px; min-height: 56px; font-size: 1.4rem; border-width: 2px; }
.avatar--sidebar { width: 36px; height: 36px; min-width: 36px; min-height: 36px; font-size: 0.9rem; border-width: 1.5px; }
.avatar--chip { width: 26px; height: 26px; min-width: 26px; min-height: 26px; font-size: 0.65rem; border-width: 1px; box-shadow: none; }

/* ===== PROFISSIONAIS ===== */
.professionals-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px;
}

.professional-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow-sm);
}

.professional-card .card-header { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.professional-card .prof-info { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1; overflow: hidden; }
.professional-card .name { font-size: 1.15rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 70%; flex-shrink: 1; }
.professional-card .linked-badge { display: inline-flex; align-items: center; gap: 4px; background: rgba(108,58,237,0.07); color: var(--gold, #6C3AED); font-size: 0.68rem; font-weight: 500; padding: 2px 8px 2px 6px; border-radius: 20px; border: 1px solid rgba(108,58,237,0.12); letter-spacing: 0.01em; white-space: nowrap; flex-shrink: 0; max-width: 30%; overflow: hidden; text-overflow: ellipsis; }
.professional-card .btn-edit-prof { flex-shrink: 0; margin-left: auto; }
.professional-card .services-list { list-style: none; }

.professional-card .services-list li {
  padding: 6px 0; color: var(--text-muted); font-size: 0.9rem;
  display: flex; align-items: center; gap: 8px;
}
.professional-card .services-list li i { color: var(--gold); font-size: 0.75rem; }
.svc-dur { color: var(--text-muted); font-size: 0.8rem; opacity: 0.7; }

/* ===== DASHBOARD ===== */
.dash-filters {
  display: flex; gap: 16px; align-items: flex-end; margin-bottom: 28px;
  padding: 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.dash-filters .form-group { margin-bottom: 0; }
.btn-dash-apply { padding: 12px 24px; flex: none; }

.dash-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px; margin-bottom: 28px;
}

.dash-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; text-align: center; box-shadow: var(--shadow-sm);
}

.dash-card-title {
  font-size: 0.8rem; color: var(--text-muted); margin-bottom: 12px;
  text-transform: uppercase; letter-spacing: 1.5px; font-weight: 500;
}
.dash-card-value {
  font-size: 2rem; font-weight: 700; color: var(--gold);
  font-family: var(--font-display); letter-spacing: 0.5px;
}

.dash-section {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; margin-bottom: 24px; box-shadow: var(--shadow-sm);
}

.dash-section h3 {
  font-family: var(--font-display); color: var(--text); font-size: 1.2rem;
  margin-bottom: 20px; font-weight: 600;
}

.dash-row { display: flex; gap: 24px; }
.dash-half { flex: 1; }

.dash-table-wrapper { overflow-x: auto; }

.dash-table { width: 100%; border-collapse: collapse; }
.dash-table th {
  text-align: left; padding: 12px 16px; font-size: 0.75rem; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text-muted); border-bottom: 1px solid var(--border); font-weight: 600;
}
.dash-table td {
  padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 0.9rem;
  font-family: var(--font);
}

/* Dashboard line chart */
.dash-chart { padding: 16px 0; position: relative; }
.dash-chart-canvas { width: 100%; position: relative; min-height: 280px; }
.dash-chart-legend { display: flex; gap: 24px; justify-content: center; margin-bottom: 16px; }
.dash-legend-item { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; color: var(--text-muted); }
.dash-legend-dot { width: 10px; height: 10px; border-radius: 50%; }
.dash-chart-svg { width: 100%; height: 280px; }

.dash-bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.dash-bar-label { width: 50px; font-size: 0.8rem; color: var(--text-muted); text-align: right; }
.dash-bar-track { flex: 1; height: 24px; background: var(--bg-card-hover); border-radius: 6px; overflow: hidden; }
.dash-bar-fill {
  height: 100%; background: linear-gradient(90deg, var(--gold-dark), var(--gold));
  border-radius: 6px; transition: width 0.5s ease;
}
.dash-bar-value { width: 30px; font-size: 0.8rem; color: var(--gold); font-weight: 600; }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center; z-index: 200;
  padding: 16px; overflow-y: auto;
  /* iOS/Android: usa altura dinâmica para considerar barra de URL e teclado */
  height: 100vh;
  height: 100dvh;
  -webkit-overflow-scrolling: touch;
}

.modal-overlay.active { display: flex; }

.modal {
  background: var(--surface-modal); border: 1px solid var(--modal-border); border-radius: var(--radius);
  padding: 32px; width: 100%; max-width: 520px; max-height: 90vh; max-height: 90dvh; overflow-y: auto; overflow-x: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15); animation: slideUp 0.3s ease;
  -webkit-overflow-scrolling: touch;
}

.modal.modal-small { max-width: 400px; }
.modal.modal-lg { max-width: 1200px; }

.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.modal-header h3 { font-family: var(--font-display); color: var(--modal-text); font-size: 1.4rem; font-weight: 600; }

.modal-close {
  background: none; border: none; color: var(--text-muted); font-size: 1.4rem;
  cursor: pointer; transition: color var(--transition); padding: 4px;
}
.modal-close:hover { color: var(--text); }

.form-group { margin-bottom: 16px; }

.form-group label { display: block; color: var(--modal-label); font-size: 0.85rem; font-weight: 500; margin-bottom: 6px; }

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%; padding: 12px 14px; background: var(--surface-input); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: 0.95rem; font-family: var(--font); outline: none;
  transition: border var(--transition);
}

.form-group input[type="checkbox"] { width: auto; }
.form-group input[type="file"] { padding: 8px 14px; }

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--gold); }

.form-group select option { background: var(--surface-card); color: var(--text); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.modal-actions { display: flex; gap: 12px; margin-top: 24px; }

.btn-cancel {
  flex: 1; padding: 12px; background: transparent; border: 1px solid var(--modal-border);
  border-radius: 8px; color: var(--modal-text); font-size: 0.95rem; font-family: var(--font);
  cursor: pointer; transition: all var(--transition);
}
.btn-cancel:hover { border-color: var(--text-muted); background: var(--surface-input); }

.btn-submit {
  flex: 1; padding: 12px; background: linear-gradient(135deg, var(--gold), var(--gold-light));
  border: none; border-radius: 8px; color: #fff; font-size: 0.95rem; font-weight: 600;
  font-family: var(--font); cursor: pointer; transition: all var(--transition);
}
.btn-submit:hover { box-shadow: 0 4px 16px var(--gold-bg); transform: translateY(-1px); }

.btn-delete {
  flex: 1; padding: 12px; background: #DC2626; border: none; border-radius: 8px;
  color: #fff; font-size: 0.95rem; font-weight: 600; font-family: var(--font);
  cursor: pointer; transition: all var(--transition); display: flex; align-items: center;
  justify-content: center; gap: 8px;
}
.btn-delete:hover { background: #B91C1C; box-shadow: 0 4px 16px rgba(220,38,38,0.3); }

/* ===== COR DROPDOWN CUSTOM ===== */
.cor-select-wrapper, .base-item, .pig-item { position: relative; margin-bottom: 8px; }

.cor-select-display {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--surface-input);
  border: 1px solid var(--border); border-radius: 8px; cursor: pointer;
  transition: border var(--transition); min-height: 46px;
}
.cor-select-display:hover { border-color: var(--gold); }

.cor-swatch {
  width: 24px; height: 24px; border-radius: 6px; border: 1px dashed rgba(0,0,0,0.15); flex-shrink: 0;
}

.cor-select-display .cor-label { font-size: 0.95rem; color: var(--text); }
.cor-select-display .cor-label.placeholder { color: var(--text-muted); }

.cor-dropdown {
  position: absolute; top: 100%; left: 0; right: 0; background: var(--surface-card);
  border: 1px solid var(--border); border-radius: 8px; margin-top: 4px;
  z-index: 210; display: none; max-height: 220px; overflow-y: auto; box-shadow: var(--shadow-md);
}
.cor-dropdown.open { display: block; }

.cor-option {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer;
  transition: background var(--transition); font-size: 0.95rem;
}
.cor-option:hover { background: var(--bg-card-hover); }

.cor-remove-btn {
  background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1rem;
  padding: 2px 6px; margin-left: auto; transition: color var(--transition);
}
.cor-remove-btn:hover { color: #DC2626; }

.btn-add-cor {
  background: none; border: none; color: var(--gold); font-family: var(--font); font-size: 0.9rem;
  cursor: pointer; padding: 8px 0; display: flex; align-items: center; gap: 6px;
  transition: opacity var(--transition);
}
.btn-add-cor:hover { opacity: 0.8; }
.btn-add-cor.disabled { opacity: 0.3; cursor: not-allowed; pointer-events: none; }

/* ===== HISTORICO ===== */
.historico-info { margin-bottom: 20px; }
.historico-info p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 4px; }
.historico-info strong { color: var(--text); }

.historico-lista { list-style: none; max-height: 400px; overflow-y: auto; }
.historico-lista li {
  padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; color: var(--text-muted);
}
.historico-lista li:last-child { border-bottom: none; }
.historico-lista .hist-data { color: var(--gold); font-weight: 600; margin-right: 8px; }
.hist-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.hist-item-body {
  line-height: 1.6;
}

.hist-cor-badge {
  display: inline-flex; align-items: center; gap: 4px; background: var(--bg-card-hover);
  border-radius: 4px; padding: 2px 6px; font-size: 0.8rem; margin: 0 2px;
}

.hist-cor-swatch {
  width: 12px; height: 12px; border-radius: 3px; border: 1px solid rgba(0,0,0,0.1);
  display: inline-block;
}

/* ===== HISTÓRICO: Status Badge (Cliente desmarcado / cancelado) ===== */
.hist-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 12px;
  padding: 3px 9px;
  font-size: 0.72rem;
  font-weight: 600;
  margin-left: 8px;
  vertical-align: middle;
  letter-spacing: 0.2px;
  line-height: 1;
}
.hist-status-badge i { font-size: 0.7rem; }

.hist-status-desmarcado {
  background: #c62828;
  color: #ffffff;
  border: 1px solid #b71c1c;
}

.historico-lista li.hist-item-desmarcado {
  opacity: 0.78;
  background: linear-gradient(90deg, rgba(192,57,43,0.04), transparent 60%);
  border-left: 3px solid #c0392b;
  padding-left: 10px;
}
.historico-lista li.hist-item-desmarcado .hist-data {
  color: var(--text-muted);
  text-decoration: line-through;
}
.historico-lista li.hist-item-desmarcado .hist-item-body {
  color: var(--text-muted);
}

/* ===== BADGES DE STATUS DOS PACOTES (aba Pacotes do histórico) ===== */
.hist-pacote-badge.status-ativo     { background:#16a34a; color:#fff; border:1px solid #15803d; }
.hist-pacote-badge.status-alerta    { background:#eab308; color:#1a1a1a; border:1px solid #ca8a04; }
.hist-pacote-badge.status-expirado  { background:#dc2626; color:#fff; border:1px solid #b91c1c; }
.hist-pacote-badge.status-concluido { background:#2563eb; color:#fff; border:1px solid #1d4ed8; }

/* ===== TOAST (top-center, acima de qualquer modal) ===== */
.toast {
  position: fixed !important;
  top: 24px !important;
  left: 50% !important;
  right: auto !important;
  bottom: auto !important;
  transform: translateX(-50%) translateY(-20px) !important;
  background: #16a34a !important;
  background-color: #16a34a !important;
  background-image: none !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 10px !important;
  padding: 14px 22px !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  font-size: 0.95rem !important;
  font-weight: 500 !important;
  z-index: 99999 !important;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  box-shadow: 0 10px 30px rgba(0,0,0,0.18) !important;
  max-width: calc(100vw - 32px);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0) !important;
  pointer-events: auto;
}
.toast i { color: #ffffff !important; font-size: 1.2rem; }
.toast.hide { opacity: 0; transform: translateX(-50%) translateY(-20px) !important; }
.toast.toast-success { background: #16a34a !important; background-color: #16a34a !important; color: #fff !important; }
.toast.toast-success i { color: #ffffff !important; }
.toast.toast-error { background: #dc2626 !important; background-color: #dc2626 !important; color: #fff !important; }
.toast.toast-error i { color: #ffffff !important; }
.toast.toast-warning { background: #d97706 !important; background-color: #d97706 !important; color: #fff !important; }
.toast.toast-warning i { color: #ffffff !important; }
.toast.toast-info { background: #2563eb !important; background-color: #2563eb !important; color: #fff !important; }
.toast.toast-info i { color: #ffffff !important; }

/* ===== HAMBURGER ===== */
.hamburger {
  display: none; position: fixed; top: 16px; left: 16px; z-index: 110;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px;
  padding: 10px; cursor: pointer; color: var(--gold); font-size: 1.3rem; line-height: 1;
}

.sidebar-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  backdrop-filter: blur(3px); z-index: 90;
}
.sidebar-overlay.active { display: block; }

.sidebar .close-sidebar {
  display: none; position: absolute; top: 16px; right: 16px; background: none;
  border: none; color: var(--sidebar-text); font-size: 1.2rem; cursor: pointer;
}

/* ===== SIDEBAR USER INFO ===== */
.sidebar-footer .user-info { display: flex; align-items: center; gap: 10px; }
.sidebar-footer .user-info .user-details { display: flex; flex-direction: column; gap: 2px; }
.sidebar-footer .user-info .user-name { color: #FFFFFF; font-weight: 600; font-size: 0.9rem; }
.sidebar-footer .user-info .user-role { color: var(--sidebar-text); font-size: 0.75rem; text-transform: capitalize; }

/* ===== ANIMATIONS ===== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInLeft { from { transform: translateX(-100%); } to { transform: translateX(0); } }

/* ===== SCROLLBAR ===== */
.modal::-webkit-scrollbar, .timeline-container::-webkit-scrollbar, .multi-agenda-container::-webkit-scrollbar { width: 6px; }
.modal::-webkit-scrollbar-track, .timeline-container::-webkit-scrollbar-track, .multi-agenda-container::-webkit-scrollbar-track { background: var(--surface-input); border-radius: 3px; }
.modal::-webkit-scrollbar-thumb, .timeline-container::-webkit-scrollbar-thumb, .multi-agenda-container::-webkit-scrollbar-thumb { background: var(--gold-border); border-radius: 3px; }
.modal::-webkit-scrollbar-thumb:hover, .timeline-container::-webkit-scrollbar-thumb:hover, .multi-agenda-container::-webkit-scrollbar-thumb:hover { background: var(--gold); }
.modal, .timeline-container, .multi-agenda-container { scrollbar-width: thin; scrollbar-color: var(--gold-border) var(--surface-input); }

.modal-overlay::-webkit-scrollbar { width: 6px; }
.modal-overlay::-webkit-scrollbar-track { background: transparent; }
.modal-overlay::-webkit-scrollbar-thumb { background: var(--gold-border); border-radius: 3px; }
.modal-overlay { scrollbar-width: thin; scrollbar-color: var(--gold-border) transparent; }

.historico-lista::-webkit-scrollbar { width: 5px; }
.historico-lista::-webkit-scrollbar-track { background: var(--surface-input); border-radius: 3px; }
.historico-lista::-webkit-scrollbar-thumb { background: var(--gold-border); border-radius: 3px; }
.historico-lista::-webkit-scrollbar-thumb:hover { background: var(--gold); }
.historico-lista { scrollbar-width: thin; scrollbar-color: var(--gold-border) var(--surface-input); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .hamburger { display: block; }
  .sidebar { transform: translateX(-100%); transition: transform 0.3s ease; width: 280px; }
  .sidebar.open { transform: translateX(0); animation: slideInLeft 0.3s ease; }
  .sidebar .close-sidebar { display: block; }
  .main-content { margin-left: 0; padding: 20px 16px; padding-top: 64px; min-width: 0; max-width: 100%; overflow-x: hidden; }
  .page-header { position: relative; z-index: 1; }
  .page-header h2 { font-size: 1.4rem; margin-left: 48px; }
  .agenda-grid { flex-direction: column; }
  .calendar-card { min-width: auto; }
  .form-row { grid-template-columns: 1fr; }
  .modal { padding: 24px 20px; max-height: 95dvh; }
  .dash-row { flex-direction: column; }
  .dash-filters { flex-wrap: wrap; }
  .dash-grid { grid-template-columns: 1fr 1fr; }
  .multi-agenda-col-header { font-size: 0.75rem; }
  .timeline-hour { width: 45px; font-size: 0.7rem; }

  /* Garante que o modal não fique centralizado quando o conteúdo é alto
     (em portrait com teclado virtual o botão Salvar/Cadastrar sumia). */
  .modal-overlay { align-items: flex-start; padding: 12px; }

  /* Botões de ação ficam fixos no rodapé do modal para nunca sumirem */
  .modal-actions {
    position: sticky;
    bottom: 0;
    background: var(--surface-modal);
    padding: 16px 0 4px;
    margin-top: 16px;
    z-index: 2;
    box-shadow: 0 -8px 12px -8px rgba(0,0,0,0.08);
  }
}

@media (max-width: 480px) {
  .page-header h2 { font-size: 1.2rem; }
  .btn-novo { padding: 8px 16px; font-size: 0.85rem; }
  .dash-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .dash-filters {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px;
    align-items: stretch;
  }
  /* Datas lado a lado em duas colunas, ocupando metade cada */
  .dash-filters .form-group {
    flex: 1 1 calc(50% - 5px);
    min-width: 0;
    width: auto;
  }
  /* Profissional e botão ocupam linha inteira */
  .dash-filters #dash-prof-wrapper { flex: 1 1 100%; }
  .btn-dash-apply { width: 100%; flex: 1 1 100%; padding: 10px 16px; }

  /* Inputs de data menores no mobile para caber no box */
  .dash-filters .form-group label {
    font-size: 0.75rem;
    margin-bottom: 4px;
  }
  .dash-filters .form-group input,
  .dash-filters .form-group select {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 9px 10px;
    font-size: 0.85rem;
    box-sizing: border-box;
  }
  /* Corrige largura intrínseca dos inputs date no iOS/Safari */
  .dash-filters input[type="date"] {
    -webkit-appearance: none;
    appearance: none;
    min-width: 0;
    max-width: 100%;
    width: 100%;
    display: block;
  }
  .dash-filters input[type="date"]::-webkit-date-and-time-value {
    text-align: left;
    min-width: 0;
  }
  .dash-filters input[type="date"]::-webkit-calendar-picker-indicator {
    margin-left: 4px;
    padding: 0;
  }

  .dash-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .dash-card { padding: 14px 12px; }
  .dash-card-value { font-size: 1.3rem; }
  .dash-card-title { font-size: 0.7rem; letter-spacing: 1px; margin-bottom: 8px; }
  .dash-row { flex-direction: column; gap: 16px; }
  .dash-half { flex: none; width: 100%; }
  .dash-section { padding: 14px; margin-bottom: 16px; }
  .dash-section h3 { font-size: 1rem; margin-bottom: 14px; }
  .dash-table th, .dash-table td { padding: 8px 10px; font-size: 0.8rem; }
  .dash-chart-legend { flex-wrap: wrap; gap: 12px; }
  .dash-chart-canvas { min-height: 200px; overflow-x: auto; }
}

@media (max-width: 380px) {
  .dash-filters .form-group { flex: 1 1 100%; }
  .dash-grid { grid-template-columns: 1fr; }
}

@media (max-width: 400px) {
  .dash-card-value { font-size: 1.2rem; }
  .dash-card-title { font-size: 0.7rem; }
}

/* ===== CSS ADICIONAL: Serviços CRUD ===== */
.prof-admin-bar { display: flex; justify-content: flex-end; margin-bottom: 16px; width: 100%; }

.btn-edit-prof {
  background: none; border: none; color: var(--gold); cursor: pointer; font-size: 0.9rem;
  padding: 4px 8px; border-radius: 6px; transition: background 0.2s; margin-left: auto;
}
.btn-edit-prof:hover { background: var(--gold-bg); }

.servico-crud-header { display: flex; justify-content: flex-end; margin-bottom: 16px; }

.servico-crud-row {
  display: flex; align-items: center; padding: 10px 14px;
  border-bottom: 1px solid var(--border); gap: 12px;
}
.servico-crud-row:last-child { border-bottom: none; }
.servico-crud-nome { flex: 1; font-weight: 500; color: var(--text); }
.servico-crud-info { color: var(--text-muted); font-size: 0.85rem; white-space: nowrap; }

.servico-crud-actions { display: flex; gap: 6px; }

.btn-icon {
  background: none; border: 1px solid var(--border); color: var(--text-muted); cursor: pointer;
  padding: 6px 8px; border-radius: 6px; font-size: 0.8rem; transition: all 0.2s;
}
.btn-icon:hover { background: var(--bg-card-hover); color: var(--text); }
.btn-icon.btn-danger:hover { background: rgba(220,38,38,0.08); color: #DC2626; border-color: rgba(220,38,38,0.3); }

.vincular-servicos-list { display: flex; flex-direction: column; gap: 8px; max-height: 400px; overflow-y: auto; padding: 8px 0; }

.vincular-servico-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 8px;
  cursor: pointer; transition: background 0.2s; font-size: 0.95rem; color: var(--text);
}
.vincular-servico-item:hover { background: var(--bg-card-hover); }
.vincular-servico-item input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--gold); cursor: pointer; }

.modal-body { padding: 0 4px; }

/* ===== GERENCIAR CORES DO SERVIÇO ===== */
.cores-section { margin-bottom: 24px; }
.cores-section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cores-section-header h4 { font-family: var(--font-display); color: var(--text); font-size: 1rem; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.cores-section-header h4 i { font-size: 0.9rem; }

.btn-add-cor-small {
  background: none; border: 1px solid var(--gold-border); color: var(--gold); cursor: pointer;
  padding: 6px 10px; border-radius: 6px; font-size: 0.85rem; transition: all 0.2s;
  display: flex; align-items: center; gap: 4px;
}
.btn-add-cor-small:hover { background: var(--gold-bg); border-color: var(--gold); }

.cores-list { display: flex; flex-direction: column; gap: 6px; }
.cores-empty { color: var(--text-muted); font-size: 0.85rem; font-style: italic; padding: 12px 0; }

.cor-crud-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  border-bottom: 1px solid var(--border); border-radius: 8px; transition: background 0.2s;
}
.cor-crud-row:hover { background: var(--surface-input); }

.cor-crud-swatch { width: 28px; height: 28px; border-radius: 6px; border: 1px solid rgba(0,0,0,0.1); flex-shrink: 0; }
.cor-crud-nome { flex: 1; font-weight: 500; color: var(--text); font-size: 0.95rem; }
.cor-crud-hex { color: var(--text-muted); font-size: 0.8rem; font-family: monospace; }
.cor-crud-actions { display: flex; gap: 6px; }

/* Color Picker Row */
.cor-picker-row { display: flex; align-items: center; gap: 12px; }
.cor-picker-row input[type="color"] {
  width: 48px; height: 48px; padding: 2px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface-input); cursor: pointer; flex-shrink: 0;
}
.cor-picker-row input[type="color"]::-webkit-color-swatch-wrapper { padding: 2px; }
.cor-picker-row input[type="color"]::-webkit-color-swatch { border: none; border-radius: 4px; }
.cor-picker-row input[type="text"] {
  flex: 1; padding: 12px 14px; background: var(--surface-input); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: 0.95rem; font-family: monospace; outline: none;
  transition: border 0.2s;
}
.cor-picker-row input[type="text"]:focus { border-color: var(--gold); }
.cor-crud-preview { width: 48px; height: 48px; border-radius: 8px; border: 1px solid rgba(0,0,0,0.1); flex-shrink: 0; }

.btn-cores-svc { color: var(--gold) !important; border-color: var(--gold-border) !important; font-size: 0.85rem !important; display: flex; align-items: center; gap: 4px; }
.btn-cores-svc:hover { background: var(--gold-bg) !important; }


/* ============================================================ */
/* CONFIGURAÇÕES PAGE                                            */
/* ============================================================ */

.config-layout { display: flex; gap: 0; min-height: 500px; }

/* No mobile, o min-height: 500px do layout cria espaço vazio enorme
   quando o conteúdo da aba é curto. Removemos para deixar a altura natural. */
@media (max-width: 900px) {
  .config-layout { min-height: 0; }
}

.config-sidebar {
  width: 220px; flex-shrink: 0; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius) 0 0 var(--radius); padding: 16px 0;
  display: flex; flex-direction: column; gap: 4px;
}

.config-tab {
  display: flex; align-items: center; gap: 10px; padding: 12px 20px; border: none;
  background: transparent; color: var(--text-muted); font-size: 0.95rem; font-family: var(--font);
  font-weight: 500; cursor: pointer; transition: all var(--transition); text-align: left;
  width: 100%; border-left: 3px solid transparent;
}
.config-tab:hover { background: var(--bg-card-hover); color: var(--text); }
.config-tab.active { background: var(--gold-bg); color: var(--gold); border-left-color: var(--gold); }
.config-tab i { width: 20px; text-align: center; font-size: 1rem; }

.config-content {
  flex: 1; background: var(--bg-card); border: 1px solid var(--border); border-left: none;
  border-radius: 0 var(--radius) var(--radius) 0; padding: 32px 40px; overflow-y: auto;
}

.config-panel { display: none; }
.config-panel.active { display: block; }

.config-section { display: flex; gap: 40px; padding: 28px 0; border-bottom: 1px solid var(--border); }
.config-section:last-of-type { border-bottom: none; }
.config-section-left { width: 280px; flex-shrink: 0; }
.config-section-left h3 { font-family: var(--font-display); color: var(--text); font-size: 1.1rem; font-weight: 600; margin-bottom: 8px; }
.config-help-text { color: var(--text-muted); font-size: 0.9rem; line-height: 1.5; }
.config-section-right { flex: 1; }

.config-foto-area { display: flex; align-items: center; gap: 20px; }
.perfil-avatar-wrapper { flex-shrink: 0; }

.avatar--xl { width: 80px; height: 80px; min-width: 80px; min-height: 80px; font-size: 2rem; border-width: 2px; }

.perfil-foto-actions { display: flex; flex-direction: column; gap: 8px; }

.btn-upload-foto {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px;
  background: var(--gold-bg); border: 1px solid var(--gold-border); border-radius: 8px;
  color: var(--gold); font-size: 0.85rem; font-weight: 500; cursor: pointer;
  font-family: var(--font); transition: all var(--transition);
}
.btn-upload-foto:hover { background: rgba(108,58,237,0.15); border-color: var(--gold); }

.btn-remover-foto {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 16px; background: transparent; border: 1px solid #DC2626; border-radius: 8px;
  color: #DC2626; font-size: 0.85rem; font-weight: 500; cursor: pointer;
  font-family: var(--font); transition: all var(--transition); letter-spacing: 0.5px;
}
.btn-remover-foto:hover { background: rgba(220,38,38,0.06); }

.config-actions {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 24px; margin-top: 8px;
}

.btn-alterar-senha {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 24px;
  background: linear-gradient(135deg, var(--gold), var(--gold-light)); border: none;
  border-radius: 8px; color: #fff; font-size: 0.9rem; font-weight: 600; cursor: pointer;
  font-family: var(--font); transition: all var(--transition); letter-spacing: 0.5px;
}
.btn-alterar-senha:hover { box-shadow: 0 4px 16px rgba(108,58,237,0.3); transform: translateY(-1px); }

.btn-salvar-perfil {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 24px;
  flex: none; opacity: 0.7; cursor: pointer; transition: opacity var(--transition);
}
.btn-salvar-perfil:hover { opacity: 1; }

.config-section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.config-section-header h3 { font-family: var(--font-display); color: var(--text); font-size: 1.4rem; font-weight: 600; }
.config-users-count { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 16px; }

.config-users-table-wrapper { overflow-x: auto; }
.config-users-table { width: 100%; border-collapse: collapse; }
.config-users-table th {
  text-align: left; padding: 14px 20px; font-size: 0.8rem; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text-muted); border-bottom: 1px solid var(--border); font-weight: 600;
}
.config-users-table td { padding: 14px 20px; border-bottom: 1px solid var(--border); font-size: 0.95rem; }
.config-users-table tr:last-child td { border-bottom: none; }
.config-users-table tr:hover td { background: var(--surface-input); }

.role-badge {
  display: inline-block; padding: 4px 12px; border-radius: 20px;
  font-size: 0.8rem; font-weight: 600; text-transform: capitalize;
}
.role-badge.admin { background: var(--gold-bg); color: var(--gold); border: 1px solid var(--gold-border); }
.role-badge.colaborador { background: var(--bg-card-hover); color: var(--text-muted); border: 1px solid var(--border); }
.role-badge.master_admin { background: rgba(220,38,38,0.08); color: #DC2626; border: 1px solid rgba(220,38,38,0.2); }

.config-users-cards { display: none; }

.user-card {
  background: var(--surface-input); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; margin-bottom: 12px;
}
.user-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.user-card-name { font-weight: 600; color: var(--text); font-size: 1rem; }
.user-card-email { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 8px; }
.user-card-footer { display: flex; align-items: center; justify-content: space-between; }

.config-form-section { margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.config-form-section:last-of-type { border-bottom: none; padding-bottom: 0; }
.config-form-section h4 { font-family: var(--font-display); color: var(--gold); font-size: 1.1rem; font-weight: 600; margin-bottom: 6px; }

/* ===== CONFIGURAÇÕES RESPONSIVE ===== */
@media (max-width: 900px) {
  .config-layout { flex-direction: column; min-width: 0; }
  .config-sidebar {
    /* No mobile, transformamos o menu lateral em uma GRADE de abas
       para que TODAS as opções (Geral, Meu Perfil, Usuários,
       Dados Cadastrais, Tema da Agenda) fiquem sempre visíveis
       sem depender de scroll horizontal. */
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 10px;
    border-radius: var(--radius) var(--radius) 0 0;
    overflow: visible;
  }
  .config-tab {
    width: 100%;
    min-width: 0;
    padding: 10px 12px;
    border-left: none;
    border-bottom: 3px solid transparent;
    border-radius: 8px;
    background: var(--surface-input, transparent);
    white-space: normal;
    justify-content: center;
    text-align: center;
    font-size: 0.88rem;
    line-height: 1.2;
    overflow-wrap: anywhere;
  }
  .config-tab i { font-size: 0.95rem; }
  .config-tab.active { border-left-color: transparent; border-bottom-color: var(--gold); }
  .config-content {
    border-left: 1px solid var(--border); border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    padding: 24px 20px;
    min-width: 0; /* permite que filhos com flex encolham */
    overflow-x: hidden;
  }
  .config-section { flex-direction: column; gap: 16px; min-width: 0; }
  .config-section-left { width: 100%; }
  .config-section-right { min-width: 0; width: 100%; }
  .config-actions { flex-direction: column; gap: 12px; }
  .btn-alterar-senha, .btn-salvar-perfil { width: 100%; justify-content: center; }
}

@media (max-width: 480px) {
  .config-content { padding: 18px 14px; }
  .config-section { padding: 20px 0; }
  .config-section-left h3 { font-size: 1rem; }
  .config-help-text { font-size: 0.85rem; }
  .config-sidebar { gap: 5px; padding: 8px; }
  .config-tab { padding: 9px 8px; font-size: 0.78rem; gap: 6px; }
  .config-tab i { font-size: 0.9rem; }
}

@media (max-width: 768px) {
  .config-users-table-wrapper { display: none; }
  .config-users-cards { display: block; }
  .config-foto-area { flex-direction: column; align-items: flex-start; }
}

/* ============================================================ */
/* PROFISSIONAIS CRUD                                            */
/* ============================================================ */
.edit-prof-section { margin-bottom: 16px; }
.edit-prof-foto-area, .criar-prof-foto-area { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.edit-prof-foto-actions, .criar-prof-foto-actions { display: flex; flex-direction: column; gap: 8px; }
.foto-recomendacao { color: var(--text-muted); font-size: 0.75rem; font-style: italic; margin: 0; }

@media (max-width: 480px) {
  .edit-prof-foto-area, .criar-prof-foto-area { flex-direction: column; align-items: flex-start; }
  .page-header-actions { flex-wrap: wrap; gap: 6px; }
  .page-header-actions .btn-novo, .page-header-actions .btn-filter { font-size: 0.8rem; padding: 8px 12px; }
}

/* ===== SELECT TENANT PAGE ===== */
.select-tenant-wrapper {
  min-height: 100vh;
  background: var(--bg);
  padding: 32px 40px;
  max-width: 1200px;
  margin: 0 auto;
}

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

.select-tenant-header h1 {
  font-family: var(--font-display); color: var(--text); font-size: 1.6rem;
  font-weight: 700; letter-spacing: 1px;
}

.select-tenant-header p { color: var(--text-muted); font-size: 0.9rem; margin-top: 4px; }

.select-tenant-header-right { display: flex; gap: 12px; align-items: center; }

.btn-criar-tenant {
  display: flex; align-items: center; gap: 8px; padding: 12px 24px;
  background: var(--bg-card); border: 1px solid var(--gold-border); border-radius: 8px;
  color: var(--gold); font-size: 0.9rem; font-weight: 600; cursor: pointer;
  font-family: var(--font); transition: all var(--transition); box-shadow: var(--shadow-sm);
}
.btn-criar-tenant:hover { background: var(--gold-bg); }

.btn-continuar {
  display: flex; align-items: center; gap: 8px; padding: 12px 32px;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  border: none; border-radius: 8px; color: #fff; font-size: 1rem; font-weight: 700;
  cursor: pointer; font-family: var(--font); transition: all var(--transition); letter-spacing: 1px;
}
.btn-continuar:hover { box-shadow: 0 4px 20px rgba(108,58,237,0.3); transform: translateY(-1px); }
.btn-continuar:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }

.select-tenant-search { margin-bottom: 24px; }
.select-tenant-search input {
  width: 100%; max-width: 420px; padding: 12px 16px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: 24px; color: var(--text);
  font-size: 0.95rem; font-family: var(--font); outline: none;
  transition: border var(--transition); box-shadow: var(--shadow-sm);
}
.select-tenant-search input:focus { border-color: var(--gold); }
.select-tenant-search input::placeholder { color: var(--text-muted); }

.tenant-section {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; margin-bottom: 24px; box-shadow: var(--shadow-sm);
}

.tenant-section-header {
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; margin-bottom: 16px; color: var(--text-muted); font-size: 0.95rem;
}
.tenant-section-header span { display: flex; align-items: center; gap: 8px; }

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

.tenant-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px 16px; text-align: center; cursor: pointer;
  transition: all var(--transition); box-shadow: var(--shadow-sm);
}
.tenant-card:hover { border-color: var(--gold); background: var(--surface-input); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.tenant-card.selected { border-color: var(--gold); background: var(--gold-bg); box-shadow: 0 0 20px rgba(108,58,237,0.1); }

.tenant-card-avatar {
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 12px;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; font-weight: 700; color: #fff;
  border: 2px solid var(--gold); overflow: hidden;
}

.tenant-card-avatar img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
}

.tenant-card-id { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 4px; font-family: monospace; }
.tenant-card-nome { font-size: 1rem; font-weight: 600; color: var(--text); }

.select-tenant-footer { margin-top: 40px; text-align: center; }
.btn-sair-tenant {
  background: none; border: 1px solid var(--border); border-radius: 8px;
  color: var(--text-muted); padding: 10px 20px; cursor: pointer;
  font-family: var(--font); font-size: 0.9rem; transition: all var(--transition);
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-sair-tenant:hover { border-color: var(--text-muted); color: var(--text); }

@media (max-width: 768px) {
  .select-tenant-wrapper { padding: 20px 16px; }
  .select-tenant-header { flex-direction: column; }
  .select-tenant-header-right { width: 100%; }
  .btn-continuar { flex: 1; justify-content: center; }
}

/* ===== LOGO UPLOAD PREVIEW ===== */
.logo-upload-area {
  display: flex; align-items: center; gap: 20px; margin-bottom: 16px;
}
.logo-preview {
  width: 80px; height: 80px; border-radius: 12px; border: 2px dashed var(--border);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  background: var(--surface-input); flex-shrink: 0;
}
.logo-preview img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.logo-preview i { font-size: 2rem; color: var(--text-muted); }
.logo-upload-actions { display: flex; flex-direction: column; gap: 6px; }

/* ===== DADOS CADASTRAIS ===== */
.dados-cadastrais-logo-area {
  display: flex; align-items: center; gap: 20px; margin-bottom: 24px;
}
.dados-cadastrais-logo-preview {
  width: 100px; height: 100px; border-radius: 16px; border: 2px dashed var(--border);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  background: var(--surface-input); flex-shrink: 0;
}
.dados-cadastrais-logo-preview img { width: 100%; height: 100%; object-fit: cover; border-radius: 14px; }
.dados-cadastrais-logo-preview i { font-size: 2.5rem; color: var(--text-muted); }

/* ===== TOAST TYPES (legado removido — substituído por .toast.toast-* no bloco TOAST principal) ===== */

/* ===== CONFIG QUANTIDADES — PREMIUM LAYOUT ===== */

/* Container principal */
.qtd-config-section {
  margin-top: 20px;
}
.qtd-config-section .cores-section-header h4 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gold);
}
.qtd-config-section .cores-section-header h4 i {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--gold-bg);
  color: var(--gold);
  font-size: 0.95rem;
}
.qtd-config-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 4px 0 16px;
  line-height: 1.5;
}

/* Grid 2 colunas */
.qtd-config-grid {
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 8px;
}
@media (max-width: 700px) {
  .qtd-config-grid {
  overflow: hidden; grid-template-columns: 1fr; }
}

/* Card individual */
.qtd-config-card {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius, 12px);
  padding: 20px;
  background: var(--bg-card, #fff);
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0; /* permite que filhos com flex/grid encolham */
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.qtd-config-card:hover {
  border-color: var(--gold-border);
  box-shadow: 0 4px 20px rgba(108,58,237,0.06);
}

/* Header do card */
.qtd-config-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.qtd-config-card-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
}
.qtd-config-card-header-left > div:not(.qtd-config-card-icon) {
  min-width: 0;
}
.qtd-config-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  background: var(--gold-bg);
  color: var(--gold);
  flex-shrink: 0;
}
.qtd-config-card-title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  line-height: 1.2;
  word-break: break-word;
}
.qtd-config-card-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.3;
  word-break: break-word;
}
.qtd-config-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  flex-shrink: 0;
}
.qtd-config-toggle .toggle-switch {
  position: relative;
  width: 40px;
  height: 22px;
  background: #D1D5DB;
  border-radius: 11px;
  cursor: pointer;
  transition: background 0.2s;
  border: none;
  padding: 0;
}
.qtd-config-toggle .toggle-switch.active {
  background: var(--gold);
}
.qtd-config-toggle .toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.qtd-config-toggle .toggle-switch.active::after {
  transform: translateX(18px);
}

/* Type selector (visual only — intervalo active) */
.qtd-config-type-bar {
  display: flex;
  background: var(--bg, #f3f4f6);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}
.qtd-config-type-item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 4px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: default;
  transition: all 0.2s;
  white-space: nowrap;
}
.qtd-config-type-item.active {
  background: var(--gold);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(108,58,237,0.2);
}
.qtd-config-type-item i {
  font-size: 0.75rem;
}

/* Campos do intervalo */
.qtd-config-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 600px) {
  .qtd-config-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
}
.qtd-config-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.qtd-config-field label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted, #888);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.qtd-config-field input,
.qtd-config-field select {
  font-size: 0.88rem;
  padding: 8px 10px;
  height: auto;
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-input, #f9fafb);
  color: var(--text);
  font-family: var(--font);
  outline: none;
  transition: border 0.2s;
  box-sizing: border-box;
}
.qtd-config-field input:focus,
.qtd-config-field select:focus {
  border-color: var(--gold);
}
.qtd-config-fields-disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* === MOBILE: Quantidade por Cor === */
@media (max-width: 600px) {
  .qtd-config-card {
    padding: 14px;
    gap: 12px;
  }
  .qtd-config-card-header {
    align-items: flex-start;
  }
  .qtd-config-toggle {
    margin-left: auto;
  }
  .qtd-config-card-title { font-size: 0.95rem; }
  .qtd-config-card-subtitle { font-size: 0.72rem; }
  .qtd-config-card-icon { width: 36px; height: 36px; }
  .qtd-config-type-item { font-size: 0.72rem; padding: 7px 4px; }
  .qtd-config-field label { font-size: 0.65rem; letter-spacing: 0.2px; }
  .qtd-config-field input,
  .qtd-config-field select { font-size: 0.85rem; padding: 7px 8px; }
}


/* Preview */
.qtd-preview-section {
  margin-top: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.qtd-preview-top {
  display: flex;
  align-items: center;
  gap: 10px;
}
.qtd-preview-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--gold);
  background: var(--gold-bg);
  padding: 4px 10px;
  border-radius: 20px;
}
.qtd-preview-badge i {
  font-size: 0.68rem;
}
.qtd-preview-count {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.qtd-preview-box {
  background: rgba(0,0,0,0.02);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
}
.qtd-preview-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Salvar — footer bar */
.qtd-config-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius, 12px);
}
.qtd-config-footer-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.qtd-config-footer-left i {
  color: var(--gold);
  font-size: 1.1rem;
}
.qtd-config-footer-left .footer-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}
.qtd-config-footer-left .footer-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.qtd-config-footer-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  color: #10B981;
}
.qtd-config-footer-status.dirty {
  color: #F59E0B;
}
.qtd-config-footer-status i {
  font-size: 0.9rem;
}

/* Save row (hidden - replaced by footer) */
.qtd-config-save-row {
  display: none;
}

/* Botão danger para modal descarte */
.btn-danger-fill {
  background: var(--gold, #6C3AED) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 8px !important;
  font-weight: 600 !important;
  padding: 10px 20px !important;
  font-size: 0.88rem !important;
  transition: all 0.2s !important;
}
.btn-danger-fill:hover {
  background: var(--gold-dark, #5B21B6) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(108,58,237,0.3) !important;
}

/* Modal descarte premium */
#modal-confirmar-descarte-qtd .modal {
  max-width: 420px;
  border-radius: var(--radius, 12px);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
#modal-confirmar-descarte-qtd .modal-header {
  border-bottom: none;
  padding: 24px 24px 8px;
}
#modal-confirmar-descarte-qtd .modal-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}
#modal-confirmar-descarte-qtd .modal-body {
  padding: 0 24px 8px !important;
}
#modal-confirmar-descarte-qtd .modal-body p {
  font-size: 0.88rem !important;
  color: var(--text-muted) !important;
  line-height: 1.5;
}
#modal-confirmar-descarte-qtd .modal-footer {
  padding: 16px 24px 24px !important;
  border-top: none;
}
#modal-confirmar-descarte-qtd .btn-secondary {
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 0.88rem;
  font-weight: 500;
}

/* ===== OVERRIDE: wider modal for cores ===== */
#modal-gerenciar-cores .modal {
  max-width: 1200px;
  width: 92vw;
}
@media (max-width: 900px) {
  #modal-gerenciar-cores .modal {
    max-width: 98vw;
    padding: 20px 16px;
  }
}

/* Footer fix — separate description from button */
.qtd-config-footer {
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
  padding: 20px 24px;
}
.qtd-config-footer .btn-submit {
  margin-left: auto;
  white-space: nowrap;
}

/* Type bar — show only intervalo as label */
.qtd-config-type-bar {
  display: inline-flex;
  background: none;
  padding: 0;
  gap: 0;
}
.qtd-config-type-bar .qtd-config-type-item {
  display: none;
}
.qtd-config-type-bar .qtd-config-type-item.active {
  display: inline-flex;
  background: var(--gold-bg);
  color: var(--gold);
  font-weight: 600;
  box-shadow: none;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.78rem;
  cursor: default;
}

/* Ensure no horizontal scroll anywhere in modal body */
#modal-gerenciar-cores .modal-body {
  overflow-x: hidden;
}

/* Better spacing for sections inside cores container */
#cores-servico-container .cores-section {
  margin-bottom: 20px;
}
#cores-servico-container .qtd-config-section {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* === FIX FINAL: Cards mesmo tamanho + no overflow === */
.qtd-config-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 24px !important;
  margin-top: 12px;
  overflow: hidden;
}
.qtd-config-card {
  min-width: 0 !important;
  width: 100% !important;
  overflow: hidden;
}

/* MOBILE: empilha Base e Pigmentação na vertical */
@media (max-width: 700px) {
  .qtd-config-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
}

/* === FIX FINAL: Footer — texto acima, botão menor abaixo === */
.qtd-config-footer {
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 16px !important;
  margin-top: 28px;
  padding: 20px 24px;
}
.qtd-config-footer .btn-submit {
  margin-left: 0 !important;
  width: auto !important;
  max-width: 360px;
  padding: 10px 32px !important;
  font-size: 0.88rem !important;
  height: 42px;
  align-self: center;
}

/* === Campos internos do card não podem estourar === */
.qtd-config-fields {
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 10px;
  min-width: 0;
}
.qtd-config-field {
  min-width: 0;
}
.qtd-config-field input,
.qtd-config-field select {
  width: 100%;
  min-width: 0;
}

/* Preview text no overflow */
.qtd-preview-box {
  min-width: 0;
  overflow: hidden;
}


/* ===== USUÁRIOS — Filtros + Badges (Configurações > Usuários) ===== */

/* Badges de contagem ao lado do título */
.config-section-header h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.users-count-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  line-height: 1.4;
  letter-spacing: 0.2px;
}
.users-count-badge--ativos {
  background: var(--gold-bg);
  color: var(--gold);
  border: 1px solid var(--gold-border);
}
.users-count-badge--inativos {
  background: var(--bg-card-hover);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* Barra de filtros */
.users-filters-bar {
  display: grid;
  grid-template-columns: 2.6fr 160px auto auto;
  gap: 14px;
  align-items: end;
  margin-bottom: 18px;
  padding: 14px 16px;
  background: var(--surface-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* Toggle switch (ativo/inativo) — sem box ao redor */
.user-toggle-switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  vertical-align: middle;
}
.user-toggle-switch .track {
  position: absolute;
  inset: 0;
  background: #cbd5e1;
  border-radius: 999px;
  transition: background 0.2s ease;
}
.user-toggle-switch .thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  transition: transform 0.2s ease;
}
.user-toggle-switch.is-active .track { background: #5B21B6; }
.user-toggle-switch.is-active .thumb { transform: translateX(16px); }
.user-toggle-switch:hover .track { filter: brightness(1.05); }
.user-toggle-switch:focus-visible { outline: 2px solid #5B21B6; outline-offset: 2px; border-radius: 999px; }

.users-filter-search { position: relative; }
.users-filter-search i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.85rem;
  pointer-events: none;
}
.users-filter-search input {
  width: 100%;
  padding: 10px 12px 10px 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.9rem;
  font-family: var(--font);
  outline: none;
  transition: border var(--transition);
}
.users-filter-search input:focus { border-color: var(--gold); }

.users-filter-permissao {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.users-filter-permissao label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  font-weight: 600;
}
.users-filter-permissao select {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.9rem;
  font-family: var(--font);
  cursor: pointer;
  outline: none;
  transition: border var(--transition);
}
.users-filter-permissao select:focus { border-color: var(--gold); }

.users-filter-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
  user-select: none;
  padding-bottom: 6px;
}
.users-filter-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--gold);
  cursor: pointer;
}

.btn-buscar-users {
  padding: 10px 22px;
  background: var(--gold);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
}
.btn-buscar-users:hover {
  background: var(--gold-dark);
  transform: translateY(-1px);
}

/* Tag "Inativo" */
.user-inactive-tag {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-card-hover);
  color: var(--text-muted);
  border: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* Linha vazia */
.users-empty-row td {
  text-align: center;
  color: var(--text-muted);
  padding: 28px 16px !important;
  font-style: italic;
}

/* Responsivo */
@media (max-width: 900px) {
  .users-filters-bar {
    grid-template-columns: 1fr 1fr;
  }
  .btn-buscar-users { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .users-filters-bar {
    grid-template-columns: 1fr;
  }
}

/* ===== BOTÃO ATIVAR USUÁRIO (modal de ativação) ===== */
.btn-ativar {
  flex: 1; padding: 12px; background: #5B21B6; border: none; border-radius: 8px;
  color: #fff; font-size: 0.95rem; font-weight: 600; font-family: var(--font);
  cursor: pointer; transition: all var(--transition); display: flex; align-items: center;
  justify-content: center; gap: 8px;
}
.btn-ativar:hover { background: #4C1D95; box-shadow: 0 4px 16px rgba(91,33,182,0.3); }


/* ==========================================================
   PACOTES — gestão e sugestão no agendamento
   ========================================================== */
.pacote-sugestao {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.pacote-loading,
.pacote-grupo-titulo {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.pacote-grupo + .pacote-grupo { margin-top: 10px; }
.pacote-opcao {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--gold-border);
  border-radius: 10px;
  background: var(--gold-bg);
  color: var(--text);
  cursor: pointer;
}
.pacote-opcao input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--gold);
}
.pacote-opcao strong { color: var(--gold); }
.pacote-opcao small {
  display: block;
  margin-top: 3px;
  color: var(--text-muted);
  line-height: 1.35;
}
.pacotes-table-wrapper { overflow-x: auto; }
.pacotes-table {
  width: 100%;
  border-collapse: collapse;
}
.pacotes-table th,
.pacotes-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  color: var(--text);
}
.pacotes-table th {
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.pacotes-empty-row td {
  text-align: center;
  color: var(--text-muted);
  padding: 28px 16px !important;
}
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}
.status-badge.ativo {
  color: var(--gold);
  background: var(--gold-bg);
  border: 1px solid var(--gold-border);
}
.status-badge.inativo {
  color: var(--text-muted);
  background: var(--bg-card-hover);
  border: 1px solid var(--border);
}
.pacote-acoes {
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}
.pacote-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--gold);
  cursor: pointer;
  font-size: 0.95rem;
}
.pacote-icon-btn:hover { color: var(--gold-dark); }
.pacote-toggle-switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  vertical-align: middle;
}
.pacote-toggle-switch .track {
  position: absolute;
  inset: 0;
  background: #cbd5e1;
  border-radius: 999px;
  transition: background 0.2s ease;
}
.pacote-toggle-switch .thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  transition: transform 0.2s ease;
}
.pacote-toggle-switch.is-active .track { background: #5B21B6; }
.pacote-toggle-switch.is-active .thumb { transform: translateX(16px); }
.pacote-preview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}
.pacote-preview > div {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-input, var(--bg-card));
}
.pacote-preview span {
  display: block;
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-bottom: 4px;
}
.pacote-preview strong { color: var(--text); }
.form-check-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 600;
}
.form-check-inline input { accent-color: var(--gold); }
@media (max-width: 720px) {
  .pacote-preview { grid-template-columns: 1fr; }
}

/* ===================== ABAS HISTÓRICO / PACOTES ===================== */
.hist-tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--border, #2a2a2a);
  margin: 12px 0 14px;
}
.hist-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted, #888);
  padding: 8px 14px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: all .15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.hist-tab-btn:hover { color: var(--text, #eee); }
.hist-tab-btn.active {
  color: var(--primary, #c89b3c);
  border-bottom-color: var(--primary, #c89b3c);
}
.hist-tab-pane { animation: fadeIn .15s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ===================== PACOTES DO CLIENTE ===================== */
.pacotes-cliente-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 4px 0 8px;
}
@media (min-width: 640px) {
  .pacotes-cliente-grid { grid-template-columns: 1fr 1fr; }
}
.pacote-cliente-card {
  background: var(--card-bg, #1a1a1a);
  border: 1px solid var(--border, #2a2a2a);
  border-left: 4px solid var(--text-muted, #555);
  border-radius: 10px;
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pacote-cliente-card.status-ativo      { border-left-color: #22c55e; }
.pacote-cliente-card.status-alerta     { border-left-color: #facc15; }
.pacote-cliente-card.status-expirado   { border-left-color: #ef4444; }
.pacote-cliente-card.status-concluido  { border-left-color: #3b82f6; }

.pacote-cliente-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.pacote-cliente-titulo {
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--text, #eee);
}
.pacote-status-badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: .5px;
  padding: 4px 8px;
  border-radius: 999px;
  white-space: nowrap;
  color: #fff;
}
.pacote-status-badge.status-ativo     { background: #16a34a; }
.pacote-status-badge.status-alerta    { background: #ca8a04; color: #1a1a1a; }
.pacote-status-badge.status-expirado  { background: #dc2626; }
.pacote-status-badge.status-concluido { background: #2563eb; }

.pacote-cliente-servico {
  font-size: 0.82rem;
  color: var(--text-muted, #aaa);
}
.pacote-cliente-servico i { margin-right: 4px; opacity: .7; }

.pacote-cliente-progresso { display: flex; flex-direction: column; gap: 4px; }
.pacote-progresso-bar {
  height: 8px;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  overflow: hidden;
}
.pacote-progresso-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary, #c89b3c), #e6b85c);
  border-radius: 999px;
  transition: width .25s ease;
}
.pacote-cliente-card.status-expirado .pacote-progresso-fill { background: #ef4444; }
.pacote-cliente-card.status-concluido .pacote-progresso-fill { background: #3b82f6; }
.pacote-progresso-label {
  font-size: 0.72rem;
  color: var(--text-muted, #999);
}
.pacote-cliente-meta {
  font-size: 0.78rem;
  color: var(--text-muted, #aaa);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}
.pacote-cliente-meta i { margin-right: 4px; opacity: .7; }

/* ===================== PACOTES — RESPONSIVO ===================== */
/* Desktop / Notebook: ajusta padding e evita overflow horizontal */
.pacotes-table-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
}
.pacotes-table { min-width: 720px; }

/* Header da página de pacotes */
#page-pacotes .page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

/* Notebook menor (≤1280px): reduz paddings */
@media (max-width: 1280px) {
  .pacotes-table th,
  .pacotes-table td { padding: 12px 10px; font-size: 0.9rem; }
}

/* Tablet (≤1024px) */
@media (max-width: 1024px) {
  .pacotes-table { min-width: 640px; }
  .pacotes-table th { font-size: 0.72rem; }
  .pacotes-table td { font-size: 0.88rem; }
}

/* Mobile (≤720px): tabela vira cards */
@media (max-width: 720px) {
  #page-pacotes { width: 100%; max-width: 100%; box-sizing: border-box; overflow-x: hidden; }
  #page-pacotes * { box-sizing: border-box; }
  #page-pacotes .page-header { align-items: stretch; }
  #page-pacotes .page-header h2 { font-size: 1.25rem; margin: 0; }
  #page-pacotes .btn-novo { width: 100%; max-width: 100%; justify-content: center; box-sizing: border-box; }

  .pacotes-table-wrapper {
    overflow-x: hidden;
    background: transparent;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .pacotes-table {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0 10px;
  }
  .pacotes-table thead { display: none; }
  .pacotes-table tbody { display: block; width: 100%; }
  .pacotes-table tr {
    display: block;
    width: 100%;
    max-width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 6px 14px;
    box-sizing: border-box;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  }
  .pacotes-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 100%;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    text-align: right;
    font-size: 0.92rem;
    box-sizing: border-box;
    word-break: break-word;
    overflow-wrap: anywhere;
    min-width: 0;
  }
  .pacotes-table tr td:last-child { border-bottom: 0; }
  .pacotes-table td::before {
    content: attr(data-label);
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: left;
    flex: 0 0 38%;
    max-width: 38%;
  }
  .pacotes-table td.pacote-acoes { justify-content: flex-end; gap: 16px; }
  .pacotes-table .pacotes-empty-row td {
    display: block;
    text-align: center;
  }
  .pacotes-table .pacotes-empty-row td::before { display: none; }
}

/* Modal de pacote responsivo */
@media (max-width: 720px) {
  #modal-pacote .modal { width: 95vw; max-width: 95vw; max-height: 92vh; overflow-y: auto; }
  #modal-pacote .form-row,
  #modal-pacote .form-grid { display: flex; flex-direction: column; gap: 10px; }
  .pacote-preview { grid-template-columns: 1fr !important; }
}

/* Telas muito pequenas (≤380px) */
@media (max-width: 380px) {
  .pacotes-table td { font-size: 0.85rem; }
  .pacotes-table td::before { font-size: 0.68rem; flex-basis: 45%; }
  #page-pacotes .page-header h2 { font-size: 1.1rem; }
}

/* ===== IDENTIFICAÇÃO DO CLIENTE — Busca por telefone OU nome ===== */
.id-search-type {
  display: flex;
  gap: 8px;
  background: var(--surface-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 18px;
}
.id-search-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  background: transparent;
  color: var(--text-muted);
  border: none;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}
.id-search-tab:hover { color: var(--text); }
.id-search-tab.active {
  background: var(--gold);
  color: #fff;
  box-shadow: 0 2px 8px var(--gold-bg);
}
.id-search-tab.active i { color: #fff; }

.id-nome-status {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  padding: 6px 2px;
}
.id-nome-status.error { color: #DC2626; }

.id-nome-results {
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 14px;
  background: var(--surface-card);
}
.id-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
}
.id-result-item:last-of-type { border-bottom: none; }
.id-result-item:hover { background: var(--bg-card-hover); }
.id-result-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.id-result-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.id-result-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.id-result-meta span { display: inline-flex; align-items: center; gap: 4px; }
.id-result-select {
  background: var(--gold);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--transition);
}
.id-result-select:hover { background: var(--gold-dark); }

.id-result-newclient {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 14px;
  background: var(--gold-bg);
  color: var(--gold-dark);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border-top: 1px dashed var(--gold-border);
  transition: background var(--transition);
}
.id-result-newclient:hover { background: var(--gold-border); }

.id-empty-state {
  text-align: center;
  padding: 18px 14px;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.id-empty-state .btn-submit {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}


/* ============================================================
   CONFIG GERAL — Agendamento pelo cliente
   ============================================================ */
.ac-toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  flex-wrap: wrap;
}

.ac-toggle-row input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.ac-toggle-track {
  position: relative;
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: var(--border);
  transition: background var(--transition);
  flex-shrink: 0;
}

.ac-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.16);
  transition: transform var(--transition);
}

.ac-toggle-row input:checked + .ac-toggle-track {
  background: var(--gold);
}

.ac-toggle-row input:checked + .ac-toggle-track .ac-toggle-thumb {
  transform: translateX(20px);
}

.ac-toggle-label {
  flex: 1;
  min-width: 220px;
  color: var(--text);
  font-weight: 500;
}

.ac-link-box {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-card);
}

.ac-link-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.ac-link-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.ac-link-row input {
  flex: 1;
  min-width: 260px;
}

.ac-feedback {
  margin-top: 12px;
  font-size: 0.88rem;
  font-weight: 500;
}

.ac-feedback.ok {
  color: #15803d;
}

.ac-feedback.err {
  color: #b91c1c;
}

@media (max-width: 768px) {
  .ac-link-row {
    flex-direction: column;
    align-items: stretch;
  }

  .ac-link-row input,
  .ac-link-row .btn-secondary {
    width: 100%;
    min-width: 0; /* sobrescreve o min-width: 260px que estourava o card */
  }

  .ac-link-box {
    padding: 12px;
  }

  .ac-link-row input {
    font-size: 0.9rem;
    padding: 10px 12px;
  }

  .ac-toggle-label {
    min-width: 0; /* permite quebra de linha sem estourar */
    font-size: 0.92rem;
  }
}

/* ============================================================
   FIX MOBILE — Input do "Link de agendamento do cliente"
   Quando .ac-link-row vira flex-direction: column, qualquer
   flex-basis dos filhos passa a ser ALTURA. Várias regras mais
   específicas (ex.: #config-geral .ac-link-row input { flex: 1 1 240px })
   estavam transformando o input numa caixa de ~240px de altura.
   Aqui forçamos altura natural em todas as variações.
   ============================================================ */
@media (max-width: 768px) {
  .ac-link-row > *,
  .ti-link-row > *,
  #config-geral .ac-link-row > *,
  #config-geral .ti-link-row > * {
    flex: 0 0 auto !important;
    width: 100%;
    max-width: 100%;
  }

  .ac-link-row input[type="text"],
  .ti-link-row input[type="text"],
  #config-geral .ac-link-row input,
  #config-geral .ti-link-row input[type="text"] {
    height: 42px;
    min-height: 42px;
    max-height: 42px;
    line-height: 42px;
    padding: 0 12px;
    box-sizing: border-box;
  }

  .ac-link-row .btn-secondary,
  .ti-link-row .btn-secondary {
    height: 42px;
    min-height: 42px;
    justify-content: center;
  }
}

@media (max-width: 380px) {
  .ac-toggle-row { gap: 10px; }
  .ac-toggle-label { font-size: 0.88rem; }
}

/* ============================================================
   FEATURE: Recomendação de serviços (Upsell)
   ============================================================ */
.svc-rec-help {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--gold-bg); color: var(--gold);
  font-size: 0.7rem; font-weight: 700; cursor: help;
  border: 1px solid var(--gold-border);
}
.svc-rec-hint {
  font-size: 0.78rem; color: var(--text-muted, #888);
  margin: 4px 0 8px; line-height: 1.4;
}
.svc-rec-list {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 220px; overflow-y: auto;
  padding: 8px; border-radius: 8px;
  border: 1px solid var(--border, #2a2a2a);
  background: var(--input-bg, rgba(255,255,255,0.03));
}
.svc-rec-list::-webkit-scrollbar { width: 6px; }
.svc-rec-list::-webkit-scrollbar-thumb { background: var(--gold-border); border-radius: 3px; }
.svc-rec-empty {
  font-size: 0.82rem; color: var(--text-muted, #888);
  text-align: center; padding: 16px 8px; font-style: italic;
}
.svc-rec-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 6px;
  cursor: pointer; transition: background 0.15s;
  user-select: none;
}
.svc-rec-item:hover { background: var(--card-hover, rgba(255,255,255,0.04)); }
.svc-rec-item input[type="checkbox"] { flex-shrink: 0; cursor: pointer; margin: 0 2px 0 0; }
.svc-rec-item-name { flex: 1; font-size: 0.9rem; min-width: 0; word-break: break-word; padding-right: 12px; }
.svc-rec-item-meta {
  font-size: 0.75rem; color: var(--text-muted, #888);
  flex-shrink: 0;
  margin-left: auto;
  white-space: nowrap;
}
@media (max-width: 640px) {
  .svc-rec-item {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .svc-rec-item-name {
    flex: 1 1 calc(100% - 32px);
    padding-right: 0;
  }
  .svc-rec-item-meta {
    width: 100%;
    margin-left: 28px;
    white-space: normal;
  }
}

/* ===== Modal upsell ===== */
.upsell-intro {
  font-size: 0.9rem; color: var(--text-muted, #aaa);
  margin: 0 0 14px;
}
.upsell-list { display: flex; flex-direction: column; gap: 10px; }
.upsell-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border-radius: 8px;
  border: 1px solid var(--gold-border);
  background: var(--gold-bg);
  transition: transform 0.15s, box-shadow 0.15s;
}
.upsell-item:hover { transform: translateY(-1px); box-shadow: 0 4px 14px var(--gold-bg); }
.upsell-item-info { flex: 1; min-width: 0; }
.upsell-item-name {
  font-size: 0.95rem; font-weight: 600; color: var(--gold);
  margin: 0 0 2px; word-break: break-word;
}
.upsell-item-meta { font-size: 0.78rem; color: var(--text-muted, #aaa); }
.upsell-item-add {
  flex-shrink: 0; padding: 8px 14px; border-radius: 6px;
  background: var(--gold); color: #000; border: none;
  font-weight: 600; font-size: 0.85rem; cursor: pointer;
  transition: opacity 0.15s;
}
.upsell-item-add:hover { opacity: 0.85; }
.upsell-item-add:disabled { opacity: 0.5; cursor: not-allowed; }
.upsell-item.added { opacity: 0.6; }
.upsell-item.added .upsell-item-add { background: var(--text-muted, #888); }

@media (max-width: 600px) {
  .upsell-item { flex-direction: column; align-items: stretch; gap: 8px; }
  .upsell-item-add { width: 100%; }
}

/* ============================================================
   TENANT IMAGES — Configurações → Geral
   Galeria + Cropper para o carrossel do agendamento-cliente
   ============================================================ */
.ti-section {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px dashed var(--border);
}
.ti-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.ti-section-head strong {
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 600;
}
.ti-section-head .btn-secondary { white-space: nowrap; }

.ti-thumbs,
.ti-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 8px;
}
.ti-grid { min-height: 60px; }

.ti-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-input);
  border: 1px solid var(--border);
  transition: transform var(--transition), box-shadow var(--transition);
}
.ti-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.ti-thumb:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }

.ti-thumb-remove {
  position: absolute;
  top: 6px; right: 6px;
  width: 26px; height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.65);
  color: #fff;
  font-size: 0.78rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
}
.ti-thumb-remove:hover { background: rgba(220, 38, 38, 0.95); }

.ti-thumb-order {
  position: absolute;
  bottom: 6px; left: 6px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}

.ti-add-btn {
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ti-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 28px 12px;
  color: var(--text-muted);
  border: 2px dashed var(--border);
  border-radius: 10px;
  font-size: 0.88rem;
}

/* Cropper modal */
.ti-cropper-wrap {
  width: 100%;
  max-height: 60vh;
  background: #111;
  border-radius: 10px;
  overflow: hidden;
}
.ti-cropper-wrap img { display: block; max-width: 100%; }
.ti-cropper-tools {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

@media (max-width: 600px) {
  .ti-section-head { flex-direction: column; align-items: stretch; }
  .ti-thumbs, .ti-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
}

/* ============================================================
   TENANT IMAGES — Botão primário (design system)
   Usado em "Adicionar imagens do agendamento" e "Selecionar uma foto".
   ============================================================ */
.ti-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  height: 42px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #ffffff;
  background: linear-gradient(135deg, var(--gold, #6C3AED) 0%, color-mix(in srgb, var(--gold, #6C3AED) 75%, #1B1340) 100%);
  border: 1px solid color-mix(in srgb, var(--gold, #6C3AED) 80%, #000);
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(108, 58, 237, 0.25), 0 1px 2px rgba(0,0,0,0.06);
  transition:
    transform 0.15s ease,
    box-shadow 0.2s ease,
    filter 0.2s ease,
    background 0.2s ease;
}
.ti-btn-primary i { font-size: 0.95rem; }
.ti-btn-primary:hover {
  filter: brightness(1.06);
  box-shadow: 0 6px 20px rgba(108, 58, 237, 0.32), 0 2px 4px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}
.ti-btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(108, 58, 237, 0.22);
  filter: brightness(0.96);
}
.ti-btn-primary:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(108, 58, 237, 0.25),
    0 4px 14px rgba(108, 58, 237, 0.25);
}
.ti-btn-primary:disabled,
.ti-btn-primary[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.15);
  box-shadow: none;
  transform: none;
}

/* Variante quando aparece sozinho dentro do modal (Selecionar uma foto) */
.ti-add-btn.ti-btn-primary {
  margin-top: 14px;
  width: 100%;
  max-width: 260px;
}

@media (max-width: 600px) {
  .ti-btn-primary { width: 100%; }
  .ti-add-btn.ti-btn-primary { max-width: none; }
}

/* =========================================================
   PATCH RESPONSIVO — Aba "Geral" com toggle ativo
   Ajuste final para desktop em 100% de zoom e telas intermediárias
   ========================================================= */

#config-geral,
#config-geral * {
  box-sizing: border-box;
}

#config-geral,
#config-geral .config-section,
#config-geral .config-section-right,
#config-geral .ac-link-box,
#config-geral .ti-images-block,
#config-geral .ti-images-header,
#config-geral .ac-link-row,
#config-geral .ti-link-row {
  min-width: 0;
  max-width: 100%;
}

#config-geral .config-section {
  align-items: flex-start;
}

#config-geral .config-section-right {
  flex: 1 1 0%;
  width: 100%;
}

#config-geral .ac-toggle-row {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  width: 100%;
}

#config-geral .ac-toggle-label {
  flex: 1 1 260px;
  min-width: 0;
  line-height: 1.45;
  white-space: normal;
  overflow-wrap: anywhere;
}

#config-geral .ac-link-box {
  width: 100%;
  overflow: hidden;
}

#config-geral .ac-link-row,
#config-geral .ti-link-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: 100%;
}

#config-geral .ac-link-row input,
#config-geral .ti-link-row input[type="text"] {
  flex: 1 1 240px;
  min-width: 0;
  max-width: 100%;
}

#config-geral .ac-link-row .btn-secondary {
  flex: 0 0 auto;
  max-width: 100%;
}

.ti-images-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: var(--gold-bg);
  border: 1px solid var(--gold-border);
  border-radius: 12px;
  width: 100%;
  box-sizing: border-box;
}

.ti-images-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.ti-images-header h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  flex: 1 1 220px;
  min-width: 0;
}

.ti-images-desc {
  margin: 0;
  width: 100%;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
}

.ti-images-block .ti-btn-primary,
.ti-images-header .ti-btn-primary {
  white-space: nowrap;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
}

.config-panel,
.config-content,
.tab-content {
  min-width: 0;
  overflow-x: hidden;
}

.config-panel > * {
  max-width: 100%;
  box-sizing: border-box;
}

.ti-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

.ti-link-row input[type="text"] {
  flex: 1 1 240px;
  min-width: 0;
}

@media (max-width: 1120px) {
  #config-geral .config-section {
    flex-direction: column;
    gap: 18px;
  }

  #config-geral .config-section-left,
  #config-geral .config-section-right {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 900px) {
  .ti-images-header {
    flex-direction: column;
    align-items: stretch;
  }

  .ti-images-block .ti-btn-primary {
    width: 100%;
    justify-content: center;
  }
}

/* ============================================================
   FIX: quando .ti-images-header vira coluna no mobile,
   o flex-basis dos filhos (h4: 220px, botão: 100%) passa a
   representar ALTURA, criando um box vazio enorme acima do botão.
   Resetamos os filhos para altura automática.
   ============================================================ */
@media (max-width: 900px) {
  .ti-images-header > * {
    flex: 0 0 auto;
  }
  .ti-images-header h4 {
    width: 100%;
    flex: 0 0 auto;
    min-height: 0;
  }
  .ti-images-block {
    gap: 10px;
  }
}

@media (max-width: 560px) {
  .ti-images-block {
    padding: 12px;
  }

  .ti-images-header h4 {
    font-size: 14px;
  }

  .ti-images-desc {
    font-size: 12.5px;
  }
}

/* =========================================================
   PATCH RESPONSIVO — Botão "Adicionar imagens do agendamento"
   Garante que o texto nunca vaze para fora do botão, mesmo
   em containers estreitos (card de Configurações > Geral).
   ========================================================= */

.ti-btn-add-images {
  /* libera o nowrap herdado do .ti-btn-primary */
  white-space: normal;
  /* permite altura variável quando o texto quebra em duas linhas */
  height: auto;
  min-height: 42px;
  /* o botão pode encolher dentro do header flex */
  max-width: 100%;
  min-width: 0;
  flex: 0 1 auto;
  /* padding um pouco menor no eixo horizontal para sobrar espaço ao texto */
  padding: 10px 14px;
  line-height: 1.25;
  text-align: center;
  text-wrap: balance;
  word-break: normal;
  overflow-wrap: anywhere;
}

.ti-btn-add-images .ti-btn-label {
  display: inline-block;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.ti-btn-add-images i {
  flex: 0 0 auto;
}

/* Em telas intermediárias, o botão ocupa a largura toda do header */
@media (max-width: 1280px) {
  .ti-images-header .ti-btn-add-images {
    width: 100%;
    flex: 1 1 100%;
  }
}

/* No mobile, o header já é column — flex-basis 100% viraria altura.
   Forçamos o botão a ter altura natural. */
@media (max-width: 900px) {
  .ti-images-header .ti-btn-add-images {
    flex: 0 0 auto;
    width: 100%;
    height: auto;
    min-height: 42px;
  }
}

@media (max-width: 560px) {
  .ti-btn-add-images {
    font-size: 0.82rem;
    padding: 10px 12px;
    gap: 6px;
  }
}

/* ===== CLIENTS TABLE - Coluna de Ações (Editar) ===== */
.clients-table th.col-acoes,
.clients-table td.col-acoes {
  width: 64px;
  text-align: center;
  padding-right: 16px;
}
.clients-table .btn-edit-client {
  background: var(--gold-bg);
  color: var(--gold);
  border: 1px solid var(--gold-border);
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  font-size: 0.85rem;
}
.clients-table .btn-edit-client:hover {
  background: var(--gold);
  color: #fff;
  border-color: var(--gold);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(108,58,237,0.25);
}
.clients-table .btn-edit-client:active { transform: translateY(0); }
.clients-table .btn-edit-client:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* botão Salvar em estado de loading */
.btn-submit.is-loading {
  opacity: 0.75;
  pointer-events: none;
  position: relative;
}
.btn-submit.is-loading::after {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 8px;
  border: 2px solid rgba(255,255,255,0.5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btn-spin 0.7s linear infinite;
  vertical-align: -2px;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }


/* ===== CLIENTES - LAYOUT EM CARDS NO MOBILE ===== */
/* Esconde label do botão editar e ícones de célula no desktop */
.clients-table .btn-edit-client-label { display: none; }
.clients-table .cell-icon { display: none; }
.clients-table .cell-value { display: inline; }
/* Desktop: ícone SVG e label de célula só aparecem no mobile */
.clients-table .cell-icon-svg,
.clients-table .cell-label { display: none; }

@media (max-width: 768px) {
  /* Wrapper sem moldura no mobile (cards têm visual próprio) */
  .clients-table-wrapper {
    background: transparent;
    border: none;
    box-shadow: none;
    overflow: visible;
    padding: 0;
  }

  /* Esconde cabeçalho da tabela */
  .clients-table thead { display: none; }

  .clients-table,
  .clients-table tbody {
    display: block;
    width: 100%;
  }

  /* ----- CARD ----- */
  .clients-table tbody tr {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 14px;
    box-shadow: 0 2px 6px rgba(17, 17, 17, 0.04), 0 1px 2px rgba(17, 17, 17, 0.03);
    position: relative;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
    cursor: pointer;
  }
  .clients-table tbody tr:active {
    transform: scale(0.995);
    opacity: 0.92;
  }
  .clients-table tbody tr:hover td { background: transparent; }

  /* ----- LINHA: [ícone] [label] ........ [valor] ----- */
  .clients-table tbody td {
    display: grid;
    grid-template-columns: 22px auto 1fr;
    align-items: center;
    column-gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    font-size: 0.95rem;
    text-align: right;
  }

  /* Esconde ícones FontAwesome legados (se existirem) */
  .clients-table tbody td .cell-icon { display: none; }

  /* Garantia: nada de pseudo-elementos (usamos elementos reais agora) */
  .clients-table tbody td::before,
  .clients-table tbody td::after { content: none; display: none; }

  /* Ícone SVG (silhueta outline) — herda cor via currentColor */
  .clients-table tbody td .cell-icon-svg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    /* Usa a "Cor de destaque" do tema (mesma fonte de Configurações > Tema da Agenda) */
    color: var(--gold, var(--primary, currentColor));
    flex-shrink: 0;
  }
  .clients-table tbody td .cell-icon-svg svg {
    width: 18px;
    height: 18px;
    display: block;
  }

  /* Label sutil ao lado do ícone */
  .clients-table tbody td .cell-label {
    display: inline-block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    font-weight: 600;
    text-align: left;
    opacity: 0.85;
    white-space: nowrap;
  }

  /* Coluna de Ações sem ícone/label */
  .clients-table tbody td.col-acoes .cell-icon-svg,
  .clients-table tbody td.col-acoes .cell-label { display: none; }

  /* Valor à direita, com mais contraste */
  .clients-table tbody td .cell-value {
    display: inline-block;
    color: var(--text);
    font-weight: 500;
    font-size: 0.95rem;
    text-align: right;
    word-break: break-word;
    justify-self: end;
  }

  /* Nome com destaque (maior + mais peso) */
  .clients-table tbody td .cell-value-name {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.25;
  }

  /* Telefone não quebra linha */
  .clients-table tbody td .cell-value-phone {
    white-space: nowrap;
  }

  /* Última linha de dados sem separador */
  .clients-table tbody tr td:nth-last-child(2) {
    border-bottom: none;
  }

  /* ----- BOTÃO EDITAR (full-width) ----- */
  .clients-table tbody td.col-acoes {
    display: block;
    width: 100%;
    padding: 12px 0 0;
    margin-top: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    border-bottom: none;
  }

  .clients-table tbody .btn-edit-client {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 44px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0 16px;
    background: var(--gold-bg);
    color: var(--gold);
    border: 1px solid var(--gold-border);
    transition: background 0.15s ease, transform 0.1s ease;
  }
  .clients-table tbody .btn-edit-client:active {
    transform: scale(0.98);
    background: var(--gold);
    color: #fff;
  }
  .clients-table tbody .btn-edit-client-label { display: inline; }
}

/* Mobile pequeno (≤ 380px): ajustes finos */
@media (max-width: 380px) {
  .clients-table tbody tr { padding: 14px; }
  .clients-table tbody td { font-size: 0.9rem; column-gap: 8px; }
  .clients-table tbody td .cell-value-name { font-size: 1rem; }
}

/* ============================================================
   HORÁRIO COMERCIAL — Configurações > Geral
   Layout: dois inputs de hora lado a lado em desktop,
   empilhados em mobile. Botão "Salvar" alinhado à direita.
   ============================================================ */
.horario-comercial-row {
  display: flex;
  gap: 14px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.horario-comercial-field {
  flex: 1 1 180px;
  min-width: 0;
  margin-bottom: 0 !important;
}
.horario-comercial-field input[type="time"] {
  width: 100%;
  padding: 12px 14px;
  background: var(--surface-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  min-width: 0;
  max-width: 100%;
  transition: border var(--transition);
}
.horario-comercial-field input[type="time"]:focus {
  border-color: var(--gold);
}
.horario-comercial-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
}
.horario-comercial-actions .btn-salvar-horario {
  height: 44px;
  padding: 0 20px;
  border-radius: 10px;
  background: var(--gold);
  color: #fff;
  border: none;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background var(--transition);
  white-space: nowrap;
}
.horario-comercial-actions .btn-salvar-horario:hover {
  background: var(--gold-dark);
}
.horario-comercial-actions .btn-salvar-horario:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Mobile: inputs em coluna ocupando 100% */
@media (max-width: 600px) {
  .horario-comercial-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .horario-comercial-field {
    flex: 1 1 auto;
    width: 100%;
  }
  .horario-comercial-actions {
    width: 100%;
  }
  .horario-comercial-actions .btn-salvar-horario {
    width: 100%;
    justify-content: center;
  }
}

/* ============================================================
   HORÁRIO COMERCIAL — Lista semanal (Configurações > Geral)
   Usa as variáveis do tema (--bg-card, --border, --text, --gold)
   ============================================================ */
.hc-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}
.hc-link-btn {
  background: transparent;
  border: 1px dashed var(--border, #e5e7eb);
  color: var(--gold, #6c3aed);
  font: 600 0.82rem var(--font, inherit);
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all .18s ease;
}
.hc-link-btn:hover {
  background: var(--gold-bg, rgba(108,58,237,0.08));
  border-style: solid;
}
.hc-week-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hc-day-row {
  display: grid;
  grid-template-columns: 180px 56px 1fr 22px 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  background: var(--bg-card, #fff);
  transition: border-color .18s ease, background .18s ease;
}
.hc-day-row.hc-off {
  background: color-mix(in srgb, var(--text-muted, #6b7280) 4%, var(--bg-card, #fff));
}
.hc-day-row.hc-off .hc-day-name { color: var(--text-muted, #6b7280); }
.hc-day-name {
  font: 600 0.92rem var(--font, inherit);
  color: var(--text, #1a1a2e);
}
.hc-day-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}
.hc-day-toggle input {
  opacity: 0; width: 0; height: 0;
}
.hc-day-toggle .hc-slider {
  position: absolute; cursor: pointer;
  inset: 0;
  background: #cbd5e1;
  border-radius: 999px;
  transition: background .2s ease;
}
.hc-day-toggle .hc-slider::before {
  content: "";
  position: absolute;
  height: 18px; width: 18px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.hc-day-toggle input:checked + .hc-slider { background: var(--gold, #6c3aed); }
.hc-day-toggle input:checked + .hc-slider::before { transform: translateX(20px); }
.hc-day-row input[type="time"] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  background: var(--surface-input, #f9fafb);
  color: var(--text, #1a1a2e);
  font: 500 0.9rem var(--font, inherit);
  outline: none;
  -webkit-appearance: none;
  min-width: 0;
  max-width: 100%;
}
.hc-day-row input[type="time"]:focus {
  border-color: var(--gold, #6c3aed);
}
.hc-day-row input[type="time"]:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.hc-sep {
  text-align: center;
  color: var(--text-muted, #6b7280);
  font-size: 0.82rem;
}
.hc-closed-label {
  grid-column: 3 / -1;
  color: var(--text-muted, #6b7280);
  font: 600 0.85rem var(--font, inherit);
  font-style: italic;
}
.hc-day-copy {
  background: transparent;
  border: none;
  color: var(--text-muted, #6b7280);
  cursor: pointer;
  font-size: 0.78rem;
  padding: 4px 6px;
  border-radius: 6px;
  transition: all .18s ease;
}
.hc-day-copy:hover {
  color: var(--gold, #6c3aed);
  background: var(--gold-bg, rgba(108,58,237,0.08));
}

/* Mensagem "Estabelecimento fechado" na agenda do dia */
.no-appointments.is-closed i { color: var(--text-muted, #6b7280); }

@media (max-width: 720px) {
  .hc-day-row {
    grid-template-columns: 1fr 56px;
    grid-template-areas:
      "name toggle"
      "times times"
      "copy copy";
    gap: 8px;
    padding: 12px;
  }
  .hc-day-name { grid-area: name; }
  .hc-day-toggle { grid-area: toggle; justify-self: end; }
  .hc-day-times {
    grid-area: times;
    display: grid;
    grid-template-columns: 1fr 22px 1fr;
    gap: 8px;
    align-items: center;
  }
  .hc-day-times.hc-closed-mobile {
    grid-template-columns: 1fr;
  }
  .hc-day-copy { grid-area: copy; justify-self: start; }
}


/* ============================================================
   FEATURE: Bloqueio de horário
   ============================================================ */
#btn-bloquear-horario {
  display: flex; align-items: center; gap: 6px;
}
#btn-bloquear-horario i { font-size: 0.9em; }

.bloq-toggle-row {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; user-select: none;
  padding: 10px 12px; background: var(--surface-input);
  border: 1px solid var(--border); border-radius: 10px;
}
.bloq-toggle-row input[type="checkbox"] {
  width: 18px; height: 18px; accent-color: var(--gold); cursor: pointer;
}

#bloq-horarios-row.hidden { display: none !important; }

/* Bloco de bloqueio na timeline (single + multi) */
.timeline-block.is-bloqueio {
  background: repeating-linear-gradient(
    135deg,
    rgba(107, 114, 128, 0.18),
    rgba(107, 114, 128, 0.18) 8px,
    rgba(107, 114, 128, 0.30) 8px,
    rgba(107, 114, 128, 0.30) 16px
  );
  border: 1px solid rgba(107, 114, 128, 0.45);
  border-left: 3px solid #6b7280;
  color: #374151;
}
.timeline-block.is-bloqueio:hover {
  background: repeating-linear-gradient(
    135deg,
    rgba(107, 114, 128, 0.25),
    rgba(107, 114, 128, 0.25) 8px,
    rgba(107, 114, 128, 0.40) 8px,
    rgba(107, 114, 128, 0.40) 16px
  );
}
.timeline-block.is-bloqueio .tb-time,
.timeline-block.is-bloqueio .tb-client,
.timeline-block.is-bloqueio .tb-service {
  color: #374151;
}
.timeline-block.is-bloqueio .tb-time i,
.timeline-block.is-bloqueio .tb-client i { margin-right: 4px; }

/* Menu rápido (clique em horário vazio) */
.agenda-quick-menu {
  position: fixed;
  z-index: 9999;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.18);
  padding: 6px;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.agenda-quick-menu[hidden] { display: none; }
.agenda-quick-menu button {
  display: flex; align-items: center; gap: 10px;
  background: transparent; border: none; cursor: pointer;
  padding: 10px 12px; border-radius: 8px;
  font-family: var(--font); font-size: 0.9rem; color: var(--text);
  text-align: left; width: 100%;
  transition: background var(--transition);
}
.agenda-quick-menu button:hover { background: var(--bg-card-hover); color: var(--gold); }
.agenda-quick-menu button i { width: 16px; text-align: center; color: var(--gold); }

.timeline-slot, .multi-agenda-cell { cursor: pointer; }
.timeline-slot:hover, .multi-agenda-cell:hover {
  background: var(--gold-bg);
}

@media (max-width: 600px) {
  #btn-bloquear-horario span,
  #btn-bloquear-horario { font-size: 0.8rem; padding: 8px 12px; }
  .agenda-quick-menu { min-width: 180px; }
}

/* ============================================================
   HORÁRIO COMERCIAL — Botão + Resumo na aba Geral
   Substitui a exibição inline da grade semanal por um trigger
   que abre o modal #modal-horario-comercial.
   ============================================================ */
.hc-trigger-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.hc-trigger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 18px;
  background: var(--gold);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 6px 18px rgba(108,58,237,0.18);
}
.hc-trigger-btn:hover {
  background: var(--gold-dark);
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(108,58,237,0.22);
}
.hc-trigger-btn:active { transform: translateY(0); }
.hc-trigger-btn i { font-size: 1rem; }

.hc-resumo {
  margin: 0;
  padding: 10px 12px;
  background: var(--gold-bg);
  border: 1px solid var(--gold-border);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.88rem;
  line-height: 1.5;
  text-align: center;
}

/* ============================================================
   MODAL: Horário comercial
   ============================================================ */
#modal-horario-comercial .modal.modal-horario {
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: hcModalIn 0.22s ease-out;
}

.modal-horario-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 4px;
}

.modal-horario-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

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

/* Mobile: modal em tela cheia + botão full-width */
@media (max-width: 640px) {
  .hc-trigger-btn { width: 100%; }

  #modal-horario-comercial.modal-overlay {
    padding: 0 !important;
    align-items: stretch !important;
    justify-content: stretch !important;
  }
  #modal-horario-comercial .modal.modal-horario {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    margin: 0;
    padding: 16px;
  }
  .modal-horario-body {
    max-height: none;
    flex: 1 1 auto;
  }
  .modal-horario-actions {
    flex-direction: column-reverse;
  }
  .modal-horario-actions .btn-cancel,
  .modal-horario-actions .btn-salvar-horario {
    width: 100%;
  }
}

/* ============================================================
   COMISSÕES — tela e box do dashboard
   ============================================================ */
.com-page-header {
  display: flex;
  align-items: center;
  gap: 12px;
}
.com-back-btn {
  width: 38px; height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.com-back-btn:hover { background: var(--gold-bg); color: var(--gold); border-color: var(--gold-border); }

.com-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 720px;
  margin-top: 8px;
  box-shadow: var(--shadow-sm);
}
.com-help {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.5;
  margin-bottom: 18px;
}
.com-help strong { color: var(--text); }

.com-form .form-group { margin-bottom: 16px; }
.com-form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.com-form select,
.com-form input[type="number"] {
  width: 100%;
  padding: 12px 14px;
  background: var(--surface-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: var(--font);
  outline: none;
  transition: border var(--transition), box-shadow var(--transition);
}
.com-form select:focus,
.com-form input[type="number"]:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-bg);
}

.com-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.com-input-wrap {
  position: relative;
}
.com-input-wrap input { padding-right: 38px; }
.com-input-suffix {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  pointer-events: none;
}

.com-feedback {
  margin-top: 4px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 500;
}
.com-feedback.is-error {
  background: rgba(220, 38, 38, 0.08);
  color: #DC2626;
  border: 1px solid rgba(220, 38, 38, 0.25);
}
.com-feedback.is-success {
  background: rgba(22, 163, 74, 0.08);
  color: #16A34A;
  border: 1px solid rgba(22, 163, 74, 0.25);
}

.com-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
}

/* Mobile */
@media (max-width: 640px) {
  .com-wrapper { padding: 18px; border-radius: 12px; }
  .com-field-row { grid-template-columns: 1fr; gap: 10px; }
  .com-actions { flex-direction: column-reverse; }
  .com-actions .btn-cancel,
  .com-actions .btn-submit { width: 100%; justify-content: center; }
  .com-form select,
  .com-form input[type="number"] { padding: 14px 16px; font-size: 1rem; }
  .com-input-wrap input { padding-right: 42px; }
}

/* ===== Box: Divisão de comissões no dashboard ===== */
.dash-comissoes-box { margin-top: 8px; }
.dash-comissoes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 12px;
}
.dash-comissoes-card {
  background: var(--surface-input);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
}
.dash-comissoes-card--estab {
  background: var(--gold-bg);
  border-color: var(--gold-border);
}
.dash-comissoes-card--prof {
  background: color-mix(in srgb, var(--gold) 4%, var(--bg-card));
  border-color: var(--gold-border);
}
.dash-comissoes-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}
.dash-comissoes-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
}
.dash-comissoes-sub {
  margin-top: 2px;
  font-size: 0.82rem;
  color: var(--gold-dark);
  font-weight: 600;
}
.dash-comissoes-help {
  margin-top: 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}
@media (max-width: 720px) {
  .dash-comissoes-grid { grid-template-columns: 1fr; }
}

/* =========================================================
   DASHBOARD — "Por Profissional" cards (mobile only)
   Desktop: mantém a tabela original. Mobile (<=768px):
   esconde a tabela e exibe cards verticais por profissional.
   ========================================================= */
.dash-prof-cards-mobile { display: none; }

@media (max-width: 768px) {
  .dash-prof-table-wrapper { display: none !important; }

  .dash-prof-cards-mobile {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 4px;
  }

  .dash-prof-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 14px 12px;
    box-shadow: var(--shadow-sm);
  }

  .dash-prof-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border);
  }
  .dash-prof-card-avatar {
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--gold-bg);
    color: var(--gold);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.95rem; flex: 0 0 auto;
  }
  .dash-prof-card-name {
    font-weight: 600;
    font-size: 0.98rem;
    color: var(--text);
    line-height: 1.2;
    word-break: break-word;
  }

  .dash-prof-metric { margin-bottom: 10px; }
  .dash-prof-metric:last-child { margin-bottom: 0; }
  .dash-prof-metric-row {
    display: flex; justify-content: space-between; align-items: baseline;
    margin-bottom: 5px; font-size: 0.85rem; gap: 8px;
  }
  .dash-prof-metric-label { color: var(--text-muted); }
  .dash-prof-metric-value { font-weight: 600; color: var(--text); white-space: nowrap; }
  .dash-prof-metric-bar {
    height: 6px; background: var(--surface-input);
    border-radius: 999px; overflow: hidden;
  }
  .dash-prof-metric-bar > span {
    display: block; height: 100%; border-radius: 999px;
    transition: width .35s ease;
  }
  .dash-prof-metric.atendimentos .dash-prof-metric-bar > span { background: #6C3AED; }
  .dash-prof-metric.servicos     .dash-prof-metric-bar > span { background: #F59E0B; }
  .dash-prof-metric.faturamento  .dash-prof-metric-bar > span { background: #10B981; }
  .dash-prof-metric.comissao     .dash-prof-metric-bar > span { background: #3B82F6; }
}

/* ============================================================
   🎁 PACOTE-FIX (BUG 3) — indicador visual no calendário
   Diferencia agendamentos cuja sessão veio de um pacote_uso.
   ============================================================ */
.timeline-block.is-package {
  background: linear-gradient(135deg, rgba(108,58,237,0.18), rgba(139,92,246,0.10));
  border-left: 4px solid var(--gold, #6C3AED);
  box-shadow: inset 0 0 0 1px rgba(108,58,237,0.25);
}
.timeline-block.is-package:hover {
  background: linear-gradient(135deg, rgba(108,58,237,0.28), rgba(139,92,246,0.18));
}
.tb-pkg-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .7em;
  font-weight: 600;
  padding: 1px 6px;
  margin-left: 6px;
  border-radius: 999px;
  background: var(--gold, #6C3AED);
  color: #fff;
  vertical-align: middle;
  white-space: nowrap;
}
.tb-pkg-badge i { font-size: .85em; }
.tb-pkg-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold, #6C3AED);
  margin-left: 4px;
  vertical-align: middle;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.6);
}

/* ===== HISTÓRICO: badge "Adquiriu pacote" ===== */
.hist-pacote-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gold, #6C3AED);
  background: var(--gold-bg, rgba(108,58,237,0.08));
  border: 1px solid var(--gold-border, rgba(108,58,237,0.20));
  padding: 2px 8px;
  border-radius: 999px;
  margin-right: 4px;
  letter-spacing: 0.2px;
}

/* ============================================================
   📦 OPÇÃO A — DASHBOARD: badges de uso de pacote em Top Serviços
   e card "Pacotes Vendidos" (vendas separadas dos atendimentos)
   ============================================================ */
.dash-pacote-uso-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  background: linear-gradient(135deg, #fff7e6, #ffe8b3);
  color: #8a5a00;
  border: 1px solid #f0c97a;
  vertical-align: middle;
  cursor: help;
}

#dash-card-pacotes-vendidos {
  margin-top: 16px;
  padding: 18px 20px;
  background: linear-gradient(135deg, #fffaf0 0%, #fff4dc 100%);
  border: 1px solid #f0c97a;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(212, 160, 23, 0.08);
}
#dash-card-pacotes-vendidos .dash-pacotes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  flex-wrap: wrap;
  gap: 8px;
}
#dash-card-pacotes-vendidos h3 {
  margin: 0;
  font-size: 16px;
  color: #6b4400;
  font-weight: 700;
}
#dash-card-pacotes-vendidos .dash-pacotes-resumo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}
#dash-card-pacotes-vendidos .dash-pacotes-qtd {
  color: #8a5a00;
  background: #fff;
  padding: 3px 10px;
  border-radius: 12px;
  border: 1px solid #f0c97a;
  font-weight: 600;
}
#dash-card-pacotes-vendidos .dash-pacotes-receita {
  font-weight: 700;
  color: #6b4400;
  font-size: 15px;
}
#dash-card-pacotes-vendidos .dash-pacotes-hint {
  font-size: 12px;
  color: #8a6d3b;
  margin-bottom: 12px;
  font-style: italic;
  line-height: 1.4;
}
#dash-card-pacotes-vendidos .dash-pacotes-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 8px;
  overflow: hidden;
}
#dash-card-pacotes-vendidos .dash-pacotes-table th {
  text-align: left;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #8a6d3b;
  background: rgba(240, 201, 122, 0.18);
  border-bottom: 1px solid #f0c97a;
}
#dash-card-pacotes-vendidos .dash-pacotes-table td {
  padding: 10px 12px;
  font-size: 13px;
  color: #4a3300;
  border-bottom: 1px solid rgba(240, 201, 122, 0.3);
}
#dash-card-pacotes-vendidos .dash-pacotes-table tr:last-child td {
  border-bottom: none;
}
#dash-card-pacotes-vendidos .dash-pacotes-table th:nth-child(2),
#dash-card-pacotes-vendidos .dash-pacotes-table td:nth-child(2),
#dash-card-pacotes-vendidos .dash-pacotes-table th:nth-child(3),
#dash-card-pacotes-vendidos .dash-pacotes-table td:nth-child(3) {
  text-align: right;
  white-space: nowrap;
}

/* ============================================================
   📱 RESPONSIVIDADE — badges de pacote, card "Pacotes Vendidos"
   e badge de aquisição de pacote no histórico do cliente
   ============================================================ */
@media (max-width: 768px) {
  .dash-pacote-uso-badge {
    margin-left: 4px;
    padding: 1px 6px;
    font-size: 10px;
    border-radius: 8px;
    /* Mantém na mesma linha do número, mas quebra se necessário */
    white-space: nowrap;
  }

  /* Top Serviços e Top Clientes: garante que a célula de qtd não estoure */
  #dash-top-servicos td:nth-child(2),
  #dash-top-clientes td:nth-child(2) {
    white-space: normal;
    line-height: 1.6;
  }

  #dash-card-pacotes-vendidos {
    margin-top: 12px;
    padding: 14px 14px;
    border-radius: 10px;
  }
  #dash-card-pacotes-vendidos .dash-pacotes-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  #dash-card-pacotes-vendidos h3 { font-size: 15px; }
  #dash-card-pacotes-vendidos .dash-pacotes-resumo {
    width: 100%;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
  }
  #dash-card-pacotes-vendidos .dash-pacotes-receita { font-size: 14px; }
  #dash-card-pacotes-vendidos .dash-pacotes-hint {
    font-size: 11px;
    margin-bottom: 10px;
  }

  /* Tabela ocupa 100% da largura do card no mobile (sem scroll horizontal,
     que estava criando uma área em branco à direita). */
  #dash-card-pacotes-vendidos .dash-pacotes-table {
    display: table;
    width: 100%;
    table-layout: auto;
    overflow: visible;
    white-space: normal;
  }
  #dash-card-pacotes-vendidos .dash-pacotes-table th,
  #dash-card-pacotes-vendidos .dash-pacotes-table td {
    padding: 8px 10px;
    font-size: 12px;
  }
  /* Primeira coluna (Pacote) pode quebrar nome longo;
     colunas Qtd e Receita ficam compactas e alinhadas à direita. */
  #dash-card-pacotes-vendidos .dash-pacotes-table th:first-child,
  #dash-card-pacotes-vendidos .dash-pacotes-table td:first-child {
    white-space: normal;
    word-break: break-word;
    width: auto;
  }
  #dash-card-pacotes-vendidos .dash-pacotes-table th:nth-child(2),
  #dash-card-pacotes-vendidos .dash-pacotes-table td:nth-child(2) {
    width: 1%;
    padding-left: 6px;
    padding-right: 6px;
  }
  #dash-card-pacotes-vendidos .dash-pacotes-table th:nth-child(3),
  #dash-card-pacotes-vendidos .dash-pacotes-table td:nth-child(3) {
    width: 1%;
    padding-right: 4px;
  }

  /* Badge "Adquiriu pacote" no histórico — quebra de linha amigável */
  .hist-pacote-badge {
    display: inline-block;
    font-size: 0.72rem;
    padding: 2px 7px;
    margin-right: 3px;
    margin-bottom: 2px;
    max-width: 100%;
    white-space: normal;
    line-height: 1.3;
  }
}

@media (max-width: 420px) {
  .dash-pacote-uso-badge {
    font-size: 9.5px;
    padding: 1px 5px;
  }
  #dash-card-pacotes-vendidos { padding: 12px 12px; }
  #dash-card-pacotes-vendidos h3 { font-size: 14px; }
}

/* ============================================================
   📐 ALINHAMENTO — célula QTD com número + badge "📦 N"
   - Top Serviços (3 colunas): badge ancorado à DIREITA da célula
     QTD, no vão antes da coluna VALOR TOTAL.
   - Top Clientes (2 colunas): não há vão à direita, então o badge
     fica ancorado à ESQUERDA, logo após o número, em posição fixa
     para todas as linhas (independente do número ter 1 ou 2 dígitos).
   ============================================================ */
#dash-top-servicos td:nth-child(2),
#dash-top-clientes td:nth-child(2) {
  position: relative;
  vertical-align: middle;
}
.dash-qtd-cell {
  display: inline-block;
  line-height: 1.2;
  vertical-align: middle;
}
.dash-qtd-num {
  display: inline-block;
  min-width: 1.5ch;
  text-align: left;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

/* Top Serviços — badge à direita (vão entre QTD e VALOR) */
#dash-top-servicos td:nth-child(2) {
  padding-right: 56px;
}
#dash-top-servicos td:nth-child(2) .dash-pacote-uso-badge {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
  white-space: nowrap;
}

/* Top Clientes — badge à esquerda, logo após o número.
   Usa left fixo a partir do início da célula para que TODAS as
   linhas tenham o badge na mesma posição X. */
#dash-top-clientes td:nth-child(2) .dash-pacote-uso-badge {
  position: absolute;
  left: 44px;             /* início da célula + espaço do número */
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
  white-space: nowrap;
}

/* Mobile */
@media (max-width: 768px) {
  #dash-top-servicos td:nth-child(2) {
    padding-right: 48px;
  }
  #dash-top-servicos td:nth-child(2) .dash-pacote-uso-badge {
    right: 4px;
  }
  #dash-top-clientes td:nth-child(2) .dash-pacote-uso-badge {
    left: 38px;
  }
}
@media (max-width: 420px) {
  #dash-top-servicos td:nth-child(2) {
    padding-right: 42px;
  }
  #dash-top-clientes td:nth-child(2) .dash-pacote-uso-badge {
    left: 34px;
  }
}

/* ============================================================
   CLIENTES INATIVOS — Badge na lista de clientes
   Indicador discreto exibido ao lado do nome do cliente
   quando o cliente não tem agendamentos há X dias.
   ============================================================ */
.client-inactive-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.4;
  background: #FEF3C7;        /* amarelo claro */
  color: #92400E;             /* âmbar escuro p/ contraste */
  border: 1px solid #FDE68A;
  white-space: nowrap;
  vertical-align: middle;
  cursor: help;
}
.client-inactive-badge .cib-icon {
  font-size: 0.78rem;
  line-height: 1;
}
@media (max-width: 600px) {
  .client-inactive-badge {
    margin-left: 6px;
    padding: 2px 6px;
    font-size: 0.68rem;
  }
  .client-inactive-badge .cib-text {
    display: none;            /* em telas pequenas: só o emoji + tooltip */
  }
}

/* ============================================================
   TABLET PORTRAIT (≤ 1180px em orientação retrato)
   Reaplica o layout mobile (sidebar off-canvas + 1 coluna)
   para iPads e tablets Android usados em pé.
   Mantém o layout desktop em landscape.
   ============================================================ */
@media (orientation: portrait) and (min-width: 769px) and (max-width: 1180px) {
  /* Sidebar vira off-canvas (igual ao mobile) */
  .hamburger { display: block; }
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    width: 320px;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 1000;
  }
  .sidebar.open { transform: translateX(0); animation: slideInLeft 0.3s ease; }
  .sidebar .close-sidebar { display: block; }
  .sidebar-overlay { display: none; }
  .sidebar-overlay.active { display: block; }

  /* Conteúdo principal sem margem do sidebar e com respiro pro hamburger */
  .main-content {
    margin-left: 0;
    padding: 24px 28px;
    padding-top: 72px;
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
  }
  .page-header { position: relative; z-index: 1; }
  .page-header h2 { margin-left: 56px; }

  /* Grids/listas em coluna única, igual ao mobile */
  .agenda-grid { flex-direction: column; }
  .calendar-card { min-width: auto; }
  .form-row { grid-template-columns: 1fr 1fr; }
  .dash-row { flex-direction: column; }
  .dash-filters { flex-wrap: wrap; }
  .dash-grid { grid-template-columns: 1fr 1fr; }

  /* Modais com sticky footer (mesmo comportamento do celular) */
  .modal-overlay { align-items: flex-start; padding: 16px; }
  .modal { max-height: 95dvh; }
  .modal-actions {
    position: sticky;
    bottom: 0;
    background: var(--surface-modal);
    padding: 16px 0 4px;
    margin-top: 16px;
    z-index: 2;
    box-shadow: 0 -8px 12px -8px rgba(0,0,0,0.08);
  }

  /* Tipografia um pouco maior que celular pra aproveitar a tela */
  .page-header h2 { font-size: 1.6rem; }
}

/* Em landscape (tablet deitado) mantemos o layout desktop normal,
   nada a fazer aqui — preserva a UX original. */

/* ============================================================
   AUTO-CONCLUSÃO DE AGENDAMENTOS (v1)
   Aplica visual "concluído" nos blocos da timeline quando o
   agendamento já passou do horário + duração + 30min de buffer.
   ============================================================ */
.timeline-block.is-completed {
  background: rgba(34, 197, 94, 0.10) !important;
  border-color: rgba(34, 197, 94, 0.45) !important;
  opacity: 0.78;
  /* CRÍTICO: manter absolute. Se virar relative, o bloco concluído sai do horário e "anda" para o próximo slot. */
  position: absolute;
}
.timeline-block.is-completed:hover {
  background: rgba(34, 197, 94, 0.18) !important;
  opacity: 1;
}
.timeline-block.is-completed .tb-time,
.timeline-block.is-completed .tb-client,
.timeline-block.is-completed .tb-service {
  text-decoration: line-through;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(34,197,94,0.55);
}
/* Check verde no canto superior direito */
.timeline-block.is-completed::after {
  content: "\f00c"; /* font-awesome check */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 0.72rem;
  color: #16a34a;
  background: #fff;
  border: 1px solid rgba(34,197,94,0.55);
  border-radius: 50%;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  z-index: 5;
  pointer-events: none;
}
/* Em blocos minúsculos, ajusta tamanho */
.timeline-block.tb-tiny.is-completed::after {
  width: 12px;
  height: 12px;
  font-size: 0.55rem;
  top: 2px;
  right: 3px;
}

/* ============================================================
   📱 BOTTOM SHEET DE DETALHES DO AGENDAMENTO
   Aparece apenas em mobile/tablet (≤1024px). Click fora ou
   swipe-down fecha. Desktop continua com click → edição direta.
   ============================================================ */
.apt-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0);
  z-index: 9998;
  display: none;
  align-items: flex-end;
  justify-content: center;
  transition: background 0.25s ease;
}
.apt-sheet-backdrop.is-open {
  display: flex;
  background: rgba(0,0,0,0.45);
}
body.apt-sheet-lock { overflow: hidden; }

.apt-sheet-panel {
  width: 100%;
  max-width: 560px;
  background: var(--surface-modal, #fff);
  color: var(--modal-text, #1A1A2E);
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  padding: 8px 18px 22px;
  box-shadow: 0 -8px 32px rgba(0,0,0,0.25);
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.2,0.8,0.2,1);
  max-height: 85vh;
  overflow-y: auto;
  touch-action: pan-y;
}
.apt-sheet-backdrop.is-open .apt-sheet-panel { transform: translateY(0); }

.apt-sheet-handle {
  width: 44px;
  height: 5px;
  border-radius: 3px;
  background: var(--border, #d1d5db);
  margin: 6px auto 12px;
  cursor: grab;
}

.apt-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  margin-bottom: 12px;
}
.apt-sheet-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
}
.apt-sheet-close {
  background: transparent;
  border: 0;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--text-muted, #6b7280);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
}
.apt-sheet-close:hover { background: var(--bg-card-hover, #f3f4f6); }

.apt-sheet-body { display: flex; flex-direction: column; gap: 10px; }
.apt-sheet-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  background: var(--surface-input, #f9fafb);
  border-radius: 10px;
  border: 1px solid var(--border, #e5e7eb);
}
.apt-sheet-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #6b7280);
  font-weight: 600;
}
.apt-sheet-value {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--modal-text, #1A1A2E);
  word-break: break-word;
}
.apt-sheet-obs .apt-sheet-value { white-space: pre-wrap; }

.apt-sheet-status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}
.apt-sheet-status.status-agendado {
  background: rgba(108,58,237,0.10);
  color: var(--gold, #6c3aed);
}
.apt-sheet-status.status-concluido {
  background: rgba(34,197,94,0.12);
  color: #16a34a;
}
.apt-sheet-status.status-cancelado {
  background: rgba(239,68,68,0.12);
  color: #dc2626;
}

.apt-sheet-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.apt-sheet-btn {
  flex: 1 1 140px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: filter 0.15s ease, transform 0.05s ease;
}
.apt-sheet-btn:active { transform: scale(0.98); }
.apt-sheet-btn-edit {
  background: var(--gold, #6c3aed);
  color: #fff;
}
.apt-sheet-btn-edit:hover { filter: brightness(1.05); }
.apt-sheet-btn-cancel {
  background: #fff;
  color: #dc2626;
  border-color: #fecaca;
}
.apt-sheet-btn-cancel:hover { background: #fef2f2; }

/* Tema escuro / surfaces customizadas */
@media (prefers-color-scheme: dark) {
  .apt-sheet-btn-cancel { background: transparent; }
}

/* Garante que em desktop o sheet jamais apareça acidentalmente */
@media (min-width: 1025px) {
  .apt-sheet-backdrop { display: none !important; }
}


/* ============================================================
   MÓDULO PRODUTOS (cadastro base de produtos)
   - Reutiliza tokens existentes: --gold, --bg-card, --border,
     --text, --text-muted, --radius, --transition, --shadow-md.
   - 100% responsivo (cards em grid auto-fill).
   ============================================================ */

.produtos-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin: 4px 0 18px;
  flex-wrap: wrap;
}

.produtos-filter {
  display: inline-flex;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
}

.produtos-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 999px;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.produtos-filter-chip:hover {
  color: var(--text);
}

.produtos-filter-chip.is-active {
  background: var(--gold);
  color: #fff;
  box-shadow: 0 2px 8px rgba(var(--gold-rgb, 108,58,237), 0.25);
}

.produtos-filter-chip .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.produtos-filter-chip .dot-on  { background: #22c55e; }
.produtos-filter-chip .dot-off { background: #94a3b8; }
.produtos-filter-chip.is-active .dot { background: #fff; }

/* ===== GRID DE PRODUTOS ===== */
/* ===== LISTA DE PRODUTOS ===== */
.produtos-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.produto-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: visible;
  transition: var(--transition);
  display: grid;
  grid-template-columns: 72px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 10px 14px;
}
.produto-card:hover {
  border-color: var(--gold);
  box-shadow: var(--shadow-md);
}

.produto-card.is-inativo { opacity: 0.65; }

.produto-card-thumb {
  position: relative;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  background: var(--bg-card-hover, #f0f0ee);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 10px;
}
.produto-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.produto-card-thumb .placeholder {
  font-size: 1.6rem;
  color: var(--text-muted);
  opacity: 0.5;
}

/* Body do card: nome + badge na mesma linha (.produto-card-title-row),
   valor logo abaixo. */
.produto-card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

/* Linha do título: nome COLADO ao badge.
   - O nome encolhe (com ellipsis) caso seja muito longo, mas o badge
     nunca é sobreposto pois flex-shrink:0.
   - flex-wrap permite o badge cair em uma nova linha em telas estreitas. */
.produto-card-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
  row-gap: 4px;
}

/* Badge de status: inline ao lado do nome, colado a ele. */
.produto-card-status {
  display: inline-flex;
  align-items: center;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.15);
  color: #15803d;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
}
.produto-card.is-inativo .produto-card-status {
  background: rgba(148, 163, 184, 0.25);
  color: #475569;
}

.produto-card-nome {
  display: inline-block;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  max-width: 100%;
  flex: 0 1 auto;
}
.produto-card-valor {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold);
}

.produto-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.produto-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  font-size: 0.9rem;
}
.produto-icon-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-bg);
}
.produto-icon-btn.is-danger:hover {
  border-color: #ef4444;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}
.produto-icon-btn.is-success:hover {
  border-color: #22c55e;
  color: #22c55e;
  background: rgba(34, 197, 94, 0.08);
}

/* ===== EMPTY STATE ===== */
.produtos-empty[hidden] { display: none !important; }
.produtos-empty {
  text-align: center;
  padding: 60px 20px;
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.produtos-empty-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--gold-bg);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
}
.produtos-empty-title {
  font-size: 1.05rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ===== MODAL — UPLOAD DE FOTO ===== */
.produto-upload {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  padding: 14px;
  background: var(--surface-input, #f9fafb);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.produto-upload-preview {
  width: 96px;
  height: 96px;
  flex: 0 0 96px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 1.6rem;
  color: var(--text-muted);
}
.produto-upload-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.produto-upload-actions {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.produto-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  width: fit-content;
}
.produto-upload-remove {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  color: #ef4444;
  border-color: rgba(239,68,68,0.3);
}
.produto-upload-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0;
}

/* ===== MODAL — CROP ===== */
.produto-crop-wrap {
  width: 100%;
  max-width: 100%;
  height: 360px;
  background: #111;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 12px;
}
.produto-crop-wrap img {
  display: block;
  max-width: 100%;
}
.produto-crop-controls {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .produto-upload { flex-direction: column; align-items: flex-start; }
  .produto-upload-preview { width: 100%; height: 200px; flex-basis: auto; }
  .produto-crop-wrap { height: 280px; }
}

@media (max-width: 600px) {
  .produto-card {
    grid-template-columns: 56px 1fr;
    grid-template-areas:
      "thumb body"
      "actions actions";
    gap: 12px;
    padding: 10px;
  }
  .produto-card-thumb { width: 56px; height: 56px; grid-area: thumb; }
  .produto-card-body { grid-area: body; }
  .produto-card-actions {
    grid-area: actions;
    justify-content: flex-end;
    border-top: 1px solid var(--border);
    padding-top: 8px;
  }
  .produto-card-nome { font-size: 0.95rem; }
  .produto-card-valor { font-size: 0.95rem; }
  .produto-card-status {
    font-size: 0.58rem;
    padding: 2px 6px;
  }
}


/* ============================================================
   MÓDULO ESTOQUE
   ============================================================ */
.estoque-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.estoque-item {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}
.estoque-item:hover { background: var(--bg-card-hover); }

.estoque-item-thumb {
  width: 56px; height: 56px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-input);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  flex-shrink: 0;
}
.estoque-item-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.estoque-item-info { min-width: 0; }
.estoque-item-nome {
  font-weight: 600;
  color: var(--text);
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.estoque-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.estoque-saldo-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 600;
  background: rgba(34,197,94,0.12);
  color: #16a34a;
  border: 1px solid rgba(34,197,94,0.25);
}
.estoque-saldo-badge.is-zero {
  background: rgba(239,68,68,0.12);
  color: #dc2626;
  border-color: rgba(239,68,68,0.25);
}
.estoque-saldo-badge.is-low {
  background: rgba(234,179,8,0.12);
  color: #b45309;
  border-color: rgba(234,179,8,0.30);
}

.estoque-ultima-mov {
  font-size: .78rem;
  color: var(--text-muted);
}

.estoque-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.estoque-action-btn {
  width: 38px; height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all var(--transition);
  font-size: .95rem;
}
.estoque-action-btn:hover { background: var(--bg-card-hover); }
.estoque-action-btn.is-entrada { color: #16a34a; }
.estoque-action-btn.is-entrada:hover { background: rgba(34,197,94,0.12); border-color: rgba(34,197,94,0.4); }
.estoque-action-btn.is-saida { color: #dc2626; }
.estoque-action-btn.is-saida:hover { background: rgba(239,68,68,0.12); border-color: rgba(239,68,68,0.4); }

/* Histórico */
.estoque-historico {
  max-height: 60vh;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 8px;
  padding: 4px 2px;
}
.estoque-hist-row {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-input);
}
.estoque-hist-tipo {
  font-weight: 600;
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.estoque-hist-tipo.is-entrada { color: #16a34a; }
.estoque-hist-tipo.is-saida   { color: #dc2626; }
.estoque-hist-tipo.is-ajuste  { color: #6366f1; }
.estoque-hist-data {
  font-size: .78rem;
  color: var(--text-muted);
}
.estoque-hist-obs {
  font-size: .85rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.estoque-hist-qtd {
  font-weight: 700;
  font-size: 1rem;
  white-space: nowrap;
}
.estoque-hist-qtd.is-pos { color: #16a34a; }
.estoque-hist-qtd.is-neg { color: #dc2626; }

/* Modal de movimentação: select de produto buscável */
#modal-mov-estoque select#mov-produto {
  height: auto;
  min-height: 140px;
  padding: 4px;
}
#modal-mov-estoque select#mov-produto option {
  padding: 8px 10px;
  border-radius: 6px;
}

/* Responsivo */
@media (max-width: 600px) {
  .estoque-item {
    grid-template-columns: 48px 1fr;
    grid-template-rows: auto auto;
    gap: 10px;
  }
  .estoque-item-thumb { width: 48px; height: 48px; }
  .estoque-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
  .estoque-hist-row {
    grid-template-columns: 1fr auto;
  }
  .estoque-hist-data { grid-column: 1 / -1; }
}

/* ============================================================
   VENDA DE PRODUTOS NO AGENDAMENTO  (build 2026-05-02)
   Seção dentro de #modal-agendamento + modal de cancelamento
   ============================================================ */
.produtos-ag-section {
  margin: 4px 0 16px;
  padding-top: 4px;
  border-top: 1px dashed var(--border);
}
.produtos-ag-header {
  display: flex; align-items: center; justify-content: space-between;
  margin: 14px 0 10px; font-size: 0.85rem; font-weight: 600;
  color: var(--gold); text-transform: uppercase; letter-spacing: 1px;
}
.produtos-ag-header small {
  text-transform: none; letter-spacing: 0; font-weight: 500;
  color: var(--text-muted); margin-left: 4px;
}
.produtos-ag-header i { margin-right: 6px; }

#produtos-ag-container { display: flex; flex-direction: column; gap: 10px; }

.produto-ag-block {
  background: var(--surface-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  position: relative;
}
.produto-ag-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px 130px 36px;
  gap: 10px;
  align-items: end;
}
.produto-ag-row .form-group { margin: 0; }
.produto-ag-row label {
  display: block; font-size: 0.72rem; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 4px;
}
.produto-ag-row select,
.produto-ag-row input[type="number"] {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.92rem;
  transition: border-color var(--transition);
}
.produto-ag-row select:focus,
.produto-ag-row input[type="number"]:focus {
  outline: none; border-color: var(--gold);
}
.produto-ag-row select option:disabled {
  color: #DC2626;
}

.produto-ag-subtotal {
  display: flex; align-items: center; justify-content: flex-end;
  height: 38px;
  padding: 0 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.produto-ag-remove {
  background: none; border: 1px solid var(--border);
  border-radius: 8px;
  width: 36px; height: 38px;
  color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.produto-ag-remove:hover {
  border-color: #DC2626; color: #DC2626; background: rgba(220,38,38,0.06);
}

.produto-ag-warning {
  margin-top: 8px;
  font-size: 0.78rem;
  color: #DC2626;
  display: flex; align-items: center; gap: 6px;
  min-height: 16px;
}
.produto-ag-warning:empty { display: none; }

.produto-ag-saldo-info {
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.btn-add-produto-ag {
  background: none; border: 1px dashed var(--gold-border); border-radius: 8px;
  color: var(--gold); font-family: var(--font); font-size: 0.9rem; cursor: pointer;
  padding: 10px; display: flex; align-items: center; justify-content: center;
  gap: 8px; width: 100%; margin-top: 12px; transition: all var(--transition);
}
.btn-add-produto-ag:hover { background: var(--gold-bg); border-color: var(--gold); }

/* ===== Modal cancelar com produtos ===== */
.cancelar-prod-msg {
  font-size: 0.95rem; color: var(--text); margin-bottom: 12px; line-height: 1.4;
}
.cancelar-prod-lista {
  background: var(--surface-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  max-height: 200px; overflow-y: auto;
}
.cancelar-prod-lista .cp-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}
.cancelar-prod-lista .cp-item:last-child { border-bottom: none; }
.cancelar-prod-lista .cp-item .cp-qtd {
  color: var(--text-muted); font-weight: 600; margin-left: 8px;
}

.cancelar-prod-actions {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end;
}

/* ===== Responsivo ===== */
@media (max-width: 720px) {
  .produto-ag-row {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "produto produto"
      "qtd subtotal"
      "remove remove";
    gap: 8px;
  }
  .produto-ag-row .pa-produto { grid-area: produto; }
  .produto-ag-row .pa-qtd { grid-area: qtd; }
  .produto-ag-row .pa-subtotal { grid-area: subtotal; }
  .produto-ag-row .pa-remove { grid-area: remove; }
  .produto-ag-remove { width: 100%; height: 36px; }
  .cancelar-prod-actions { flex-direction: column-reverse; }
  .cancelar-prod-actions button { width: 100%; }
}

/* ===== Custom dropdown de produtos no agendamento (com fotos) ===== */
.prodag-combo {
  position: relative;
  width: 100%;
}
.prodag-combo-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px 10px;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.92rem;
  cursor: pointer;
  text-align: left;
  transition: border-color var(--transition);
}
.prodag-combo-btn:hover { border-color: var(--gold-border, var(--gold)); }
.prodag-combo.is-open .prodag-combo-btn { border-color: var(--gold); }

.prodag-combo-thumb {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--surface-input);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.prodag-combo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.prodag-combo-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}
.prodag-combo-btn:not(.has-value) .prodag-combo-label { color: var(--text-muted); }

.prodag-combo-caret {
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: transform 0.18s ease;
}
.prodag-combo.is-open .prodag-combo-caret { transform: rotate(180deg); }

.prodag-combo-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 32px rgba(0,0,0,0.15);
  max-height: 280px;
  overflow-y: auto;
  z-index: 50;
  padding: 4px;
}
.prodag-combo.is-open .prodag-combo-menu { display: block; }

.prodag-combo-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s ease;
}
.prodag-combo-item:hover:not(.is-disabled) { background: var(--surface-input); }
.prodag-combo-item.is-disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.prodag-combo-item.is-placeholder { color: var(--text-muted); }

.prodag-combo-item-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.92rem;
  color: var(--text);
}
.prodag-combo-item-meta {
  flex-shrink: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.prodag-combo-item-meta.is-danger { color: #DC2626; }

/* ============================================================
   CONCLUSÃO MANUAL DE ATENDIMENTO — botão e modal
   ============================================================ */
.btn-concluir-atendimento,
#btn-concluir-atendimento,
#btn-confirmar-concluir-atendimento {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  color: #fff !important;
  font-weight: 600;
  border-radius: 8px;
  padding: 10px 18px;
  cursor: pointer;
  transition: filter .15s ease, transform .05s ease, box-shadow .2s ease;
  background: linear-gradient(135deg, #10b981, #059669) !important;
  box-shadow: 0 4px 12px rgba(16,185,129,0.25);
}
.btn-concluir-atendimento:hover,
#btn-concluir-atendimento:hover,
#btn-confirmar-concluir-atendimento:hover { filter: brightness(1.05); }
.btn-concluir-atendimento:active,
#btn-concluir-atendimento:active,
#btn-confirmar-concluir-atendimento:active { transform: translateY(1px); }
.btn-concluir-atendimento:disabled,
#btn-concluir-atendimento:disabled,
#btn-confirmar-concluir-atendimento:disabled { opacity: .7; cursor: not-allowed; }

#modal-concluir-atendimento .modal-body ul li::marker { color: #10b981; }
#modal-concluir-atendimento .btn-cancel {
  background: transparent;
  border: 1px solid var(--border, #e5e7eb);
  color: var(--text, #1A1A2E);
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
}
#modal-concluir-atendimento .btn-cancel:hover { background: var(--bg-card-hover, #f5f5f5); }

/* ============================================================
   RESPONSIVIDADE — Botões do modal de agendamento (mobile/tablet)
   Empilha Excluir / Concluir / Salvar verticalmente em telas <= 900px
   ============================================================ */
@media (max-width: 900px) {
  #modal-agendamento .modal-actions {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }
  #modal-agendamento .modal-actions > button,
  #modal-agendamento .modal-actions .btn-delete,
  #modal-agendamento .modal-actions .btn-submit,
  #modal-agendamento .modal-actions #btn-concluir-atendimento {
    width: 100% !important;
    justify-content: center !important;
    margin: 0 !important;
  }

  /* Modal de confirmação de conclusão também empilhado */
  #modal-concluir-atendimento .modal-actions {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }
  #modal-concluir-atendimento .modal-actions > button {
    width: 100% !important;
    justify-content: center !important;
  }
}


/* ===== DASH CARD — Venda de Produtos (build 2026-05-02) ===== */
.dash-card--produtos {
  position: relative;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--gold, #6C3AED) 8%, var(--bg-card, #fff)),
    var(--bg-card, #fff));
  border: 1px solid var(--gold-border, rgba(108,58,237,0.20));
}
.dash-card--produtos .dash-card-title {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--gold, #6C3AED);
}
.dash-card--produtos .dash-card-title i {
  font-size: 0.95em;
}
.dash-card--produtos .dash-card-value {
  color: var(--gold-dark, #5B21B6);
}
.dash-card-sub {
  margin-top: 4px;
  font-size: 0.78rem;
  color: var(--text-muted, #6B7280);
  font-weight: 500;
}

/* ===== SEARCH BAR (clientes / produtos) ===== */
.search-bar {
  position: relative;
  display: flex;
  align-items: center;
  margin: 0 0 16px;
  max-width: 420px;
}
.search-bar-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  font-size: 0.95rem;
  pointer-events: none;
}
.search-bar-input {
  width: 100%;
  padding: 12px 40px 12px 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-input, var(--bg-card));
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search-bar-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(var(--gold-rgb), 0.15);
}
.search-bar-input::placeholder { color: var(--text-muted); }
.search-bar-clear {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition);
}
.search-bar-clear:hover { background: var(--bg-card-hover); color: var(--text); }
@media (max-width: 600px) { .search-bar { max-width: 100%; } }

/* ══════════════════════════════════════════════════════════════
   CUSTOM PROFESSIONAL SELECT WITH AVATARS
   ══════════════════════════════════════════════════════════════ */
.svc-prof-custom-select {
  position: relative;
  width: 100%;
}
.svc-prof-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border, #E5E7EB);
  border-radius: var(--radius, 12px);
  background: var(--surface-input, #F9FAFB);
  cursor: pointer;
  min-height: 44px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.svc-prof-trigger:hover {
  border-color: var(--gold, #6C3AED);
}
.svc-prof-custom-select.open .svc-prof-trigger {
  border-color: var(--gold, #6C3AED);
  box-shadow: 0 0 0 3px var(--gold-bg, rgba(108,58,237,0.08));
}
.svc-prof-trigger-content {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.svc-prof-placeholder {
  color: var(--text-muted, #6B7280);
  font-size: 0.9rem;
}
.svc-prof-selected-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text, #1A1A2E);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.svc-prof-arrow {
  font-size: 0.7rem;
  color: var(--text-muted, #6B7280);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.svc-prof-custom-select.open .svc-prof-arrow {
  transform: rotate(180deg);
}
.svc-prof-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-card, #fff);
  border: 1px solid var(--border, #E5E7EB);
  border-radius: var(--radius, 12px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 1000;
  max-height: 240px;
  overflow-y: auto;
  padding: 6px;
}
.svc-prof-custom-select.open .svc-prof-dropdown {
  display: block;
}
.svc-prof-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}
.svc-prof-option:hover {
  background: var(--bg-card-hover, #F0F0EE);
}
.svc-prof-option.selected {
  background: var(--gold-bg, rgba(108,58,237,0.08));
}
.svc-prof-option-name {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text, #1A1A2E);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.svc-prof-avatar {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.svc-prof-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  border-radius: 50%;
}

/* Scrollbar dentro do dropdown */
.svc-prof-dropdown::-webkit-scrollbar { width: 5px; }
.svc-prof-dropdown::-webkit-scrollbar-track { background: transparent; }
.svc-prof-dropdown::-webkit-scrollbar-thumb { background: var(--gold-border, rgba(108,58,237,0.2)); border-radius: 3px; }

/* ============================================================
   📦 PACOTE-FIX (INTEGRIDADE) — badge "Venda de pacote"
   Diferencia visualmente venda (origem dos créditos) de uso
   (consumo de crédito). Os dois badges podem aparecer juntos
   no mesmo bloco quando o agendamento vendeu E usou o pacote.
   ============================================================ */
.tb-pkg-badge-uso {
  background: var(--gold, #6C3AED);
  color: #fff;
}
.tb-pkg-badge-venda {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .7em;
  font-weight: 600;
  padding: 1px 6px;
  margin-left: 6px;
  border-radius: 999px;
  background: linear-gradient(135deg, #B45309, #D97706);
  color: #fff;
  vertical-align: middle;
  white-space: nowrap;
}
.tb-pkg-badge-venda i { font-size: .85em; }
.timeline-block.is-package-sale {
  border-left: 4px solid #B45309;
  box-shadow: inset 0 0 0 1px rgba(180,83,9,0.30);
}
.timeline-block.is-package.is-package-sale {
  border-left: 4px solid #B45309;
  background: linear-gradient(135deg, rgba(180,83,9,0.18), rgba(108,58,237,0.12));
}
.tb-pkg-dot-venda {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #B45309;
  margin-left: 4px;
  vertical-align: middle;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.6);
}


/* =================================================
   SKELETON LOADING (Agendamentos) — appended
   ================================================= */
/* ============================================================
   SKELETON LOADING — Slotify (Agendamentos) v2
   Seletores reais detectados no agenda.html:
     • Card calendário:  .calendar-card
       - Nav:            .calendar-nav  (#prev-month / #month-year / #next-month)
       - Weekdays:       .calendar-weekdays
       - Grid dias:      #calendar-days
     • Card detalhe:     .day-detail-card
       - Header data:    #day-detail-header
       - Lista:          #day-appointments  (.timeline-container)
   ============================================================ */

@keyframes sk-shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
@keyframes sk-fade-in {
  from { opacity: 0; transform: translateY(2px); }
  to   { opacity: 1; transform: translateY(0); }
}

.sk {
  display: block;
  background: #1f1b2e;
  background-image: linear-gradient(90deg, #1f1b2e 0px, #2a2440 80px, #1f1b2e 160px);
  background-size: 800px 100%;
  background-repeat: no-repeat;
  border-radius: 8px;
  animation: sk-shimmer 1.4s ease-in-out infinite;
}

/* tema claro: o app é light por padrão (--bg #F8F8F6) */
:root {
  --sk-base:  #ECECF2;
  --sk-hi:    #F7F7FB;
}
body:not(.tema-fullscreen) .sk {
  background: var(--sk-base);
  background-image: linear-gradient(90deg, var(--sk-base) 0px, var(--sk-hi) 80px, var(--sk-base) 160px);
}

.sk-circle  { border-radius: 50%; }
.sk-line    { height: 12px; border-radius: 6px; }
.sk-line-sm { height: 9px;  border-radius: 5px; }
.sk-line-lg { height: 18px; border-radius: 8px; }

/* ---------- Calendário ---------- */
.calendar-card .sk-cal,
.day-detail-card .sk-day { animation: sk-fade-in .25s ease-out; }

.sk-cal__nav {
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px 8px 14px;
}
.sk-cal__nav .sk-arrow { width: 22px; height: 22px; }
.sk-cal__nav .sk-month { width: 110px; height: 14px; }

.sk-cal__weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 6px; padding: 0 4px 10px;
}
.sk-cal__weekdays .sk { height: 8px; }

.sk-cal__grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 6px; padding: 0 4px;
}
.sk-cal__grid .sk { aspect-ratio: 1 / 1; border-radius: 8px; }

/* ---------- Detalhe do dia ---------- */
.sk-day__title { width: 240px; height: 20px; margin: 4px 0 22px; }
.sk-appt {
  display: flex; gap: 14px; padding: 14px;
  margin-bottom: 12px; border-radius: 12px;
  background: rgba(108,58,237,0.04);
  border: 1px solid rgba(108,58,237,0.10);
}
.sk-appt__time { width: 56px; height: 56px; flex-shrink: 0; border-radius: 10px; }
.sk-appt__body { flex: 1; display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.sk-appt__body .sk-name { width: 60%; height: 14px; }
.sk-appt__body .sk-desc { width: 85%; height: 10px; }
.sk-appt__body .sk-dur  { width: 35%; height: 10px; }

.sk-leaving       { animation: sk-fade-in .2s ease-out reverse forwards; }
.sk-content-enter { animation: sk-fade-in .35s ease-out both; }

/* Skeleton inline do mês (dentro do span #month-year) */
.sk-month-inline {
  display: inline-block;
  vertical-align: middle;
  width: 110px;
  height: 14px;
  border-radius: 6px;
}

/* Garante que o skeleton inicial (inline no HTML) não apareça
   recortado antes do CSS principal carregar */
#calendar-days .sk-cal__grid,
#day-appointments .sk-day { will-change: opacity; }
