/* ============================================================
   AGENDA · Admin · Design System v3
   ALINHADO 100% COM A LANDING ATENDIS
   ============================================================ */

:root {
  /* ============================================================
     === FONTES — IGUAL À LANDING ===
     ============================================================ */
  --display: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --body:    'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono:    'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* Aliases (compat com CSS antigo) */
  --font-display: var(--display);
  --font-sans:    var(--body);
  --font-mono:    var(--mono);

  /* ============================================================
     === CORES — COPIADAS DA LANDING ===
     ============================================================ */
  /* Backgrounds */
  --bg:         #FFFFFF;
  --bg-soft:    #F8FAFC;
  --bg-mute:    #F1F5F9;
  --bg-dark:    #0B1220;
  --bg-darker:  #060912;
  --paper:      #FFFFFF;

  /* Texto */
  --ink-950: #020617;
  --ink-900: #0F172A;
  --ink-700: #334155;
  --ink-600: #475569;
  --ink-500: #64748B;
  --ink-400: #94A3B8;
  --ink-300: #94A3B8;     /* mesmo da landing */
  --ink-200: #CBD5E1;
  --line:    #E2E8F0;
  --line-soft: #EEF2F7;
  /* Aliases */
  --ink-100: #F1F5F9;
  --ink-50:  #F8FAFC;

  /* Accents — IGUAL À LANDING */
  --blue:       #2563EB;
  --blue-700:   #1D4ED8;
  --blue-100:   #DBEAFE;
  --blue-50:    #EFF6FF;
  --violet:     #7C3AED;
  --emerald:    #10B981;
  --emerald-soft: #D1FAE5;
  --rose:       #F43F5E;
  --amber:      #F59E0B;
  --amber-soft: #FEF3C7;

  /* Mapeamento semântico */
  --success:      var(--emerald);
  --success-soft: var(--emerald-soft);
  --warning:      var(--amber);
  --warning-soft: var(--amber-soft);
  --danger:       var(--rose);
  --danger-soft:  #FEE2E2;
  --info:         var(--blue);
  --info-soft:    var(--blue-100);

  /* Cor primária do salão (vem inline pelo body)
     USAMOS COMO ACENTO COMPLEMENTAR, não como cor principal */
  --primary:      #2563EB;
  --primary-soft: #DBEAFE;
  --primary-dark: #1D4ED8;

  /* Sombras — IGUAL À LANDING */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.06), 0 10px 15px -3px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 25px -5px rgba(15, 23, 42, 0.08), 0 10px 10px -5px rgba(15, 23, 42, 0.04);
  --shadow-xl: 0 25px 50px -12px rgba(15, 23, 42, 0.15);
  --shadow-blue: 0 12px 32px -8px rgba(37, 99, 235, 0.35);
  /* Aliases */
  --shadow-xs: var(--shadow-sm);
  --shadow:    var(--shadow-md);

  /* Curvas */
  --radius-xs:   6px;
  --radius-sm:   8px;
  --radius:      12px;
  --radius-lg:   16px;
  --radius-xl:   24px;
  --radius-2xl:  32px;
  --radius-full: 9999px;

  /* Layout */
  --sidebar-w: 270px;
  --topbar-h:  68px;
  --container-max: 1280px;
}

/* ============================================================
   RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-900);
  background: var(--bg-soft);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
a {
  color: var(--blue);
  text-decoration: none;
  transition: color .15s;
}
a:hover { color: var(--blue-700); text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }
img, svg { max-width: 100%; display: block; }

/* ============================================================
   TIPOGRAFIA — Manrope nos headings (igual landing)
   ============================================================ */
h1, h2, h3, h4, h5 {
  font-family: var(--display);
  margin: 0;
  font-weight: 800;
  color: var(--ink-900);
  letter-spacing: -0.025em;
  line-height: 1.15;
}
h1 { font-size: 28px; }
h2 { font-size: 22px; font-weight: 700; }
h3 { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
h4 { font-size: 16px; font-weight: 700; letter-spacing: -0.015em; }
h5 { font-size: 14px; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0 0 12px; }

.muted { color: var(--ink-500); }
.tiny  { font-size: 12px; color: var(--ink-500); }
.text-sm { font-size: 13.5px; }

/* Texto com gradient (azul → violeta — exato da landing) */
.grad-text {
  background: linear-gradient(135deg, var(--blue), var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

/* === SIDEBAR === */
.sidebar {
  width: var(--sidebar-w);
  background: var(--paper);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar__brand {
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px;
}
.sidebar__brand-mark {
  width: 40px; height: 40px;
  border-radius: 11px;
  /* Gradient da landing: azul → violeta */
  background: linear-gradient(135deg, var(--blue), var(--violet));
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-family: var(--display);
  font-weight: 800;
  font-size: 16px;
  flex-shrink: 0;
  box-shadow: var(--shadow-blue);
}
.sidebar__brand-text {
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--ink-900);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar__brand-text small {
  display: block;
  font-family: var(--body);
  font-weight: 500;
  font-size: 11px;
  color: var(--ink-500);
  letter-spacing: 0;
  margin-top: 2px;
  white-space: nowrap;
}

/* Itens da nav */
.sidebar__nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.sidebar__nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px;
  border-radius: 9px;
  color: var(--ink-700);
  font-family: var(--body);
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  transition: background .15s, color .15s;
  letter-spacing: -0.005em;
}
.sidebar__nav a:hover {
  background: var(--bg-soft);
  color: var(--ink-900);
  text-decoration: none;
}
.sidebar__nav a.is-active {
  /* Igual landing: ativo = azul */
  background: var(--blue-50);
  color: var(--blue);
  font-weight: 600;
}
.sidebar__nav a.is-active svg { color: var(--blue); }
.sidebar__nav a svg {
  width: 18px; height: 18px;
  color: var(--ink-400);
  flex-shrink: 0;
  transition: color .15s;
}
.sidebar__nav a:hover svg { color: var(--ink-700); }

/* Section title (categoria solta, sem colapso) */
.sidebar__nav .section-title {
  font-family: var(--body);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-400);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 16px 12px 6px;
}

/* Grupos colapsáveis (<details>) */
.sidebar-group {
  margin-top: 4px;
}
.sidebar-group > summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 12px;
  font-family: var(--body);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-500);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 9px;
  transition: background .15s, color .15s;
  user-select: none;
}
.sidebar-group > summary::-webkit-details-marker { display: none; }
.sidebar-group > summary:hover {
  background: var(--bg-soft);
  color: var(--ink-700);
}
.sidebar-group > summary > span:first-child {
  display: flex; align-items: center; gap: 8px;
}
.sidebar-group > summary svg {
  width: 14px; height: 14px;
  color: var(--ink-400);
}
.sidebar-group__chevron {
  transition: transform .2s ease;
  color: var(--ink-400);
  display: flex;
}
.sidebar-group[open] > summary .sidebar-group__chevron {
  transform: rotate(180deg);
}
.sidebar-group[open] > summary {
  color: var(--ink-900);
  background: var(--bg-soft);
}
/* Submenu (links DENTRO do <details>) — fundo ligeiramente diferente
   pra mostrar visualmente que é parte de um grupo */
.sidebar-group[open] {
  background: var(--bg-soft);
  border-radius: 9px;
  padding-bottom: 4px;
  margin-bottom: 4px;
}
.sidebar-group > a {
  animation: fadeIn .2s ease;
  margin-left: 8px;
  position: relative;
  padding-left: 24px;
  font-size: 13.5px;
  color: var(--ink-700);
}
/* Linha vertical sutil mostrando hierarquia */
.sidebar-group > a::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--ink-300);
  transition: background .15s, transform .15s;
}
.sidebar-group > a:hover {
  background: white;
  color: var(--ink-900);
}
.sidebar-group > a:hover::before {
  background: var(--ink-500);
  transform: translateY(-50%) scale(1.5);
}
.sidebar-group > a.is-active {
  background: var(--blue-100);
  color: var(--blue);
  font-weight: 600;
}
.sidebar-group > a.is-active::before {
  background: var(--blue);
  transform: translateY(-50%) scale(1.5);
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Footer da sidebar (user info) */
.sidebar__foot {
  padding: 14px 14px;
  border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
}
.sidebar__foot .user-meta { flex: 1; min-width: 0; }
.sidebar__foot .user-meta strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-900);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar__foot .user-meta span {
  color: var(--ink-500);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.sidebar__foot a {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-500);
  border-radius: 8px;
}
.sidebar__foot a:hover { background: var(--danger-soft); color: var(--danger); }

/* === MAIN === */
.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--topbar-h);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 10;
  gap: 12px;
}
.topbar h1 {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}
.topbar__breadcrumb { font-size: 13px; color: var(--ink-500); }
.topbar__spacer { flex: 1; }
.menu-toggle {
  display: none;
  background: transparent; border: none; padding: 8px;
  border-radius: 8px;
  color: var(--ink-700);
  cursor: pointer;
}
.menu-toggle:hover { background: var(--bg-mute); }

.content {
  padding: 28px;
  max-width: var(--container-max);
  margin: 0 auto;
  width: 100%;
}

/* === SCRIM (overlay quando drawer mobile aberto) === */
.scrim {
  display: none;
}
.scrim.is-visible {
  display: block;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  z-index: 49;
}

/* ============================================================
   TOOLBAR (cabeçalho de página)
   ============================================================ */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}
.toolbar__title { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.toolbar__title h1 {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.1;
}
.toolbar__title .muted { font-size: 14px; }
.toolbar__actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .15s, border-color .15s;
}
.card:hover { box-shadow: var(--shadow-md); }
.card--airy { padding: 28px; }
.card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;
  gap: 16px;
}
.card__head h2, .card__head h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
}
.card__head .muted { font-size: 13px; }
.card + .card { margin-top: 16px; }

/* ============================================================
   KPIs
   ============================================================ */
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.kpi {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .15s, box-shadow .15s;
}
.kpi:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.kpi__icon {
  position: absolute; top: 16px; right: 16px;
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--blue-50);
  color: var(--blue);
  display: flex; align-items: center; justify-content: center;
}
.kpi__label {
  font-family: var(--display);
  font-size: 11px;
  color: var(--ink-500);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  margin-bottom: 10px;
}
.kpi__value {
  font-family: var(--display);
  font-size: 30px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--ink-900);
  font-variant-numeric: tabular-nums;
}
.kpi__value small {
  font-family: var(--body);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-500);
  margin-left: 3px;
  letter-spacing: 0;
}
.kpi__sub {
  font-size: 13px;
  color: var(--ink-500);
  margin-top: 6px;
}
.kpi__delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 10px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--emerald-soft);
  color: #065F46;
}
.kpi__delta--down {
  background: var(--danger-soft);
  color: #991B1B;
}

/* KPI primary com gradient azul→violeta (DA LANDING) */
.kpi--primary {
  background: linear-gradient(135deg, var(--blue), var(--violet));
  border-color: transparent;
  color: white;
  box-shadow: var(--shadow-blue);
}
.kpi--primary .kpi__label,
.kpi--primary .kpi__value,
.kpi--primary .kpi__value small,
.kpi--primary .kpi__sub { color: white; }
.kpi--primary .kpi__label { opacity: 0.85; }
.kpi--primary .kpi__icon {
  background: rgba(255, 255, 255, 0.18);
  color: white;
}
.kpi--primary .kpi__delta {
  background: rgba(255, 255, 255, 0.20);
  color: white;
}

/* ============================================================
   BOTÕES — IGUAL À LANDING
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-family: var(--body);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: background .2s, border-color .2s, box-shadow .2s, transform .15s, color .2s;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled, .btn.is-disabled { opacity: 0.5; pointer-events: none; transform: none; }

/* btn--primary: IGUAL LANDING (preto que vira azul no hover) */
.btn--primary {
  background: var(--ink-900);
  color: white;
  box-shadow: var(--shadow-sm);
}
.btn--primary:hover {
  background: var(--blue);
  color: white;
  box-shadow: var(--shadow-blue);
}

/* btn--blue: azul direto (também da landing) */
.btn--blue {
  background: var(--blue);
  color: white;
  box-shadow: var(--shadow-sm);
}
.btn--blue:hover {
  background: var(--blue-700);
  color: white;
  box-shadow: var(--shadow-blue);
}

/* btn--ghost: IGUAL LANDING (branco com borda fina) */
.btn--ghost {
  background: white;
  color: var(--ink-900);
  border-color: var(--line);
}
.btn--ghost:hover {
  border-color: var(--ink-900);
  color: var(--ink-900);
  background: white;
}

/* Secondary é alias do ghost (compat) */
.btn--secondary { background: white; color: var(--ink-900); border-color: var(--line); }
.btn--secondary:hover { border-color: var(--ink-900); }

.btn--danger {
  background: var(--rose);
  color: white;
}
.btn--danger:hover { background: #DC2626; color: white; }
.btn--outline-danger {
  background: transparent;
  border-color: var(--rose);
  color: var(--rose);
}
.btn--outline-danger:hover { background: var(--danger-soft); }

.btn--success {
  background: var(--emerald);
  color: white;
}
.btn--success:hover { background: #059669; color: white; }

.btn--sm  { height: 34px; padding: 0 14px; font-size: 13px; border-radius: 8px; }
.btn--lg  { height: 48px; padding: 0 24px; font-size: 15px; }
.btn--xl  { height: 56px; padding: 0 28px; font-size: 16px; border-radius: 12px; }
.btn--full { width: 100%; }
.btn svg { width: 16px; height: 16px; }
.btn--lg svg, .btn--xl svg { width: 18px; height: 18px; }

/* Icon button */
.icon-btn {
  width: 36px; height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: white;
  color: var(--ink-700);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
  text-decoration: none;
}
.icon-btn:hover {
  border-color: var(--ink-900);
  color: var(--ink-900);
}
.icon-btn--danger:hover {
  background: var(--danger-soft);
  border-color: var(--rose);
  color: var(--rose);
}

/* ============================================================
   FORMULÁRIOS
   ============================================================ */
.field { margin-bottom: 16px; }
.field label, .field .label-tag, label {
  display: block;
  font-family: var(--body);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-700);
  margin-bottom: 6px;
  letter-spacing: -0.005em;
}
.field .hint, .hint {
  font-size: 12px;
  color: var(--ink-500);
  margin-top: 5px;
  line-height: 1.45;
}
.field .error {
  font-size: 12px;
  color: var(--rose);
  margin-top: 5px;
}

.input, .select, .textarea,
input[type="text"], input[type="email"], input[type="tel"],
input[type="number"], input[type="password"], input[type="time"],
input[type="date"], input[type="datetime-local"], input[type="url"],
textarea, select {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  font-family: var(--body);
  font-size: 14px;
  color: var(--ink-900);
  transition: border-color .15s, box-shadow .15s;
}
.textarea, textarea {
  height: auto;
  min-height: 96px;
  padding: 10px 14px;
  line-height: 1.5;
  resize: vertical;
}

.input:focus, .select:focus, .textarea:focus,
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-100);
}
.input::placeholder, .textarea::placeholder { color: var(--ink-400); }
.input--invalid { border-color: var(--rose); }
.input--invalid:focus { box-shadow: 0 0 0 3px var(--danger-soft); }

.select, select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
  padding-right: 38px;
}

.row {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* Checkbox / radio nativos modernos */
input[type="checkbox"], input[type="radio"] {
  appearance: none;
  width: 18px; height: 18px;
  border: 1.5px solid var(--ink-300);
  border-radius: 5px;
  background: white;
  margin: 0;
  position: relative;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  flex-shrink: 0;
}
input[type="radio"] { border-radius: 50%; }
input[type="checkbox"]:checked,
input[type="radio"]:checked {
  border-color: var(--blue);
  background: var(--blue);
}
input[type="checkbox"]:checked::after {
  content: '';
  position: absolute; inset: 2px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center/contain no-repeat;
}
input[type="radio"]:checked::after {
  content: '';
  position: absolute; inset: 4px;
  background: white;
  border-radius: 50%;
}
input[type="checkbox"]:focus, input[type="radio"]:focus {
  outline: 0;
  box-shadow: 0 0 0 3px var(--blue-100);
}

.check {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer;
  font-size: 14px;
  padding: 6px 0;
}

/* Toggle switch (compat com classe .switch que já existe nas páginas) */
.switch-wrap { display: flex; align-items: center; gap: 12px; }
.switch {
  position: relative;
  display: inline-block;
  width: 44px; height: 26px;
  flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch__slider, .switch::before {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--ink-200);
  transition: background .2s;
  border-radius: 99px;
}
.switch__slider::before {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  left: 3px; bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.15);
}
.switch input:checked + .switch__slider {
  background: var(--blue);
}
.switch input:checked + .switch__slider::before {
  transform: translateX(18px);
}
/* Compat: switch antigo sem .switch__slider */
input[type=checkbox]:checked + .switch { background: var(--blue); }

/* ============================================================
   CHIPS / TAGS / BADGES
   ============================================================ */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 999px;
  font-family: var(--body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.4;
  background: var(--bg-mute);
  color: var(--ink-700);
}
.chip--success { background: var(--emerald-soft); color: #065F46; }
.chip--warning { background: var(--amber-soft);   color: #92400E; }
.chip--danger  { background: var(--danger-soft);  color: #991B1B; }
.chip--info    { background: var(--blue-100);     color: var(--blue-700); }
.chip--primary { background: var(--blue-100);     color: var(--blue); }
.chip__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ============================================================
   AVATAR (gradient azul→violeta)
   ============================================================ */
.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  overflow: hidden;
  flex-shrink: 0;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--sm { width: 30px; height: 30px; font-size: 12px; }
.avatar--lg { width: 56px; height: 56px; font-size: 18px; }
.avatar--xl { width: 80px; height: 80px; font-size: 24px; }

/* ============================================================
   FLASH MESSAGES
   ============================================================ */
.flash {
  padding: 14px 18px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  line-height: 1.5;
  border: 1px solid transparent;
}
.flash--info    { background: var(--blue-50);      color: var(--blue-700); border-color: var(--blue-100); }
.flash--success { background: var(--emerald-soft); color: #065F46; border-color: color-mix(in srgb, var(--emerald) 25%, transparent); }
.flash--warning { background: var(--amber-soft);   color: #92400E; border-color: color-mix(in srgb, var(--amber) 25%, transparent); }
.flash--danger,
.flash--erro,
.flash--error   { background: var(--danger-soft);  color: #991B1B; border-color: color-mix(in srgb, var(--rose) 25%, transparent); }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty {
  text-align: center;
  padding: 48px 24px;
  background: var(--paper);
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
}
.empty__icon {
  display: inline-flex;
  width: 64px; height: 64px;
  background: var(--blue-50);
  color: var(--blue);
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.empty h3 {
  font-family: var(--display);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  color: var(--ink-900);
}
.empty p {
  color: var(--ink-500);
  margin: 0 auto 14px;
  max-width: 380px;
  font-size: 14px;
}

/* ============================================================
   TABELAS
   ============================================================ */
table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--body);
  font-size: 14px;
}
table th {
  font-family: var(--display);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-500);
  text-align: left;
  padding: 12px 16px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
}
table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-900);
  vertical-align: middle;
}
table tbody tr:last-child td { border-bottom: none; }
table tbody tr { transition: background .12s; }
table tbody tr:hover { background: var(--bg-soft); }

.table-wrap {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

/* ============================================================
   DIVIDER
   ============================================================ */
.divider, hr {
  height: 1px;
  background: var(--line);
  margin: 20px 0;
  border: 0;
}

/* ============================================================
   MODAL · DIALOG
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
/* CRÍTICO: respeitar o atributo hidden do HTML
   (sem isso, .modal-overlay força display:flex e mostra mesmo com hidden) */
.modal-overlay[hidden],
[hidden] {
  display: none !important;
}
.modal {
  background: white;
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  max-width: 540px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: modalIn .2s ease-out;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.modal__head h3 {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.015em;
  flex: 1;
}
.modal__foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

/* ============================================================
   CALENDÁRIO (admin/agenda.php)
   ============================================================ */

/* Container principal da agenda */
.cal {
  display: flex;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

/* Coluna lateral das horas */
.cal-times {
  width: 64px;
  flex-shrink: 0;
  background: var(--bg-soft);
  border-right: 1px solid var(--line);
}
.cal-times-header {
  height: 56px;
  border-bottom: 1px solid var(--line);
}
.cal-hour {
  height: 60px;
  text-align: center;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-500);
  padding-top: 4px;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

/* Colunas de funcionários */
.cal-cols {
  flex: 1;
  display: flex;
  overflow-x: auto;
  min-width: 0;
}
.cal-col {
  flex: 1;
  min-width: 200px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
.cal-col:last-child { border-right: none; }

/* Header da coluna (foto + nome do funcionário) */
.cal-col-header {
  height: 56px;
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 2;
}
.cal-col-header .avatar {
  width: 32px;
  height: 32px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 12px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
  border: 2px solid var(--paper);
  box-shadow: var(--shadow-sm);
}
.cal-col-header strong {
  font-family: var(--display);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-900);
  letter-spacing: -0.01em;
}

/* Corpo da coluna (grade de horas em background) */
.cal-col-body {
  position: relative;
  flex: 1;
  background:
    repeating-linear-gradient(
      to bottom,
      var(--line-soft) 0px,
      var(--line-soft) 1px,
      transparent 1px,
      transparent 60px
    );
  min-height: 600px;
}

/* Slot vazio (hover pra criar) */
.cal-col-empty {
  position: absolute;
  left: 2px; right: 2px;
  cursor: pointer;
  transition: background .15s;
  border-radius: 6px;
}
.cal-col-empty:hover {
  background: color-mix(in srgb, var(--blue) 8%, transparent);
}

/* Bloco do agendamento */
.cal-block {
  position: absolute;
  left: 4px; right: 4px;
  border-radius: 10px;
  padding: 8px 10px;
  font-family: var(--body);
  font-size: 12px;
  line-height: 1.35;
  overflow: hidden;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, z-index 0s;
  background: linear-gradient(135deg, var(--blue-50), var(--blue-100));
  border-left: 3px solid var(--blue);
  color: var(--ink-900);
  box-shadow: var(--shadow-sm);
}
.cal-block:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  z-index: 5;
}
.cal-block__hora {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 11px;
  color: var(--blue);
  letter-spacing: 0.01em;
  margin-bottom: 2px;
}
.cal-block__cliente {
  font-family: var(--display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: -0.01em;
  color: var(--ink-900);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cal-block__servico {
  color: var(--ink-500);
  font-size: 11.5px;
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Estados do bloco por status */
.cal-block--pendente {
  background: linear-gradient(135deg, #FEF3C7, #FDE68A);
  border-left-color: #D97706;
  color: #78350F;
}
.cal-block--pendente .cal-block__hora { color: #B45309; }
.cal-block--pendente .cal-block__cliente { color: #78350F; }

.cal-block--confirmado {
  background: linear-gradient(135deg, var(--blue-50), var(--blue-100));
  border-left-color: var(--blue);
}

.cal-block--realizado {
  background: linear-gradient(135deg, #D1FAE5, #A7F3D0);
  border-left-color: #059669;
  color: #065F46;
}
.cal-block--realizado .cal-block__hora { color: #059669; }
.cal-block--realizado .cal-block__cliente { color: #065F46; }

.cal-block--cancelado {
  background: linear-gradient(135deg, #FECACA, #FCA5A5);
  border-left-color: #DC2626;
  opacity: 0.65;
  color: #7F1D1D;
}
.cal-block--cancelado .cal-block__cliente {
  text-decoration: line-through;
  color: #7F1D1D;
}

/* Bloqueio/almoço (visual listrado) */
.cal-block--bloqueio {
  background: repeating-linear-gradient(
    45deg,
    #F1F5F9, #F1F5F9 6px,
    #E2E8F0 6px, #E2E8F0 12px
  );
  border-left-color: #64748B;
  color: #475569;
}

/* Linha "agora" (now line) */
.cal-now {
  position: absolute;
  left: 0; right: 0;
  border-top: 2px solid #DC2626;
  z-index: 3;
  pointer-events: none;
  box-shadow: 0 0 12px rgba(220, 38, 38, 0.4);
}
.cal-now::before {
  content: '';
  position: absolute;
  left: -8px; top: -7px;
  width: 12px; height: 12px;
  background: #DC2626;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.2);
  animation: pulse-now 2s ease-in-out infinite;
}
@keyframes pulse-now {
  0%, 100% { box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.2); }
  50% { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0.1); }
}

/* Toolbar de navegação de data */
.cal-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.cal-nav .data-atual {
  font-family: var(--display);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.025em;
  padding: 0 14px;
  text-transform: capitalize;
  color: var(--ink-900);
}
.cal-nav .icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-700);
  transition: border-color .15s, color .15s, background .15s;
}
.cal-nav .icon-btn:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--bg-soft);
}

/* Estado vazio quando dia sem agendamentos */
.cal-col-empty-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  color: var(--ink-400);
  pointer-events: none;
}
.cal-col-empty-state svg {
  margin-bottom: 8px;
  opacity: 0.4;
}
.cal-col-empty-state p {
  font-size: 12px;
  margin: 0;
}

/* Mobile: ajusta tamanhos */
@media (max-width: 768px) {
  .cal-cols { overflow-x: scroll; }
  .cal-col { min-width: 160px; }
  .cal-times { width: 48px; }
  .cal-hour { font-size: 10.5px; }
}


/* ============================================================
   GRID / UTILITIES
   ============================================================ */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (min-width: 901px) {
  /* Mostra menu-toggle no DESKTOP também (pra colapsar sidebar) */
  .topbar .menu-toggle, .menu-toggle {
    display: inline-flex !important;
  }

  /* Sidebar COLAPSADA em desktop (só ícones) */
  body.sidebar-collapsed .sidebar {
    width: 72px;
  }
  body.sidebar-collapsed .sidebar__brand-text,
  body.sidebar-collapsed .sidebar__nav .section-title,
  body.sidebar-collapsed .sidebar__nav a > *:not(svg),
  body.sidebar-collapsed .sidebar-group > summary > span > *:not(svg),
  body.sidebar-collapsed .sidebar-group__chevron,
  body.sidebar-collapsed .sidebar-group > a > *:not(svg),
  body.sidebar-collapsed .sidebar__foot .user-meta {
    display: none !important;
  }
  body.sidebar-collapsed .sidebar__brand { justify-content: center; padding: 22px 12px 18px; }
  body.sidebar-collapsed .sidebar__nav { padding: 12px 8px; }
  body.sidebar-collapsed .sidebar__nav a,
  body.sidebar-collapsed .sidebar-group > summary,
  body.sidebar-collapsed .sidebar-group > a {
    justify-content: center;
    padding: 11px 0;
    gap: 0;
  }
  body.sidebar-collapsed .sidebar-group > summary > span:first-child {
    justify-content: center;
    gap: 0;
  }
  body.sidebar-collapsed .sidebar__foot {
    justify-content: center;
    padding: 14px 8px;
  }

  /* Tooltip ao hover (UX em colapsado) */
  body.sidebar-collapsed .sidebar__nav a {
    position: relative;
  }
  body.sidebar-collapsed .sidebar__nav a:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--ink-900);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: 500;
    white-space: nowrap;
    pointer-events: none;
    z-index: 100;
    box-shadow: var(--shadow-md);
  }
}

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    left: -100%;
    top: 0;
    z-index: 50;
    height: 100vh;
    width: 280px;
    transition: left .25s ease;
    box-shadow: var(--shadow-xl);
  }
  .sidebar.is-open { left: 0; }
  .topbar .menu-toggle, .menu-toggle { display: inline-flex; }
  .content { padding: 18px; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 12px; }
  .kpi { padding: 16px; }
  .kpi__value { font-size: 24px; }
  .grid-cards { grid-template-columns: 1fr; }
  .card { padding: 18px; }
  table th, table td { padding: 10px 12px; font-size: 13px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar__actions { width: 100%; }
}

@media (max-width: 480px) {
  .kpis { grid-template-columns: 1fr; }
  .toolbar__title h1 { font-size: 22px; }
  .topbar { padding: 0 16px; }
}

@media (max-width: 360px) {
  .content { padding: 12px; }
  .topbar { padding: 0 12px; }
}

/* ============================================================
   COMPONENTES GLOBAIS (extraídos das páginas com <style> inline)
   ============================================================ */

/* === Tabs (abas) — usado em mensagens_modelos, dashboard === */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}
.tab {
  padding: 11px 18px;
  text-decoration: none;
  color: var(--ink-500);
  font-family: var(--body);
  font-weight: 600;
  font-size: 14px;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: color .15s, border-color .15s;
  background: transparent;
  border-top: 0;
  border-left: 0;
  border-right: 0;
  cursor: pointer;
}
.tab:hover { color: var(--ink-900); text-decoration: none; }
.tab.is-active {
  color: var(--blue);
  border-bottom-color: var(--blue);
}
.tab .badge {
  background: var(--bg-mute);
  color: var(--ink-700);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -0.005em;
}
.tab.is-active .badge {
  background: var(--blue-100);
  color: var(--blue-700);
}

/* === Item card (modelos, conversas, transferências) === */
.item-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 10px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.item-card:hover {
  border-color: var(--ink-300);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.item-card__body { flex: 1; min-width: 0; }
.item-card__title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.015em;
  color: var(--ink-900);
  margin-bottom: 4px;
}
.item-card__meta {
  font-size: 13px;
  color: var(--ink-500);
  line-height: 1.5;
}
.item-card__actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

/* Aliases pra compatibilidade com classes antigas */
.mod-card, .av-card, .conv-card { /* item-card */ }
.mod-card, .av-card, .conv-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 10px;
  transition: border-color .15s, box-shadow .15s;
}
.mod-card:hover, .av-card:hover, .conv-card:hover {
  border-color: var(--ink-300);
  box-shadow: var(--shadow-sm);
}

/* === Conversation list (conversas, transferências) === */
.conv-list {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.conv-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink-900);
  transition: background .12s;
}
.conv-item:hover {
  background: var(--bg-soft);
  text-decoration: none;
}
.conv-item:last-child { border-bottom: none; }
.conv-item.is-active {
  background: var(--blue-50);
}
.conv-item__body { flex: 1; min-width: 0; }
.conv-item__title {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conv-item__preview {
  font-size: 13px;
  color: var(--ink-500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.conv-item__time {
  font-size: 11px;
  color: var(--ink-400);
  font-family: var(--mono);
  flex-shrink: 0;
}

/* === Auth card (login, 2fa) === */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, var(--blue-50), var(--bg-soft));
}
.auth-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}
.auth-card__brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 28px;
}
.auth-card__brand-mark {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-weight: 800;
  font-size: 20px;
  box-shadow: var(--shadow-blue);
}
.auth-card__title {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink-900);
}
.auth-card h1, .auth-card h2 {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.025em;
  text-align: center;
  margin-bottom: 8px;
}
.auth-card .lead {
  text-align: center;
  color: var(--ink-500);
  font-size: 14px;
  margin-bottom: 24px;
}

/* === Codigo Input (2FA) — 6 digit boxes === */
.codigo-grid {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 24px 0;
}
.codigo-inp {
  width: 48px;
  height: 56px;
  text-align: center;
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 700;
  border: 1px solid var(--ink-200);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink-900);
  transition: border-color .15s, box-shadow .15s;
}
.codigo-inp:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-100);
}

/* === Highlight box (dashboard, configuracoes) === */
.highlight-box {
  background: linear-gradient(135deg, var(--blue), var(--violet));
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  color: white;
  box-shadow: var(--shadow-blue);
}
.highlight-box h3 {
  font-family: var(--display);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.02em;
  color: white;
  margin-bottom: 6px;
}
.highlight-box p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  margin: 0;
}

/* === Trends (dashboard) === */
.trend-up   { color: var(--success); font-weight: 600; }
.trend-down { color: var(--rose); font-weight: 600; }

/* === Hero da página (h1 com gradient + subtítulo) === */
.page-hero {
  margin-bottom: 28px;
}
.page-hero h1 {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--ink-900);
  margin-bottom: 6px;
}
.page-hero h1 .grad-text {
  background: linear-gradient(135deg, var(--blue), var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.page-hero p {
  font-size: 15px;
  color: var(--ink-500);
  margin: 0;
  max-width: 640px;
}

/* === Empty state em forma de card === */
.empty-state-card {
  text-align: center;
  padding: 60px 32px;
  background: var(--paper);
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
}

/* === Form sections (usado em vários forms) === */
.form-section {
  padding: 24px 0;
  border-top: 1px solid var(--line);
}
.form-section:first-child { border-top: none; padding-top: 0; }
.form-section h3 {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ink-900);
  margin-bottom: 4px;
}
.form-section .form-section__desc {
  font-size: 13px;
  color: var(--ink-500);
  margin-bottom: 16px;
}

/* ============================================================
   PADRONIZAÇÃO DE TOOLBAR (sem precisar editar HTML das 36 páginas)
   ============================================================ */

/* Override do toolbar pra dar mais "wow factor" da landing */
.toolbar__title h1 {
  font-family: var(--display);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--ink-900);
  margin-bottom: 6px;
}

/* Linha sutil em gradient antes do título, marca registrada da landing */
.toolbar__title h1::before {
  content: '';
  display: block;
  width: 40px;
  height: 3px;
  background: linear-gradient(90deg, var(--blue), var(--violet));
  border-radius: 99px;
  margin-bottom: 14px;
}

/* Quando o título tem span.muted como subtítulo, dá mais respiro */
.toolbar__title h1 + .muted,
.toolbar__title h1 + span.muted,
.toolbar__title h1 + p.muted {
  display: block;
  font-size: 14.5px;
  color: var(--ink-500);
  margin: 6px 0 0;
  line-height: 1.5;
}

/* Mesmo padrão pra cabeçalhos fora de .toolbar */
.toolbar > div > h1 + p.muted,
.toolbar > div > h1 + .muted {
  display: block;
  font-size: 14.5px;
  color: var(--ink-500);
  margin: 6px 0 0;
}

/* Em mobile, título menor */
@media (max-width: 600px) {
  .toolbar__title h1 { font-size: 24px; }
  .toolbar__title h1::before { width: 32px; height: 2.5px; margin-bottom: 10px; }
}

/* ============================================================
   📱 MOBILE BOTTOM NAVBAR (estilo app)
   ============================================================
   Em desktop: sidebar normal + menu-toggle
   Em mobile (≤900px):
     - Sidebar vira drawer (some, abre só clicando em "Mais")
     - Bottom navbar fixa com 5 itens principais
     - Conteúdo ganha padding-bottom pra não esconder atrás da navbar
   ============================================================ */

.bottom-nav {
  display: none;
}

@media (max-width: 900px) {
  /* Esconde toggle do topbar (vamos usar o "Mais" da bottom nav) */
  .topbar .menu-toggle {
    display: none !important;
  }

  /* Mostra a bottom navbar */
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--paper);
    border-top: 1px solid var(--line);
    z-index: 60;
    box-shadow: 0 -4px 16px -4px rgba(15, 23, 42, 0.08);
    /* Safe area pra iPhone X+ (notch inferior) */
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  .bottom-nav__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    text-decoration: none;
    color: var(--ink-500);
    font-family: var(--body);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: -0.005em;
    transition: color .15s;
    cursor: pointer;
    background: transparent;
    border: 0;
    padding: 6px 4px;
    min-width: 0;
  }
  .bottom-nav__item svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
  }
  .bottom-nav__item span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }
  .bottom-nav__item:hover {
    color: var(--ink-900);
    text-decoration: none;
  }
  .bottom-nav__item.is-active {
    color: var(--blue);
  }
  .bottom-nav__item.is-active svg {
    color: var(--blue);
  }

  /* Indicador da rota ativa (linha em cima) */
  .bottom-nav__item.is-active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: var(--blue);
    border-radius: 0 0 3px 3px;
  }

  .bottom-nav__item {
    position: relative;
  }

  /* Badge de notificação (opcional) */
  .bottom-nav__badge {
    position: absolute;
    top: 6px;
    right: 24%;
    background: var(--rose);
    color: white;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 99px;
    min-width: 16px;
    text-align: center;
    line-height: 1;
  }

  /* Espaço inferior pra conteúdo não ficar embaixo da bottom-nav */
  .main {
    padding-bottom: 64px;
  }

  /* Sidebar mobile (drawer aberto via "Mais") */
  .sidebar {
    width: 86vw;
    max-width: 340px;
  }

  /* Topbar mais limpo em mobile */
  .topbar {
    padding: 0 16px;
    height: 60px;
  }
  .topbar h1 {
    font-size: 17px;
  }

  /* Content padding ajustado pra mobile */
  .content { padding: 16px; padding-bottom: 24px; }

  /* Hero/toolbar mais compacto */
  .toolbar { margin-bottom: 18px; }
  .toolbar__title h1 { font-size: 22px; }
  .toolbar__title h1::before { width: 32px; height: 2.5px; margin-bottom: 8px; }

  /* KPIs em 2 colunas */
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
  .kpi { padding: 14px 16px; }
  .kpi__value { font-size: 22px; }
  .kpi__label { font-size: 10px; }

  /* Cards mais compactos */
  .card { padding: 16px; border-radius: 14px; }
  .card--airy { padding: 18px; }

  /* Botões maiores (touch friendly) */
  .btn { height: 44px; font-size: 14px; padding: 0 20px; }
  .btn--sm { height: 36px; font-size: 13px; padding: 0 14px; }

  /* Inputs maiores (touch) */
  .input, .select, .textarea,
  input, select { height: 46px; font-size: 16px; /* iOS não dá zoom em 16px+ */ }

  /* Forms com mais respiro */
  .field { margin-bottom: 18px; }

  /* Tabela: pode rolar horizontal */
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
  }
  table th, table td {
    padding: 12px 14px;
    font-size: 13px;
    white-space: nowrap;
  }

  /* Sidebar mobile com itens maiores (touch) */
  .sidebar__nav a {
    padding: 12px 14px;
    font-size: 14.5px;
  }
  .sidebar-group > summary {
    padding: 12px 14px;
  }
  .sidebar-group > a {
    padding: 10px 14px 10px 28px;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .kpis { grid-template-columns: 1fr; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar__actions { width: 100%; }
  .toolbar__actions .btn { flex: 1; }

  /* Esconde labels longos na bottom nav (mantém só ícone) */
  .bottom-nav__item span {
    font-size: 10px;
  }
}

@media (max-width: 360px) {
  .bottom-nav { height: 60px; }
  .bottom-nav__item svg { width: 20px; height: 20px; }
  .bottom-nav__item span { font-size: 9.5px; }
  .main { padding-bottom: 60px; }
}

/* ============================================================
   LINKBIO PAGE (index.php pública do salão)
   Estilo bio link estilo Instagram, alinhado à landing
   ============================================================ */

.linkbio-page {
  background: linear-gradient(180deg, var(--bg-soft) 0%, var(--bg-mute) 100%);
  min-height: 100vh;
  font-family: var(--body);
}

.linkbio {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px 40px;
  position: relative;
}

/* ============================================================
   Topo: capa + avatar (3 modos)
   ============================================================ */

/* Modo 1: capa_avatar — capa em cima, avatar sobreposto
   ALTURA AUTOMÁTICA: imagem aparece COMPLETA, proporção preservada.
   Sem imagem = mantém altura fixa com gradient azul→violeta. */
.linkbio__cover {
  margin: 0 -16px 70px;
  position: relative;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  min-height: 200px;
  display: flex;
  align-items: stretch;
  border-radius: 0 0 24px 24px;
}
/* Imagem real (não background-image) — ocupa 100% largura,
   altura AUTO conforme a proporção da imagem.
   border-radius nela em vez de overflow:hidden no pai pro
   avatar continuar VISÍVEL inteiro fora do container. */
.linkbio__cover img.linkbio__cover-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 0 0 24px 24px;
}
/* Em mobile bem pequeno (≤380px), altura mínima reduzida */
@media (max-width: 380px) {
  .linkbio__cover { min-height: 160px; }
}

.linkbio__avatar {
  position: absolute;
  bottom: -50px;
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-family: var(--display);
  font-weight: 800;
  font-size: 40px;
  border: 5px solid white;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 2;
}
.linkbio__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ============================================================
   Nome e bio
   ============================================================ */
.linkbio__name {
  font-family: var(--display);
  font-weight: 800;
  font-size: 26px;
  letter-spacing: -0.025em;
  color: var(--ink-900);
  text-align: center;
  margin: 0 0 8px;
  padding: 0 16px;
}

.linkbio__bio {
  font-family: var(--body);
  font-size: 14.5px;
  color: var(--ink-500);
  text-align: center;
  margin: 0 0 28px;
  line-height: 1.5;
  padding: 0 12px;
}

/* ============================================================
   CTA principal (Agendar horário) — preto que vira azul
   ============================================================ */
.linkbio__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--ink-900);
  color: white;
  font-family: var(--body);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.005em;
  padding: 16px 20px;
  border-radius: 14px;
  text-decoration: none;
  margin-bottom: 12px;
  transition: background .2s, box-shadow .2s, transform .15s;
  border: 1px solid var(--ink-900);
}
.linkbio__cta:hover {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
  box-shadow: var(--shadow-blue);
  transform: translateY(-1px);
  text-decoration: none;
}
.linkbio__cta svg { width: 20px; height: 20px; }

/* ============================================================
   Botões (links bio)
   ============================================================ */
.linkbio__button {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 10px;
  text-decoration: none;
  color: var(--ink-900);
  font-family: var(--body);
  font-weight: 500;
  font-size: 14.5px;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.linkbio__button:hover {
  border-color: var(--ink-900);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--ink-900);
}

.linkbio__button-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--blue-50);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.linkbio__button-icon svg { width: 18px; height: 18px; }

.linkbio__button-content {
  flex: 1;
  min-width: 0;
}
.linkbio__button-title {
  font-weight: 600;
  font-size: 14.5px;
  color: var(--ink-900);
  margin-bottom: 2px;
}
.linkbio__button-desc {
  font-size: 12.5px;
  color: var(--ink-500);
}

.linkbio__button > span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================
   Seções (título "Serviços em destaque", etc)
   ============================================================ */
.linkbio__section-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-500);
  margin: 24px 0 12px;
  padding-left: 6px;
}

/* ============================================================
   Redes sociais
   ============================================================ */
.linkbio__social {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 28px 0 20px;
}
.linkbio__social a {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink-700);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .15s, color .15s, transform .15s;
  text-decoration: none;
}
.linkbio__social a:hover {
  border-color: var(--ink-900);
  color: var(--ink-900);
  transform: translateY(-2px);
  text-decoration: none;
}
.linkbio__social a svg { width: 20px; height: 20px; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 380px) {
  .linkbio { padding: 0 12px 32px; }
  .linkbio__cover { margin: 0 -12px 60px; min-height: 160px; }
  .linkbio__avatar { width: 96px; height: 96px; font-size: 34px; bottom: -44px; }
  .linkbio__name { font-size: 22px; }
}

/* ============================================================
   PERSONALIZAR · admin/personalizar.php
   ============================================================ */

/* Card de seção (cada bloco salva independente) */
.secao-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.secao-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  gap: 12px;
}
.secao-card__head h3 {
  font-family: var(--display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0 0 4px;
  color: var(--ink-900);
  display: flex;
  align-items: center;
  gap: 8px;
}
.secao-card__head .muted { font-size: 13px; }
.secao-card__foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

/* Preview da imagem em uso */
.img-preview-current {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px;
  background: var(--bg-soft);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  margin-bottom: 12px;
}
.img-preview-current .thumb {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  object-fit: cover;
  border: 2px solid var(--paper);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}
.img-preview-current .thumb-wide {
  width: 160px;
  height: 80px;
}
.img-preview-current__info {
  flex: 1;
  min-width: 0;
}
.img-preview-current__info strong {
  display: block;
  font-size: 14px;
  color: var(--ink-900);
  margin-bottom: 2px;
}
.img-preview-current__info .muted { font-size: 12.5px; }

/* Cards de modo_topo (radio styled) */
.modo-topo-card {
  background: var(--bg-soft);
  padding: 14px;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color .15s, background .15s;
}
.modo-topo-card:hover {
  border-color: var(--ink-200);
}
.modo-topo-card.is-selected {
  border-color: var(--blue);
  background: var(--blue-50);
}
.modo-topo-card strong {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-900);
}
.modo-topo-card .tiny {
  font-size: 11.5px;
  line-height: 1.4;
}

/* Galeria de imagens */
.galeria {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}
.galeria__item {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-soft);
  border: 2px solid var(--line);
  cursor: pointer;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.galeria__item:hover {
  border-color: var(--ink-700);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.galeria__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.galeria__item.is-em-uso {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-100);
}
.galeria__badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--blue);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 99px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  z-index: 2;
  box-shadow: var(--shadow-sm);
}
.galeria__hover {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  opacity: 0;
  transition: opacity .15s;
  padding: 4px;
}
.galeria__item:hover .galeria__hover {
  opacity: 1;
}
.btn-galeria {
  padding: 7px 10px;
  border-radius: 7px;
  border: none;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  text-align: center;
  font-family: var(--body);
}
.btn-galeria--logo {
  background: white;
  color: var(--ink-900);
}
.btn-galeria--logo:hover { background: var(--blue-50); color: var(--blue); }
.btn-galeria--capa {
  background: rgba(255,255,255,.2);
  color: white;
  border: 1px solid rgba(255,255,255,.4);
}
.btn-galeria--capa:hover { background: rgba(255,255,255,.3); }
.btn-galeria--excluir {
  background: var(--rose);
  color: white;
  font-size: 11px;
}
.btn-galeria--excluir:hover { background: #DC2626; }
.galeria__info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,.7), transparent);
  color: white;
  padding: 16px 8px 6px;
  font-size: 10.5px;
  text-align: center;
  font-family: var(--mono);
  pointer-events: none;
}
.galeria-vazia {
  padding: 32px 24px;
  text-align: center;
  color: var(--ink-500);
  font-size: 14px;
  background: var(--bg-soft);
  border-radius: var(--radius);
  border: 1px dashed var(--line);
}

/* Picker de ícone */
.icone-pick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: var(--bg-soft);
  border: 2px solid transparent;
  border-radius: 9px;
  cursor: pointer;
  color: var(--ink-500);
  transition: border-color .15s, background .15s, color .15s;
}
.icone-pick:hover {
  border-color: var(--ink-200);
  color: var(--ink-700);
}
.icone-pick.is-selected {
  border-color: var(--blue);
  background: var(--blue-50);
  color: var(--blue);
}

/* ============================================================
   SUMÁRIO DENTRO DOS CARDS (mostra o que tá salvo)
   ============================================================ */
.secao-resumo {
  background: linear-gradient(135deg, var(--blue-50), var(--bg-soft));
  border: 1px solid var(--blue-100);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 18px;
}
.secao-resumo__label {
  font-family: var(--display);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--blue-700);
  margin-bottom: 8px;
}
.secao-resumo__items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.resumo-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 500;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink-700);
  font-family: var(--body);
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.resumo-item.is-ok {
  background: var(--emerald-soft);
  border-color: var(--emerald);
  color: #065F46;
}
.resumo-item.is-vazio {
  background: var(--bg-mute);
  border-color: var(--line);
  color: var(--ink-500);
}
.resumo-item.is-info {
  background: var(--blue-100);
  border-color: var(--blue);
  color: var(--blue-700);
}
.resumo-item strong {
  font-weight: 700;
}
.resumo-cor {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 4px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 500;
  background: var(--paper);
  border: 1px solid var(--line);
  font-family: var(--mono);
  color: var(--ink-700);
}
.resumo-cor__sample {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--paper);
  box-shadow: 0 0 0 1px var(--ink-200);
  display: inline-block;
}

/* ============================================================
   TOAST DE SUCESSO FLUTUANTE
   ============================================================ */
.salvo-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: white;
  border: 1px solid var(--emerald);
  border-radius: 14px;
  box-shadow: 0 20px 40px -12px rgba(16,185,129,.25), var(--shadow-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  max-width: 380px;
  z-index: 9999;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .3s, transform .3s;
  font-family: var(--body);
}
.salvo-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.salvo-toast__icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--emerald);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  flex-shrink: 0;
}
.salvo-toast__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.salvo-toast__body strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-900);
  font-family: var(--display);
  letter-spacing: -0.015em;
}
.salvo-toast__body span {
  font-size: 12.5px;
  color: var(--ink-500);
}

/* Em mobile: toast embaixo ocupando toda largura */
@media (max-width: 600px) {
  .salvo-toast {
    left: 16px;
    right: 16px;
    bottom: calc(64px + 16px); /* acima do bottom-nav */
    min-width: auto;
    max-width: none;
  }
}

/* ============================================================
   HIGHLIGHT da seção recém-salva
   ============================================================ */
.secao-card.is-recem-salvo {
  border-color: var(--emerald);
  box-shadow: 0 0 0 4px var(--emerald-soft), var(--shadow-md);
  animation: pulseSalvo 1.5s ease-in-out;
}
@keyframes pulseSalvo {
  0%, 100% { box-shadow: 0 0 0 4px var(--emerald-soft), var(--shadow-md); }
  50% { box-shadow: 0 0 0 8px var(--emerald-soft), var(--shadow-lg); }
}

/* ============================================================
   WIZARD DE AGENDAMENTO · agendar/index.php
   Inspirado em layout premium tipo "wizard de booking" mobile-first
   Respeita --primary do salão (definida no body).
   ============================================================ */

.wzx-body {
  background: var(--bg-soft);
  padding-bottom: 100px; /* espaço pro footer fixo */
}

.wzx {
  max-width: 580px;
  margin: 0 auto;
  padding: 18px 18px 32px;
}

/* ----- HEADER (voltar + fechar) ----- */
.wzx__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.wzx__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 7px 14px 7px 10px;
  color: var(--primary, var(--blue));
  font-family: var(--display);
  font-weight: 600;
  font-size: 13.5px;
  text-decoration: none;
  transition: background .15s, border-color .15s;
}
.wzx__back:hover {
  background: var(--bg-soft);
  border-color: var(--primary, var(--blue));
  text-decoration: none;
  color: var(--primary, var(--blue));
}
.wzx__close {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--ink-500);
  text-decoration: none;
  transition: background .15s;
}
.wzx__close:hover {
  background: var(--bg-mute);
  color: var(--ink-900);
  text-decoration: none;
}

/* ----- STEPPER (4 passos horizontais) ----- */
.wzx__stepper {
  display: flex;
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 12px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
}
.wzx__step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.wzx__step-bullet {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-mute);
  color: var(--ink-500);
  font-family: var(--display);
  font-weight: 700;
  font-size: 14px;
  border: 2px solid transparent;
  transition: all .2s;
}
.wzx__step.is-done .wzx__step-bullet {
  background: var(--primary, var(--blue));
  color: white;
}
.wzx__step.is-active .wzx__step-bullet {
  background: var(--paper);
  color: var(--primary, var(--blue));
  border-color: var(--primary, var(--blue));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary, var(--blue)) 18%, transparent);
}
.wzx__step-label {
  font-family: var(--display);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-500);
  white-space: nowrap;
}
.wzx__step.is-done .wzx__step-label,
.wzx__step.is-active .wzx__step-label {
  color: var(--primary, var(--blue));
}
.wzx__step-line {
  flex: 1;
  height: 2px;
  background: var(--bg-mute);
  margin: 0 4px;
  margin-bottom: 22px; /* alinha com o bullet, não com label */
  border-radius: 2px;
  transition: background .25s;
}
.wzx__step-line.is-done {
  background: var(--primary, var(--blue));
}

@media (max-width: 420px) {
  .wzx__step-label { font-size: 9.5px; letter-spacing: 0.04em; }
  .wzx__step-bullet { width: 28px; height: 28px; font-size: 13px; }
  .wzx__stepper { padding: 12px 8px; }
}

/* ----- TÍTULO DO PASSO ----- */
.wzx__title {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--ink-900);
  margin: 0 0 18px;
  line-height: 1.2;
}

/* ----- HERO DO SERVIÇO (manchete com chips) ----- */
.wzx__hero {
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--primary, var(--blue)) 90%, black),
    color-mix(in srgb, var(--primary, var(--blue)) 100%, transparent));
  color: white;
  border-radius: 18px;
  padding: 22px 22px 20px;
  margin-bottom: 22px;
  box-shadow: 0 12px 32px -8px color-mix(in srgb, var(--primary, var(--blue)) 35%, transparent);
  position: relative;
  overflow: hidden;
}
.wzx__hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 60%;
  height: 200%;
  background: radial-gradient(ellipse, rgba(255,255,255,0.12), transparent);
  pointer-events: none;
}
.wzx__hero-title {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin-bottom: 4px;
  position: relative;
}
.wzx__hero-sub {
  font-family: var(--body);
  font-size: 14.5px;
  opacity: 0.92;
  margin-bottom: 14px;
  position: relative;
}
.wzx__hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  position: relative;
}
.wzx__chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.22);
  color: white;
  font-family: var(--body);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 99px;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.25);
}
.wzx__chip-icon {
  font-size: 13px;
  display: inline-flex;
  align-items: center;
}
.wzx__chip--ok {
  background: rgba(16, 185, 129, 0.35);
  border-color: rgba(16, 185, 129, 0.55);
}

/* ----- FOOTER FIXO (resumo + CTA) ----- */
.wzx__footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--paper);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px -8px rgba(15, 23, 42, 0.1);
  padding: 12px 18px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 50;
}
.wzx__footer-info {
  flex: 1;
  min-width: 0;
}
.wzx__footer-meta {
  font-family: var(--body);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-900);
  margin-bottom: 2px;
}
.wzx__footer-meta strong {
  font-family: var(--mono);
  color: var(--primary, var(--blue));
}
.wzx__footer-price {
  font-family: var(--display);
  font-size: 17px;
  font-weight: 700;
  color: var(--ink-700);
}
.wzx__footer-cta {
  background: var(--primary, var(--blue));
  color: white;
  border: none;
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
  padding: 14px 28px;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 8px 20px -6px color-mix(in srgb, var(--primary, var(--blue)) 50%, transparent);
  transition: transform .15s, box-shadow .15s, background .15s;
}
.wzx__footer-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px -6px color-mix(in srgb, var(--primary, var(--blue)) 60%, transparent);
}
.wzx__footer-cta:active {
  transform: translateY(0);
}
.wzx__footer-hint {
  font-family: var(--body);
  font-size: 12.5px;
  color: var(--ink-500);
  padding: 8px 14px;
  background: var(--bg-soft);
  border-radius: 10px;
  white-space: nowrap;
}

/* ----- DATE GRID (chips de data — substitui o antigo) ----- */
.date-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 10px;
}
.date-grid a, .date-grid > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 12px 4px 10px;
  text-decoration: none;
  color: var(--ink-900);
  transition: border-color .15s, transform .12s, box-shadow .15s, background .15s;
}
.date-grid a:hover {
  border-color: var(--primary, var(--blue));
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}
.date-grid a.is-active {
  background: var(--primary, var(--blue));
  border-color: var(--primary, var(--blue));
  color: white;
  box-shadow: 0 8px 20px -6px color-mix(in srgb, var(--primary, var(--blue)) 50%, transparent);
}
.date-grid .dia {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.1;
}
.date-grid .dow {
  font-family: var(--display);
  font-size: 10.5px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-top: 4px;
  color: var(--ink-500);
}
.date-grid .mes {
  font-family: var(--display);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-500);
  margin-top: 1px;
}
.date-grid a.is-active .dow,
.date-grid a.is-active .mes {
  color: rgba(255, 255, 255, 0.85);
}

/* ----- SLOT GRID (chips de horário) ----- */
.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 10px;
}
.slot-grid a {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 14px 0;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 15px;
  color: var(--ink-900);
  text-decoration: none;
  transition: border-color .15s, transform .12s, box-shadow .15s, background .15s;
}
.slot-grid a:hover {
  border-color: var(--primary, var(--blue));
  color: var(--primary, var(--blue));
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}
.slot-grid a.is-active {
  background: var(--primary, var(--blue));
  border-color: var(--primary, var(--blue));
  color: white;
}

/* ----- Wizard option (lista de serviços/funcionários, mantido com refresh) ----- */
.wizard-option {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 10px;
  text-decoration: none;
  color: var(--ink-900);
  transition: border-color .15s, transform .12s, box-shadow .15s;
}
.wizard-option:hover {
  border-color: var(--primary, var(--blue));
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  color: var(--ink-900);
}
.wizard-option__icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--primary, var(--blue)) 12%, transparent);
  color: var(--primary, var(--blue));
}
.wizard-option__title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  color: var(--ink-900);
  letter-spacing: -0.015em;
}
.wizard-option__sub {
  font-size: 13px;
  color: var(--ink-500);
  margin-top: 2px;
  font-family: var(--body);
}
.wizard-option__chevron {
  color: var(--ink-300);
  margin-left: auto;
  flex-shrink: 0;
}

/* ============================================================
   CONVERSAS · admin/conversas.php
   Chat estilo WhatsApp moderno com bubbles, avatares coloridos,
   gradient na mensagem out, hover suave, mobile-first.
   ============================================================ */

.cv-app {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 14px;
  height: calc(100vh - 130px);
  min-height: 500px;
}

/* ----- SIDEBAR: lista de conversas ----- */
.cv-lista {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.cv-lista__head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cv-lista__head h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--ink-900);
}
.cv-busca {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--bg-soft);
}
.cv-busca .input {
  font-size: 13.5px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--paper);
}
.cv-lista__items {
  flex: 1;
  overflow-y: auto;
}

/* Item da lista */
.cv-item {
  padding: 12px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line-soft);
  transition: background .12s;
  position: relative;
}
.cv-item:hover {
  background: var(--bg-soft);
}
.cv-item.is-active {
  background: linear-gradient(90deg, var(--blue-50), transparent);
}
.cv-item.is-active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--blue);
  border-radius: 0 3px 3px 0;
}
.cv-item__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-weight: 800;
  font-size: 16px;
  flex-shrink: 0;
  border: 2px solid var(--paper);
  box-shadow: var(--shadow-sm);
}
.cv-item__body {
  flex: 1;
  min-width: 0;
}
.cv-item__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3px;
  gap: 8px;
}
.cv-item__nome {
  font-family: var(--display);
  font-weight: 700;
  font-size: 14.5px;
  color: var(--ink-900);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cv-item__hora {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-500);
  flex-shrink: 0;
}
.cv-item__msg {
  font-size: 12.5px;
  color: var(--ink-500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
  line-height: 1.4;
}
.cv-item__badges {
  display: flex;
  gap: 4px;
  align-items: center;
  margin-top: 4px;
}
.cv-item__contador {
  background: var(--blue);
  color: white;
  border-radius: 99px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--mono);
}
.cv-tag-mini {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 99px;
  background: #FEF3C7;
  color: #92400E;
  font-weight: 700;
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cv-tag-mini.is-humano { background: var(--blue-100); color: var(--blue-700); }
.cv-tag-mini.is-ia { background: #E0E7FF; color: #5B21B6; }

/* ----- CHAT principal ----- */
.cv-chat {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

/* Empty state */
.cv-chat__empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--ink-500);
  text-align: center;
}
.cv-chat__empty svg {
  color: var(--blue-100);
  margin-bottom: 16px;
}
.cv-chat__empty h3 {
  margin: 0 0 6px;
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink-700);
  letter-spacing: -0.015em;
}
.cv-chat__empty p { font-size: 13.5px; max-width: 320px; }

.cv-chat__active {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Header do chat */
.cv-chat__head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--paper);
}
.cv-back { display: none; }
.cv-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-weight: 800;
  font-size: 15px;
  flex-shrink: 0;
  border: 2px solid var(--paper);
  box-shadow: var(--shadow-sm);
}
.cv-head-info {
  flex: 1;
  min-width: 0;
}
.cv-head-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 15.5px;
  color: var(--ink-900);
  letter-spacing: -0.01em;
}
.cv-head-tel {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-500);
  margin-top: 2px;
}
.cv-head-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}
.cv-tag {
  font-family: var(--display);
  font-size: 10.5px;
  padding: 4px 10px;
  border-radius: 99px;
  background: #FEF3C7;
  color: #92400E;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.cv-tag.is-humano { background: var(--blue-100); color: var(--blue-700); }

/* Área de mensagens */
.cv-chat__msgs {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background:
    radial-gradient(circle at 20% 20%, color-mix(in srgb, var(--blue-100) 40%, transparent), transparent 50%),
    radial-gradient(circle at 80% 80%, color-mix(in srgb, var(--violet) 8%, transparent), transparent 50%),
    var(--bg-soft);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cv-msg {
  max-width: 75%;
  display: flex;
  flex-direction: column;
}
.cv-msg--in { align-self: flex-start; }
.cv-msg--out { align-self: flex-end; align-items: flex-end; }

/* Autor (acima do bubble) */
.cv-msg__autor {
  font-family: var(--display);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
  padding: 0 6px;
  color: var(--blue);
  display: flex;
  align-items: center;
  gap: 4px;
}
.cv-msg__autor svg { width: 11px; height: 11px; }
.cv-msg__autor--ia { color: #059669; }
.cv-msg__autor--auto { color: var(--ink-500); }

/* Bubble */
.cv-msg__bolha {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.45;
  word-wrap: break-word;
  box-shadow: var(--shadow-sm);
}
.cv-msg--in .cv-msg__bolha {
  background: var(--paper);
  border: 1px solid var(--line);
  border-bottom-left-radius: 5px;
  color: var(--ink-900);
}
.cv-msg--out .cv-msg__bolha {
  background: linear-gradient(135deg, var(--blue), var(--blue-700));
  color: white;
  border-bottom-right-radius: 5px;
  box-shadow: 0 6px 16px -4px color-mix(in srgb, var(--blue) 40%, transparent);
}

/* Variante IA — verde emerald */
.cv-msg--in.cv-msg--ia .cv-msg__bolha {
  background: linear-gradient(135deg, #F0FDF4, #D1FAE5);
  border-color: #6EE7B7;
  color: #064E3B;
}

/* Markdown WhatsApp dentro do bubble */
.cv-msg__bolha b, .cv-msg__bolha strong { font-weight: 700; }
.cv-msg__bolha i, .cv-msg__bolha em { font-style: italic; }
.cv-msg__bolha s { text-decoration: line-through; opacity: 0.7; }
.cv-msg__bolha code {
  font-family: var(--mono);
  font-size: 12.5px;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(0,0,0,.08);
}
.cv-msg--out .cv-msg__bolha code { background: rgba(255,255,255,.22); }

.cv-msg__hora {
  font-family: var(--mono);
  font-size: 10.5px;
  opacity: 0.7;
  margin-top: 4px;
  padding: 0 6px;
  display: flex;
  align-items: center;
  gap: 3px;
}
.cv-msg--out .cv-msg__hora {
  color: var(--ink-500);
  align-self: flex-end;
}
.cv-msg--in .cv-msg__hora {
  color: var(--ink-500);
}
.cv-msg__status { font-size: 11px; }

/* Separador de data */
.cv-sep {
  text-align: center;
  margin: 18px 0 8px;
}
.cv-sep span {
  font-family: var(--display);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 5px 14px;
  background: var(--paper);
  color: var(--ink-500);
  border-radius: 99px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

/* ----- Formulário de envio ----- */
.cv-chat__form {
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  align-items: flex-end;
  background: var(--paper);
}
.cv-chat__form textarea {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 10px 16px;
  font-family: var(--body);
  font-size: 14px;
  resize: none;
  outline: none;
  line-height: 1.4;
  max-height: 120px;
  transition: border-color .15s, box-shadow .15s;
}
.cv-chat__form textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-100);
}
.cv-chat__form .btn {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--blue-700));
  color: white;
  border: none;
  box-shadow: 0 6px 16px -4px color-mix(in srgb, var(--blue) 40%, transparent);
  transition: transform .15s, box-shadow .15s;
}
.cv-chat__form .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -4px color-mix(in srgb, var(--blue) 50%, transparent);
}
.cv-chat__form .btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.cv-assinatura-hint {
  padding: 6px 18px 10px;
  font-size: 11.5px;
  color: var(--ink-500);
  background: var(--paper);
  border-top: 1px dashed var(--line);
}
.cv-assinatura-hint strong {
  font-family: var(--display);
  color: var(--blue);
  font-weight: 700;
}

/* Empty states */
.cv-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--ink-500);
}
.cv-empty p {
  margin: 10px 0 0;
  font-size: 13.5px;
}
.cv-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--line);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: cv-spin 0.8s linear infinite;
  margin: 0 auto;
}
@keyframes cv-spin { to { transform: rotate(360deg); } }

/* ----- Modal (nova conversa) ----- */
.cv-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.cv-modal__box {
  background: var(--paper);
  border-radius: 18px;
  width: 100%;
  max-width: 500px;
  padding: 20px;
  box-shadow: 0 24px 48px -12px rgba(15, 23, 42, 0.3);
}
.cv-modal__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.cv-modal__head strong {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.015em;
}
.cv-modal__results {
  max-height: 360px;
  overflow-y: auto;
  margin-top: 10px;
}
.cv-modal__results .cv-result {
  padding: 12px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  border-radius: 8px;
  transition: background .12s;
}
.cv-modal__results .cv-result:hover {
  background: var(--bg-soft);
}
.cv-modal__results strong {
  display: block;
  font-family: var(--display);
  font-size: 14px;
  font-weight: 700;
}
.cv-modal__results small {
  color: var(--ink-500);
  font-size: 12px;
  font-family: var(--mono);
}

/* ----- Mobile ----- */
@media (max-width: 768px) {
  .cv-app {
    grid-template-columns: 1fr;
    height: calc(100vh - 110px);
    gap: 0;
  }
  .cv-lista { display: flex; border-radius: 0; }
  .cv-app.has-active .cv-lista { display: none; }
  .cv-chat { display: none; border-radius: 0; }
  .cv-app.has-active .cv-chat { display: flex; }
  .cv-back {
    display: inline-flex !important;
    transform: rotate(90deg);
    background: var(--bg-soft);
    border: 1px solid var(--line);
  }
  .cv-item__msg { max-width: none; }
  .cv-chat__msgs { padding: 14px; }
}

/* ============================================================
   SUCESSO DO AGENDAMENTO · /agendar/?passo=sucesso
   Card rico com check verde + detalhes + ações
   Respeita a cor primária do salão.
   ============================================================ */

.wzx-sucesso {
  text-align: center;
  padding: 24px 0 32px;
  max-width: 100%;
}

/* Ícone gigante de check verde com sombra colorida */
.wzx-sucesso__icone {
  width: 88px;
  height: 88px;
  margin: 0 auto 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10B981, #059669);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 20px 40px -10px rgba(16,185,129,0.4),
    0 0 0 6px rgba(16,185,129,0.1);
  animation: sucesso-bounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes sucesso-bounce {
  0% { opacity: 0; transform: scale(0.3); }
  100% { opacity: 1; transform: scale(1); }
}

.wzx-sucesso__titulo {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--ink-900);
  margin: 0 0 8px;
  line-height: 1.2;
}

.wzx-sucesso__sub {
  color: var(--ink-500);
  font-size: 14.5px;
  margin: 0 0 28px;
  line-height: 1.45;
}
.wzx-sucesso__sub strong {
  font-family: var(--mono);
  color: var(--ink-900);
  font-weight: 600;
}

/* Card de detalhes com gradient sutil da cor primária */
.wzx-sucesso__card {
  text-align: left;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--primary, var(--blue)) 8%, var(--paper)),
    color-mix(in srgb, var(--primary, var(--blue)) 4%, var(--paper)));
  border: 1px solid color-mix(in srgb, var(--primary, var(--blue)) 25%, transparent);
  border-radius: 18px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.wzx-sucesso__card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px dashed color-mix(in srgb, var(--primary, var(--blue)) 30%, transparent);
}
.wzx-sucesso__card-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--paper);
  color: var(--primary, var(--blue));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}
.wzx-sucesso__card-head strong {
  display: block;
  font-family: var(--display);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.015em;
  color: var(--ink-900);
}
.wzx-sucesso__card-head small {
  font-size: 12.5px;
  color: var(--ink-500);
}

.wzx-sucesso__field {
  margin-bottom: 12px;
}
.wzx-sucesso__field:last-child { margin-bottom: 0; }

.wzx-sucesso__field-label {
  display: block;
  font-family: var(--display);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-500);
  margin-bottom: 3px;
}
.wzx-sucesso__field-value {
  display: block;
  font-family: var(--body);
  font-weight: 600;
  font-size: 14.5px;
  color: var(--ink-900);
  line-height: 1.4;
}
.wzx-sucesso__field-mono {
  font-family: var(--mono);
  font-weight: 600;
}
.wzx-sucesso__field--addr {
  font-size: 13.5px;
  color: var(--ink-700);
}
.wzx-sucesso__field-link {
  display: inline-block;
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--primary, var(--blue));
  font-weight: 600;
  text-decoration: none;
}
.wzx-sucesso__field-link:hover { text-decoration: underline; }

/* Linha de 3 colunas (data, hora, duração) */
.wzx-sucesso__row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.wzx-sucesso__row .wzx-sucesso__field { margin-bottom: 0; }

/* Aviso de pendente (amarelo) */
.wzx-sucesso__aviso {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: linear-gradient(135deg, #FEF3C7, #FDE68A);
  border: 1px solid #F59E0B;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 20px;
  text-align: left;
}
.wzx-sucesso__aviso-icone {
  font-size: 22px;
  flex-shrink: 0;
}
.wzx-sucesso__aviso-texto {
  font-size: 13.5px;
  color: #78350F;
  line-height: 1.45;
}
.wzx-sucesso__aviso-texto strong {
  font-family: var(--display);
  font-weight: 700;
}

/* Botões de ação */
.wzx-sucesso__acoes {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 24px;
  flex-wrap: wrap;
}
.wzx-sucesso__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 12px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  transition: transform .15s, box-shadow .15s, background .15s, color .15s;
  border: 2px solid transparent;
}
.wzx-sucesso__btn--primary {
  background: var(--primary, var(--blue));
  color: white;
  box-shadow: 0 8px 20px -6px color-mix(in srgb, var(--primary, var(--blue)) 50%, transparent);
}
.wzx-sucesso__btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -6px color-mix(in srgb, var(--primary, var(--blue)) 60%, transparent);
  text-decoration: none;
  color: white;
}
.wzx-sucesso__btn--ghost {
  background: var(--paper);
  color: var(--ink-700);
  border-color: var(--line);
}
.wzx-sucesso__btn--ghost:hover {
  border-color: var(--primary, var(--blue));
  color: var(--primary, var(--blue));
  text-decoration: none;
}

.wzx-sucesso__dica {
  margin-top: 24px;
  font-size: 12.5px;
  color: var(--ink-500);
  line-height: 1.5;
}

/* Mobile */
@media (max-width: 480px) {
  .wzx-sucesso__titulo { font-size: 24px; }
  .wzx-sucesso__icone { width: 76px; height: 76px; }
  .wzx-sucesso__row { grid-template-columns: 1fr 1fr; }
  .wzx-sucesso__row .wzx-sucesso__field:last-child { grid-column: 1 / -1; }
}

/* ============================================================
   IA · status banner + barras de consumo (modernização sutil
   pra adm/ia.php exibir o uso da IA de forma mais visual)
   ============================================================ */

.ia-status {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, #D1FAE5, #A7F3D0);
  border: 1px solid #34D399;
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 22px;
}
.ia-status--off {
  background: linear-gradient(135deg, #F1F5F9, #E2E8F0);
  border-color: var(--ink-300);
}
.ia-status__icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #059669;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.ia-status--off .ia-status__icon { background: var(--ink-500); }
.ia-status__body {
  flex: 1;
}
.ia-status__body h3 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 16px;
  margin: 0 0 2px;
  color: #064E3B;
  letter-spacing: -0.015em;
}
.ia-status--off .ia-status__body h3 { color: var(--ink-700); }
.ia-status__body p {
  font-size: 13px;
  color: #065F46;
  margin: 0;
}
.ia-status--off .ia-status__body p { color: var(--ink-500); }
.ia-status__body p strong { font-family: var(--mono); font-weight: 600; }
.ia-status__pill {
  background: rgba(255,255,255,0.6);
  font-family: var(--mono);
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 99px;
  font-size: 12.5px;
  color: #065F46;
  flex-shrink: 0;
}
.ia-status--off .ia-status__pill { color: var(--ink-700); }

/* Cards de consumo (mensagens + tokens) */
.ia-consumo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 22px;
}
.ia-consumo-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  transition: border-color .15s, box-shadow .15s;
}
.ia-consumo-card:hover {
  border-color: var(--blue-100);
  box-shadow: var(--shadow-sm);
}
.ia-consumo-card h4 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-500);
  margin: 0 0 8px;
}
.ia-consumo-card__valor {
  font-family: var(--display);
  font-weight: 800;
  font-size: 30px;
  line-height: 1;
  color: var(--ink-900);
  letter-spacing: -0.025em;
}
.ia-consumo-card__valor small {
  font-size: 14.5px;
  color: var(--ink-500);
  font-weight: 600;
  margin-left: 4px;
}
.ia-consumo-card__bar {
  background: var(--bg-mute);
  height: 8px;
  border-radius: 99px;
  overflow: hidden;
  margin: 12px 0 8px;
}
.ia-consumo-card__bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #10B981, #34D399);
  border-radius: 99px;
  transition: width .3s;
}
.ia-consumo-card__bar-fill.is-warn { background: linear-gradient(90deg, #F59E0B, #FBBF24); }
.ia-consumo-card__bar-fill.is-danger { background: linear-gradient(90deg, #DC2626, #EF4444); }
.ia-consumo-card__hint {
  font-size: 12.5px;
  color: var(--ink-500);
}
.ia-consumo-card__hint strong {
  color: var(--ink-900);
  font-weight: 600;
}

@media (max-width: 600px) {
  .ia-consumo-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   CADASTROS · sistema de design moderno
   Padrão visual aplicado em clientes / serviços / funcionários
   ============================================================ */

/* Header da página de cadastro */
.cad-header {
  background: white;
  color: var(--ink-900);
  padding: 22px 26px;
  border-radius: 16px;
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-top: 4px solid var(--primary, #0EA5E9);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 8px -2px rgba(15, 23, 42, 0.04);
}
.cad-header::before {
  display: none; /* sem efeito de brilho — visual mais clean */
}
.cad-header__content {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.cad-header__title {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: 0 0 4px;
  color: var(--ink-900);
}
.cad-header__sub {
  font-size: 13.5px;
  color: var(--ink-500);
  margin: 0;
}
.cad-header__sub strong {
  background: color-mix(in srgb, var(--primary, #0EA5E9) 12%, transparent);
  color: color-mix(in srgb, var(--primary, #0EA5E9) 85%, #000);
  padding: 2px 10px;
  border-radius: 99px;
  font-weight: 700;
}

/* Botão do header — agora colorido em vez de branco */
.cad-header__btn {
  background: var(--primary, #0EA5E9);
  color: white;
  font-weight: 700;
  border: none;
  padding: 10px 18px;
  border-radius: 10px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-family: var(--display);
  transition: transform .15s, box-shadow .15s, filter .15s;
  box-shadow: 0 4px 12px -2px color-mix(in srgb, var(--primary, #0EA5E9) 40%, transparent);
}
.cad-header__btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow: 0 8px 20px -4px color-mix(in srgb, var(--primary, #0EA5E9) 50%, transparent);
  text-decoration: none;
  color: white;
}

/* Toolbar com busca + filtros + botão "novo" */
.cad-toolbar {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 18px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}
.cad-toolbar__search {
  flex: 1;
  min-width: 200px;
  position: relative;
}
.cad-toolbar__search input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
  background: var(--bg-soft);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.cad-toolbar__search input:focus {
  outline: none;
  background: var(--paper);
  border-color: var(--blue);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 10%, transparent);
}
.cad-toolbar__search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-400);
  pointer-events: none;
}

/* Chips de filtro temporal */
.cad-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.cad-filter {
  padding: 8px 14px;
  border-radius: 99px;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink-700);
  text-decoration: none;
  font-family: var(--display);
  font-size: 12.5px;
  font-weight: 600;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cad-filter:hover {
  border-color: var(--blue);
  color: var(--blue);
  text-decoration: none;
}
.cad-filter.is-active {
  background: linear-gradient(135deg, var(--blue), var(--blue-700));
  color: white;
  border-color: var(--blue);
  box-shadow: 0 4px 12px -2px color-mix(in srgb, var(--blue) 40%, transparent);
}
.cad-filter__count {
  background: rgba(255,255,255,0.25);
  padding: 1px 7px;
  border-radius: 99px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
}
.cad-filter:not(.is-active) .cad-filter__count {
  background: var(--bg-mute);
  color: var(--ink-500);
}

/* Cards de lista (cliente, serviço, funcionário) */
.cad-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.cad-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  transition: transform .15s, box-shadow .15s, border-color .15s;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cad-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--blue) 35%, var(--line));
  box-shadow: var(--shadow-md);
}
.cad-card__top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.cad-card__avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-weight: 800;
  font-size: 17px;
  flex-shrink: 0;
  border: 2px solid var(--paper);
  box-shadow: var(--shadow-sm);
}
.cad-card__name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 16px;
  color: var(--ink-900);
  letter-spacing: -0.015em;
  margin: 0 0 2px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cad-card__name a { color: inherit; text-decoration: none; }
.cad-card__name a:hover { color: var(--blue); }
.cad-card__sub {
  font-size: 12.5px;
  color: var(--ink-500);
  font-family: var(--mono);
}
.cad-card__body {
  font-size: 13px;
  color: var(--ink-700);
  line-height: 1.5;
}
.cad-card__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-top: 1px dashed var(--line-soft);
  font-size: 12.5px;
}
.cad-card__row:first-of-type { border-top: none; }
.cad-card__row-label {
  color: var(--ink-500);
  font-weight: 500;
}
.cad-card__row-value {
  font-weight: 600;
  color: var(--ink-900);
}
.cad-card__row-value.mono { font-family: var(--mono); }

/* Status badge (categoria do cliente) */
.cad-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 99px;
  font-family: var(--display);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cad-badge--novo     { background: #E0E7FF; color: #4338CA; }
.cad-badge--ativo    { background: #D1FAE5; color: #065F46; }
.cad-badge--ausente  { background: #FEF3C7; color: #92400E; }
.cad-badge--perdido  { background: #FECACA; color: #7F1D1D; }
.cad-badge--vip      { background: linear-gradient(135deg, #FBBF24, #F59E0B); color: #78350F; }

.cad-card__actions {
  display: flex;
  gap: 6px;
  margin-top: auto;
}
.cad-card__btn {
  flex: 1;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  font-family: var(--display);
  text-align: center;
  text-decoration: none;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-700);
  transition: all .15s;
  cursor: pointer;
}
.cad-card__btn:hover {
  border-color: var(--blue);
  color: var(--blue);
  text-decoration: none;
}
.cad-card__btn--primary {
  background: linear-gradient(135deg, var(--blue), var(--blue-700));
  color: white;
  border-color: var(--blue);
}
.cad-card__btn--primary:hover {
  color: white;
  box-shadow: 0 4px 12px -2px color-mix(in srgb, var(--blue) 40%, transparent);
}
.cad-card__btn--wpp {
  background: linear-gradient(135deg, #25D366, #128C7E);
  color: white;
  border-color: #128C7E;
}
.cad-card__btn--wpp:hover { color: white; }

/* Estado de "ausente há X dias" */
.cad-card__retencao {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--bg-soft);
  margin-bottom: 4px;
}
.cad-card__retencao--alerta {
  background: #FEF3C7;
  color: #92400E;
}
.cad-card__retencao--critico {
  background: #FECACA;
  color: #7F1D1D;
}
.cad-card__retencao .num {
  font-family: var(--display);
  font-weight: 800;
  font-size: 14px;
}

/* Empty state */
.cad-empty {
  background: var(--paper);
  border: 2px dashed var(--line);
  border-radius: 16px;
  padding: 48px 24px;
  text-align: center;
  color: var(--ink-500);
}
.cad-empty__icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.6;
}
.cad-empty__title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 17px;
  color: var(--ink-700);
  margin: 0 0 4px;
}
.cad-empty__sub {
  font-size: 13.5px;
  margin: 0 0 16px;
}

/* ============================================================
   FORMULÁRIO modernizado
   ============================================================ */
.cad-form {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
}
.cad-form__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.cad-form__head-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--blue-50), var(--blue-100));
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cad-form__head h2 {
  font-family: var(--display);
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.025em;
  margin: 0;
  color: var(--ink-900);
}
.cad-form__head p {
  font-size: 13px;
  color: var(--ink-500);
  margin: 2px 0 0;
}

.cad-form__section {
  margin-bottom: 22px;
}
.cad-form__section:last-child { margin-bottom: 0; }
.cad-form__section-title {
  font-family: var(--display);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-500);
  margin: 0 0 10px;
}

.cad-form__grid {
  display: grid;
  gap: 14px;
}
.cad-form__grid--2 { grid-template-columns: 1fr 1fr; }
.cad-form__grid--3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 600px) {
  .cad-form__grid--2,
  .cad-form__grid--3 { grid-template-columns: 1fr; }
}

.cad-form__field { display: flex; flex-direction: column; gap: 4px; }
.cad-form__field label {
  font-family: var(--display);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-700);
}
.cad-form__field label .required { color: #DC2626; }
.cad-form__field input,
.cad-form__field textarea,
.cad-form__field select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
  font-family: var(--body);
  background: var(--paper);
  color: var(--ink-900);
  transition: border-color .15s, box-shadow .15s;
}
.cad-form__field input:focus,
.cad-form__field textarea:focus,
.cad-form__field select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 10%, transparent);
}
.cad-form__field input.mono { font-family: var(--mono); }
.cad-form__field .hint {
  font-size: 12px;
  color: var(--ink-500);
  margin-top: 2px;
}

.cad-form__actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 18px;
  margin-top: 18px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

/* ============================================================
   PERFIL DETALHADO (página do cliente individual)
   ============================================================ */
.cad-perfil {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 18px;
  margin-bottom: 22px;
}
@media (max-width: 900px) {
  .cad-perfil { grid-template-columns: 1fr; }
}

.cad-perfil__main {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cad-perfil__side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cad-perfil__hero {
  background: white;
  color: var(--ink-900);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-top: 4px solid var(--primary, #0EA5E9);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 8px -2px rgba(15, 23, 42, 0.04);
}
.cad-perfil__hero::before {
  display: none;
}
.cad-perfil__avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg,
    var(--primary, #0EA5E9),
    color-mix(in srgb, var(--primary, #0EA5E9) 75%, #000));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-weight: 800;
  font-size: 24px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  box-shadow: 0 4px 12px -2px color-mix(in srgb, var(--primary, #0EA5E9) 35%, transparent);
}
.cad-perfil__info {
  flex: 1;
  position: relative;
  z-index: 1;
}
.cad-perfil__name {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: 0 0 4px;
  color: var(--ink-900);
}
.cad-perfil__meta {
  font-size: 13px;
  color: var(--ink-500);
  font-family: var(--mono);
}
.cad-perfil__badges {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.cad-perfil__badges .cad-badge {
  /* Mantém estilo padrão das badges (não força branco) */
}

/* Stats em grid (no perfil) */
.cad-perfil__stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.cad-perfil__stat {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
}
.cad-perfil__stat-num {
  font-family: var(--display);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.025em;
  color: var(--ink-900);
  line-height: 1;
}
.cad-perfil__stat-label {
  font-size: 11px;
  color: var(--ink-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
  margin-top: 4px;
  font-family: var(--display);
}
@media (max-width: 600px) {
  .cad-perfil__stats { grid-template-columns: 1fr 1fr; }
}

/* Timeline de histórico */
.cad-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.cad-timeline__item {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
  position: relative;
}
.cad-timeline__item:last-child { border-bottom: none; padding-bottom: 0; }
.cad-timeline__date {
  flex-shrink: 0;
  width: 60px;
  text-align: center;
  padding: 6px 8px;
  background: var(--bg-soft);
  border-radius: 10px;
}
.cad-timeline__date .dia {
  font-family: var(--display);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.025em;
  color: var(--ink-900);
  line-height: 1;
}
.cad-timeline__date .mes {
  font-size: 10px;
  color: var(--ink-500);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-top: 2px;
}
.cad-timeline__body {
  flex: 1;
  min-width: 0;
}
.cad-timeline__title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 14px;
  color: var(--ink-900);
  margin: 0 0 2px;
}
.cad-timeline__sub {
  font-size: 12.5px;
  color: var(--ink-500);
}
.cad-timeline__valor {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 13px;
  color: var(--ink-900);
  flex-shrink: 0;
  align-self: center;
}

/* ============================================================
   WIDGET de RETENÇÃO no dashboard
   ============================================================ */
.retencao-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}
.retencao-card::before {
  content: '';
  position: absolute;
  right: -40px;
  top: -40px;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, #FEF3C7, transparent 70%);
  border-radius: 50%;
  opacity: 0.7;
}
.retencao-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  position: relative;
}
.retencao-card__title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  margin: 0;
  color: var(--ink-900);
  display: flex;
  align-items: center;
  gap: 8px;
}
.retencao-card__cta {
  font-size: 13px;
  color: var(--blue);
  font-weight: 600;
  text-decoration: none;
}
.retencao-card__cta:hover { text-decoration: underline; }

.retencao-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  position: relative;
}
.retencao-item {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 10px;
  text-align: center;
  text-decoration: none;
  color: inherit;
  transition: all .15s;
  cursor: pointer;
  display: block;
}
.retencao-item:hover {
  border-color: var(--blue);
  background: var(--paper);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}
.retencao-item__num {
  font-family: var(--display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.025em;
  line-height: 1;
  color: var(--ink-900);
}
.retencao-item__num.is-alerta { color: #D97706; }
.retencao-item__num.is-critico { color: #DC2626; }
.retencao-item__label {
  font-size: 10.5px;
  color: var(--ink-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
  margin-top: 4px;
  font-family: var(--display);
  line-height: 1.2;
}

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