/* ==========================================================================
   Agenda · design system
   Porcelana rosada + batom (destaque configurável) + lilás de apoio.
   Assinatura visual: o "swatch" em formato de ponta de unha (.swatch),
   usado na marca, nas cores dos serviços, na agenda e no histórico de cores.
   ========================================================================== */

/* ---------- Fontes locais ---------- */
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url("/vendor/fonts/plus-jakarta-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 500; font-style: normal; font-display: swap; src: url("/vendor/fonts/plus-jakarta-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 600; font-style: normal; font-display: swap; src: url("/vendor/fonts/plus-jakarta-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 700; font-style: normal; font-display: swap; src: url("/vendor/fonts/plus-jakarta-sans-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-weight: 500; font-style: normal; font-display: swap; src: url("/vendor/fonts/cormorant-garamond-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-weight: 600; font-style: normal; font-display: swap; src: url("/vendor/fonts/cormorant-garamond-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-weight: 500; font-style: italic; font-display: swap; src: url("/vendor/fonts/cormorant-garamond-latin-500-italic.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-weight: 600; font-style: italic; font-display: swap; src: url("/vendor/fonts/cormorant-garamond-latin-600-italic.woff2") format("woff2"); }

/* ---------- Tokens (tema claro) ---------- */
:root {
  /* --accent vem das Configurações (inline no layout); este é o padrão */
  --accent: #9E3F5C;

  --bg: #FBF7F6;          /* porcelana */
  --surface: #FFFFFF;
  --surface-2: #F6EEEC;   /* névoa rosada */
  --surface-3: #EFE3E0;
  --ink: #2E2328;         /* ameixa quase preta */
  --ink-2: #5E4F55;
  --muted: #7A6A70;
  --line: #EEE2DF;
  --line-strong: #E0CFCB;

  --brand: var(--accent);
  --brand-hover: color-mix(in oklab, var(--accent) 86%, black);
  --brand-ink: #FFFFFF;
  --brand-soft: color-mix(in oklab, var(--accent) 11%, white);
  --brand-soft-2: color-mix(in oklab, var(--accent) 20%, white);
  --brand-text: color-mix(in oklab, var(--accent) 92%, black);

  --lilac: #B9A6D3;
  --lilac-soft: #F1ECF7;
  --lilac-ink: #5A4780;

  --success: #3F7D63;  --success-soft: #E4F1EA;
  --warning: #A86A12;  --warning-soft: #FBF1DE;
  --danger:  #B23A3A;  --danger-soft:  #FAE5E3;
  --info:    #5A4780;  --info-soft:    #F1ECF7;

  /* status de agendamento */
  --st-agendado: #7A6A70;
  --st-confirmado: #5A4780;
  --st-concluido: #3F7D63;
  --st-faltou: #A86A12;
  --st-cancelado: #B23A3A;

  --font-body: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;

  --fs-xs: .75rem;
  --fs-sm: .8125rem;
  --fs-base: .9375rem;
  --fs-md: 1.0625rem;
  --fs-lg: 1.25rem;
  --fs-display: 2.25rem;
  --fs-number: 2rem;

  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-pill: 999px;

  --shadow-xs: 0 1px 2px rgba(74, 38, 52, .05);
  --shadow-sm: 0 1px 2px rgba(74, 38, 52, .04), 0 4px 14px rgba(74, 38, 52, .05);
  --shadow-md: 0 2px 6px rgba(74, 38, 52, .05), 0 12px 32px rgba(74, 38, 52, .08);
  --shadow-lg: 0 24px 60px rgba(74, 38, 52, .16);

  --ease: cubic-bezier(.2, .7, .2, 1);
  --t-fast: 140ms;
  --t-base: 220ms;

  --sidebar-w: 252px;
  --bottomnav-h: 68px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  color-scheme: light;
}

/* ---------- Tokens (tema escuro) ---------- */
[data-bs-theme="dark"] {
  --bg: #171214;
  --surface: #211A1D;
  --surface-2: #2A2125;
  --surface-3: #33292D;
  --ink: #F5ECEF;
  --ink-2: #D2C2C8;
  --muted: #A99AA0;
  --line: #352B2F;
  --line-strong: #463A3F;

  --brand: color-mix(in oklab, var(--accent) 58%, white);
  --brand-hover: color-mix(in oklab, var(--accent) 48%, white);
  --brand-ink: #24121A;
  --brand-soft: color-mix(in oklab, var(--accent) 24%, #211A1D);
  --brand-soft-2: color-mix(in oklab, var(--accent) 36%, #211A1D);
  --brand-text: color-mix(in oklab, var(--accent) 45%, white);

  --lilac: #9F8BC0;
  --lilac-soft: #2C2636;
  --lilac-ink: #CDBFE6;

  --success: #7CC3A2;  --success-soft: #1E2E27;
  --warning: #E3B060;  --warning-soft: #33291A;
  --danger:  #EE8E86;  --danger-soft:  #3A2020;
  --info:    #CDBFE6;  --info-soft:    #2C2636;

  --st-agendado: #B8A8AE;
  --st-confirmado: #B6A3DA;
  --st-concluido: #7CC3A2;
  --st-faltou: #E3B060;
  --st-cancelado: #EE8E86;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .25), 0 4px 14px rgba(0, 0, 0, .25);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, .3), 0 12px 32px rgba(0, 0, 0, .35);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .5);

  color-scheme: dark;
}

/* ---------- Ponte com as variáveis do Bootstrap ---------- */
:root, [data-bs-theme="dark"] {
  --bs-body-bg: var(--bg);
  --bs-body-color: var(--ink);
  --bs-body-font-family: var(--font-body);
  --bs-body-font-size: var(--fs-base);
  --bs-body-line-height: 1.55;
  --bs-secondary-color: var(--muted);
  --bs-tertiary-bg: var(--surface-2);
  --bs-secondary-bg: var(--surface-2);
  --bs-border-color: var(--line);
  --bs-border-radius: var(--r-sm);
  --bs-border-radius-sm: 8px;
  --bs-border-radius-lg: var(--r-md);
  --bs-border-radius-xl: var(--r-lg);
  --bs-link-color: var(--brand-text);
  --bs-link-color-rgb: 158, 63, 92;
  --bs-link-hover-color: var(--brand-hover);
  --bs-emphasis-color: var(--ink);
  --bs-heading-color: var(--ink);
  --bs-focus-ring-color: color-mix(in oklab, var(--brand) 30%, transparent);
  --bs-form-invalid-color: var(--danger);
  --bs-form-invalid-border-color: var(--danger);
  --bs-form-valid-border-color: var(--line-strong);
}

/* ---------- Base ---------- */
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  word-spacing: .045em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}
::selection { background: var(--brand-soft-2); color: var(--ink); }
a { color: var(--brand-text); text-decoration: none; }
a:hover { color: var(--brand-hover); }
.num, .tabular { font-variant-numeric: tabular-nums; }
.text-muted, .text-body-secondary { color: var(--muted) !important; }
.text-ink-2 { color: var(--ink-2) !important; }
.text-brand { color: var(--brand-text) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.fs-sm { font-size: var(--fs-sm); }
.fs-xs { font-size: var(--fs-xs); }
.fw-medium { font-weight: 500; }
.fw-semibold { font-weight: 600; }
h1, h2, h3, h4, h5, h6 { color: var(--ink); letter-spacing: -.01em; }
h2, .h2 { font-size: 1.15rem; font-weight: 600; }
h3, .h3 { font-size: 1rem; font-weight: 600; }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.btn:focus-visible, .form-control:focus-visible, .form-select:focus-visible { outline: none; }

/* título display (Cormorant): usado com parcimônia */
.display-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-display);
  line-height: 1.05;
  letter-spacing: -.01em;
  margin: 0;
}
.display-title em { font-style: italic; font-weight: 500; color: var(--brand-text); }
.eyebrow {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Assinatura: swatch em formato de ponta de unha ---------- */
.swatch {
  --sw: var(--brand);
  display: inline-block;
  flex: none;
  width: 12px;
  height: 16px;
  border-radius: 50% 50% 46% 46% / 62% 62% 38% 38%;
  background:
    radial-gradient(ellipse 35% 22% at 34% 26%, rgba(255, 255, 255, .55), transparent 70%),
    var(--sw);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .08), 0 0 0 1px rgba(0, 0, 0, .04);
  vertical-align: -2px;
}
.swatch-lg { width: 18px; height: 24px; }
.swatch-xl { width: 28px; height: 38px; }
.swatch-stack { display: inline-flex; gap: 3px; align-items: flex-end; }
.swatch-stack .swatch:nth-child(2) { height: 19px; }
.swatch-stack .swatch:nth-child(3) { height: 14px; }

/* ---------- Layout: sidebar (desktop) ---------- */
.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: var(--sp-6) var(--sp-4) var(--sp-4);
  z-index: 1030;
}
.brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 0 var(--sp-2) var(--sp-6);
  color: var(--ink);
}
.brand:hover { color: var(--ink); }
.brand-logo { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.brand-name {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: 1.45rem;
  line-height: 1.05;
}
.nav-group-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: var(--sp-4) var(--sp-3) var(--sp-2);
}
.side-nav { list-style: none; margin: 0; padding: 0; }
.side-link {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 9px var(--sp-3);
  border-radius: var(--r-sm);
  color: var(--ink-2);
  font-weight: 500;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.side-link i { font-size: 1.1rem; width: 20px; text-align: center; color: var(--muted); transition: color var(--t-fast); }
.side-link:hover { background: var(--surface-2); color: var(--ink); }
.side-link.active { background: var(--brand-soft); color: var(--brand-text); font-weight: 600; }
.side-link.active i { color: var(--brand-text); }
.side-link .count {
  margin-left: auto;
  min-width: 22px;
  padding: 1px 7px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  background: var(--brand);
  color: var(--brand-ink);
}
.side-link .count.warn { background: var(--warning-soft); color: var(--warning); }
.sidebar-footer { margin-top: auto; padding-top: var(--sp-4); border-top: 1px solid var(--line); }

.main {
  min-height: 100vh;
  padding: var(--sp-8) var(--sp-8) var(--sp-10);
}
@media (min-width: 992px) {
  .main { margin-left: var(--sidebar-w); }
}
.content { max-width: 1240px; margin: 0 auto; }
.content-narrow { max-width: 820px; margin: 0 auto; }

/* ---------- Cabeçalho de página ---------- */
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
  margin-bottom: var(--sp-6);
}
.page-header .crumb { font-size: var(--fs-sm); color: var(--muted); margin-bottom: var(--sp-1); }
.page-header .crumb a { color: var(--muted); }
.page-header .crumb a:hover { color: var(--brand-text); }
.page-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; }

/* ---------- Topbar e barra inferior (celular) ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 1020;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: 10px var(--sp-4);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar .brand { padding: 0; }
.topbar .brand-name { font-size: 1.25rem; }

.bottom-nav {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 1030;
  height: calc(var(--bottomnav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-top: 1px solid var(--line);
}
.bottom-link {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 48px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  background: none;
  border: 0;
}
.bottom-link i { font-size: 1.3rem; line-height: 1; }
.bottom-link.active { color: var(--brand-text); }
.bottom-link .dot {
  position: absolute;
  top: 6px;
  left: calc(50% + 8px);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 2px var(--surface);
}
.bottom-new {
  justify-self: center;
  width: 56px;
  height: 56px;
  margin-top: -22px;
  border-radius: 50%;
  border: 0;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: var(--brand-ink);
  font-size: 1.6rem;
  box-shadow: 0 8px 22px color-mix(in srgb, var(--brand) 40%, transparent), 0 0 0 5px var(--bg);
  transition: transform var(--t-fast) var(--ease);
}
.bottom-new:active { transform: scale(.94); }
@media (max-width: 991.98px) {
  .main { padding: var(--sp-5) var(--sp-4) calc(var(--bottomnav-h) + var(--safe-bottom) + var(--sp-8)); }
  .display-title { font-size: 1.85rem; }
  .page-header { margin-bottom: var(--sp-5); }
}

/* Menu "Mais" (offcanvas no celular) */
.more-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-3); }
.more-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-4) var(--sp-2);
  border-radius: var(--r-md);
  background: var(--surface-2);
  color: var(--ink);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-align: center;
}
.more-item i { font-size: 1.4rem; color: var(--brand-text); }
.more-item:hover { background: var(--brand-soft); color: var(--ink); }
.offcanvas { background: var(--surface); color: var(--ink); }
.offcanvas-bottom { height: auto; max-height: 85vh; border-radius: var(--r-xl) var(--r-xl) 0 0; border-top: 0 !important; }
.offcanvas-bottom .offcanvas-body { padding-bottom: calc(var(--sp-6) + var(--safe-bottom)); }
.sheet-handle { width: 40px; height: 4px; border-radius: 4px; background: var(--line-strong); margin: 10px auto 0; }

/* ---------- Cards ---------- */
.card, .panel {
  --bs-card-bg: var(--surface);
  --bs-card-border-color: var(--line);
  --bs-card-border-radius: var(--r-lg);
  --bs-card-inner-border-radius: calc(var(--r-lg) - 1px);
  --bs-card-cap-bg: transparent;
  --bs-card-spacer-x: var(--sp-5);
  --bs-card-spacer-y: var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
}
.panel { padding: var(--sp-5); }
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
.panel-header h2, .panel-header h3 { margin: 0; }
.panel-tint { background: var(--surface-2); border-color: transparent; box-shadow: none; }
.panel-brand { background: var(--brand-soft); border-color: transparent; box-shadow: none; }
.panel-flush { padding: 0; overflow: hidden; }
.panel + .panel { margin-top: var(--sp-4); }

.stat {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  padding: var(--sp-5);
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
  height: 100%;
}
.stat-label { font-size: var(--fs-sm); color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: var(--sp-2); }
.stat-value {
  font-family: var(--font-display);
  font-size: var(--fs-number);
  font-weight: 600;
  line-height: 1.1;
  font-variant-numeric: lining-nums tabular-nums;
}
.stat-sub { font-size: var(--fs-xs); color: var(--muted); }

/* ---------- Botões ---------- */
.btn {
  --bs-btn-padding-x: 1rem;
  --bs-btn-padding-y: .55rem;
  --bs-btn-font-weight: 600;
  --bs-btn-font-size: var(--fs-base);
  --bs-btn-border-radius: var(--r-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), box-shadow var(--t-fast);
  min-height: 42px;
}
.btn:active { transform: scale(.98); }
.btn-sm { --bs-btn-padding-x: .75rem; --bs-btn-padding-y: .35rem; --bs-btn-font-size: var(--fs-sm); min-height: 34px; }
.btn-lg { --bs-btn-padding-x: 1.4rem; --bs-btn-padding-y: .75rem; min-height: 50px; }
.btn-primary {
  --bs-btn-bg: var(--brand);
  --bs-btn-border-color: var(--brand);
  --bs-btn-color: var(--brand-ink);
  --bs-btn-hover-bg: var(--brand-hover);
  --bs-btn-hover-border-color: var(--brand-hover);
  --bs-btn-hover-color: var(--brand-ink);
  --bs-btn-active-bg: var(--brand-hover);
  --bs-btn-active-border-color: var(--brand-hover);
  --bs-btn-active-color: var(--brand-ink);
  --bs-btn-disabled-bg: var(--brand);
  --bs-btn-disabled-border-color: var(--brand);
  --bs-btn-disabled-color: var(--brand-ink);
  --bs-btn-focus-shadow-rgb: 158, 63, 92;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--brand) 22%, transparent);
}
.btn-soft {
  --bs-btn-bg: var(--brand-soft);
  --bs-btn-border-color: transparent;
  --bs-btn-color: var(--brand-text);
  --bs-btn-hover-bg: var(--brand-soft-2);
  --bs-btn-hover-border-color: transparent;
  --bs-btn-hover-color: var(--brand-text);
  --bs-btn-active-bg: var(--brand-soft-2);
  --bs-btn-active-color: var(--brand-text);
  --bs-btn-active-border-color: transparent;
}
.btn-light, .btn-outline {
  --bs-btn-bg: var(--surface);
  --bs-btn-border-color: var(--line-strong);
  --bs-btn-color: var(--ink);
  --bs-btn-hover-bg: var(--surface-2);
  --bs-btn-hover-border-color: var(--line-strong);
  --bs-btn-hover-color: var(--ink);
  --bs-btn-active-bg: var(--surface-3);
  --bs-btn-active-color: var(--ink);
  --bs-btn-active-border-color: var(--line-strong);
}
.btn-ghost {
  --bs-btn-bg: transparent;
  --bs-btn-border-color: transparent;
  --bs-btn-color: var(--ink-2);
  --bs-btn-hover-bg: var(--surface-2);
  --bs-btn-hover-border-color: transparent;
  --bs-btn-hover-color: var(--ink);
  --bs-btn-active-bg: var(--surface-3);
  --bs-btn-active-border-color: transparent;
}
.btn-danger-soft {
  --bs-btn-bg: var(--danger-soft);
  --bs-btn-border-color: transparent;
  --bs-btn-color: var(--danger);
  --bs-btn-hover-bg: var(--danger);
  --bs-btn-hover-border-color: var(--danger);
  --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: var(--danger);
  --bs-btn-active-color: #fff;
}
.btn-whatsapp {
  --bs-btn-bg: #1F8F55;
  --bs-btn-border-color: #1F8F55;
  --bs-btn-color: #fff;
  --bs-btn-hover-bg: #187646;
  --bs-btn-hover-border-color: #187646;
  --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: #187646;
  --bs-btn-active-color: #fff;
}
.btn-icon { width: 42px; padding: 0; }
.btn-sm.btn-icon { width: 34px; }

/* ---------- Formulários ---------- */
.form-label { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.form-text { color: var(--muted); font-size: var(--fs-xs); }
.form-control, .form-select {
  background-color: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  color: var(--ink);
  padding: .6rem .85rem;
  min-height: 44px;
  font-size: var(--fs-base);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
/* Reserva o espaço da setinha: sem isto o texto ("Todos os tipos") passa por baixo dela */
.form-select { padding-right: 2.4rem; background-position: right .8rem center; }
.form-control::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
.form-control:focus, .form-select:focus {
  background-color: var(--surface);
  color: var(--ink);
  border-color: var(--brand);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent);
}
.form-control:disabled, .form-select:disabled { background: var(--surface-2); }
.form-control-color { min-height: 44px; width: 56px; padding: 4px; }
textarea.form-control { min-height: 88px; }
.input-group-text { background: var(--surface-2); border-color: var(--line-strong); color: var(--muted); border-radius: var(--r-sm); }
.form-check-input { border-color: var(--line-strong); background-color: var(--surface); width: 1.15em; height: 1.15em; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent); }
.form-switch { padding-left: 3.1em; }
.form-switch .form-check-input { width: 2.4em; height: 1.3em; margin-left: -3.1em; margin-top: .1em; }
.form-switch .form-check-input:focus { --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23c9a3af'/%3e%3c/svg%3e"); }
.invalid-feedback { font-size: var(--fs-xs); font-weight: 500; }
.form-section-title { font-size: var(--fs-sm); font-weight: 700; color: var(--ink); margin: var(--sp-2) 0 var(--sp-3); }
@media (max-width: 767.98px) {
  /* 16px evita o zoom automático do iOS ao focar */
  .form-control, .form-select { font-size: 16px; }
}

/* chips de seleção (checkbox/radio com cara de pílula) */
.chip-check { display: inline-flex; }
.chip-check input { position: absolute; opacity: 0; pointer-events: none; }
.chip-check label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  min-height: 38px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-2);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: all var(--t-fast) var(--ease);
}
.chip-check label:hover { border-color: var(--brand); }
.chip-check input:checked + label { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-text); }
.chip-check input:focus-visible + label { outline: 2px solid var(--brand); outline-offset: 2px; }
.chip-check.danger input:checked + label { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); }

/* ---------- Badges ---------- */
.badge-soft {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
  background: var(--surface-2);
  color: var(--ink-2);
}
.badge-soft.brand { background: var(--brand-soft); color: var(--brand-text); }
.badge-soft.success { background: var(--success-soft); color: var(--success); }
.badge-soft.warning { background: var(--warning-soft); color: var(--warning); }
.badge-soft.danger { background: var(--danger-soft); color: var(--danger); }
.badge-soft.info, .badge-soft.lilac { background: var(--lilac-soft); color: var(--lilac-ink); }

.status { --st: var(--st-agendado); display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; color: var(--st); background: color-mix(in srgb, var(--st) 12%, transparent); }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--st); }
.status-agendado { --st: var(--st-agendado); }
.status-confirmado { --st: var(--st-confirmado); }
.status-concluido { --st: var(--st-concluido); }
.status-faltou { --st: var(--st-faltou); }
.status-cancelado { --st: var(--st-cancelado); }

/* alerta de saúde (alergia/restrição) */
.health-alert {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: var(--fs-sm);
  font-weight: 500;
}
.health-alert i { font-size: 1.1rem; line-height: 1.3; }
.health-alert strong { font-weight: 700; }
.health-pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--r-pill); background: var(--danger-soft); color: var(--danger); font-size: 11px; font-weight: 700; }

/* ---------- Listas ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-5);
  border-top: 1px solid var(--line);
  color: var(--ink);
  min-height: 60px;
}
.list-row:first-child { border-top: 0; }
a.list-row:hover, .list-row.hoverable:hover { background: var(--surface-2); color: var(--ink); }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row .meta { font-size: var(--fs-sm); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panel:not(.panel-flush) > .list .list-row { padding-left: 0; padding-right: 0; }

.avatar {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--lilac-soft);
  color: var(--lilac-ink);
  font-weight: 700;
  font-size: var(--fs-sm);
  letter-spacing: .02em;
}
.avatar-lg { width: 64px; height: 64px; font-size: 1.25rem; }
.avatar-brand { background: var(--brand-soft); color: var(--brand-text); }

/* ---------- Tabelas ---------- */
.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--ink);
  --bs-table-border-color: var(--line);
  --bs-table-hover-bg: var(--surface-2);
  --bs-table-hover-color: var(--ink);
  --bs-table-striped-bg: var(--surface-2);
  margin: 0;
  font-size: var(--fs-base);
}
.table > thead th {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom-width: 1px;
  padding-top: var(--sp-3);
  padding-bottom: var(--sp-3);
  white-space: nowrap;
}
.table > :not(caption) > * > * { padding: .8rem 1rem; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .actions { text-align: right; white-space: nowrap; }

/* ---------- Estado vazio ---------- */
.empty {
  text-align: center;
  padding: var(--sp-10) var(--sp-6);
  color: var(--muted);
}
.empty .empty-mark {
  display: inline-flex;
  gap: 6px;
  align-items: flex-end;
  margin-bottom: var(--sp-4);
}
.empty .empty-mark .swatch { width: 16px; height: 22px; opacity: .9; }
.empty .empty-mark .swatch:nth-child(1) { --sw: var(--brand-soft-2); height: 18px; }
.empty .empty-mark .swatch:nth-child(2) { --sw: var(--brand); }
.empty .empty-mark .swatch:nth-child(3) { --sw: var(--lilac); height: 19px; }
.empty h3 { font-size: var(--fs-md); color: var(--ink); margin-bottom: var(--sp-1); }
.empty p { max-width: 360px; margin: 0 auto var(--sp-4); font-size: var(--fs-sm); }

/* ---------- Modais ---------- */
.modal {
  --bs-modal-bg: var(--surface);
  --bs-modal-color: var(--ink);
  --bs-modal-border-color: transparent;
  --bs-modal-border-radius: var(--r-xl);
  --bs-modal-inner-border-radius: var(--r-xl);
  --bs-modal-box-shadow: var(--shadow-lg);
  --bs-modal-header-border-color: var(--line);
  --bs-modal-footer-border-color: var(--line);
  --bs-modal-padding: var(--sp-6);
  --bs-modal-header-padding: var(--sp-5) var(--sp-6);
}
.modal-backdrop { --bs-backdrop-bg: #2A1820; --bs-backdrop-opacity: .38; }
.modal-title { font-weight: 700; font-size: var(--fs-md); }
.modal-footer { gap: var(--sp-2); }
@media (max-width: 575.98px) {
  /* no celular os modais viram "folhas" que sobem de baixo */
  .modal-dialog.sheet { margin: 0; position: fixed; bottom: 0; left: 0; right: 0; max-width: none; height: auto !important; max-height: 94vh; display: flex; align-items: flex-end; }
  .modal-dialog.sheet .modal-content { border-radius: var(--r-xl) var(--r-xl) 0 0; max-height: 94vh; width: 100%; }
  .modal-dialog.sheet .modal-body { overflow-y: auto; }
  .modal.fade .modal-dialog.sheet { transform: translateY(40px); }
  .modal.show .modal-dialog.sheet { transform: none; }
  .modal-dialog.sheet .modal-footer { padding-bottom: calc(var(--sp-4) + var(--safe-bottom)); }
}

/* ---------- Toasts ---------- */
.toast-stack {
  position: fixed;
  z-index: 1090;
  top: var(--sp-4);
  right: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  pointer-events: none;
}
@media (max-width: 991.98px) {
  .toast-stack { top: auto; right: var(--sp-3); left: var(--sp-3); bottom: calc(var(--bottomnav-h) + var(--safe-bottom) + var(--sp-3)); }
}
.toast-item {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  min-width: 280px;
  max-width: 420px;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  background: var(--ink);
  color: var(--bg);
  box-shadow: var(--shadow-md);
  font-size: var(--fs-sm);
  font-weight: 500;
  animation: toast-in var(--t-base) var(--ease);
}
[data-bs-theme="dark"] .toast-item { background: var(--surface-3); color: var(--ink); }
.toast-item i { font-size: 1.1rem; line-height: 1.25; }
.toast-item.success i { color: #8FD3B1; }
.toast-item.error i, .toast-item.danger i { color: #F4A39B; }
.toast-item.warning i, .toast-item.notice i { color: #F0C27A; }
.toast-item .toast-close { margin-left: auto; background: none; border: 0; color: inherit; opacity: .6; padding: 0 0 0 var(--sp-2); }
.toast-item.leaving { animation: toast-out 180ms var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }

/* ---------- Filtros/segmentos ---------- */
.segmented {
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  display: inline-flex;
  padding: 4px;
  gap: 2px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
}
.segmented a, .segmented button {
  border: 0;
  background: none;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
}
.segmented .active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-xs); }

.search-box { position: relative; }
.search-box i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-box .form-control { padding-left: 40px; border-radius: var(--r-pill); }

/* ---------- Dropdown, paginação, abas ---------- */
.dropdown-menu {
  --bs-dropdown-bg: var(--surface);
  --bs-dropdown-border-color: var(--line);
  --bs-dropdown-border-radius: var(--r-md);
  --bs-dropdown-link-color: var(--ink);
  --bs-dropdown-link-hover-bg: var(--surface-2);
  --bs-dropdown-link-hover-color: var(--ink);
  --bs-dropdown-link-active-bg: var(--brand-soft);
  --bs-dropdown-link-active-color: var(--brand-text);
  --bs-dropdown-item-padding-y: .5rem;
  box-shadow: var(--shadow-md);
  padding: 6px;
}
.dropdown-item { border-radius: 8px; display: flex; align-items: center; gap: 10px; }
.pagination {
  --bs-pagination-bg: var(--surface);
  --bs-pagination-color: var(--ink-2);
  --bs-pagination-border-color: var(--line);
  --bs-pagination-hover-bg: var(--surface-2);
  --bs-pagination-hover-color: var(--ink);
  --bs-pagination-hover-border-color: var(--line);
  --bs-pagination-active-bg: var(--brand);
  --bs-pagination-active-border-color: var(--brand);
  --bs-pagination-active-color: var(--brand-ink);
  --bs-pagination-disabled-bg: var(--surface);
  --bs-pagination-disabled-color: var(--muted);
  --bs-pagination-disabled-border-color: var(--line);
  --bs-pagination-focus-box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent);
}
.tabs {
  display: flex;
  gap: var(--sp-1);
  border-bottom: 1px solid var(--line);
  margin-bottom: var(--sp-5);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a, .tabs button {
  border: 0;
  background: none;
  padding: 10px 14px;
  font-weight: 600;
  font-size: var(--fs-sm);
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}
.tabs a:hover, .tabs button:hover { color: var(--ink); }
.tabs .active { color: var(--brand-text); border-bottom-color: var(--brand); }

/* ---------- Alertas do Bootstrap ---------- */
.alert { border: 0; border-radius: var(--r-md); font-size: var(--fs-sm); }
.alert-warning { background: var(--warning-soft); color: var(--warning); }
.alert-danger { background: var(--danger-soft); color: var(--danger); }
.alert-success { background: var(--success-soft); color: var(--success); }
.alert-info { background: var(--info-soft); color: var(--info); }

/* ---------- Galeria ---------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--sp-3); }
.gallery-item { position: relative; border-radius: var(--r-md); overflow: hidden; aspect-ratio: 1; background: var(--surface-2); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--t-base) var(--ease); }
.gallery-item:hover img { transform: scale(1.03); }
.gallery-item .tag { position: absolute; left: 8px; top: 8px; }

/* ---------- Linha do tempo (agendamentos do dia) ---------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline-item { display: grid; grid-template-columns: 56px 1fr; gap: var(--sp-3); position: relative; padding-bottom: var(--sp-4); }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-time { font-weight: 700; font-size: var(--fs-sm); padding-top: 12px; text-align: right; font-variant-numeric: tabular-nums; }
.timeline-card {
  position: relative;
  padding: var(--sp-3) var(--sp-4) var(--sp-3) calc(var(--sp-4) + 6px);
  border-radius: var(--r-md);
  background: var(--surface-2);
  color: var(--ink);
  overflow: hidden;
}
.timeline-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--sw, var(--brand)); }
a.timeline-card:hover { background: var(--surface-3); color: var(--ink); }
.timeline-item.is-past .timeline-card { opacity: .62; }
.timeline-item.is-now .timeline-card { background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand-soft-2); }

/* ---------- Utilidades ---------- */
.gap-2 { gap: var(--sp-2) !important; }
.divider { height: 1px; background: var(--line); margin: var(--sp-5) 0; }
.kbd-hint { font-size: var(--fs-xs); color: var(--muted); }
.money-pos { color: var(--success); }
.money-neg { color: var(--danger); }
.clickable { cursor: pointer; }
.sticky-actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  padding: var(--sp-4) 0;
  background: linear-gradient(to top, var(--bg) 70%, transparent);
}
@media (max-width: 991.98px) {
  .sticky-actions { bottom: calc(var(--bottomnav-h) + var(--safe-bottom)); }
}
.color-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; background: var(--sw, var(--brand)); flex: none; }
.w-fit { width: fit-content; }

/* ---------- Página de erro ---------- */
.error-page { min-height: 60vh; display: grid; place-items: center; text-align: center; }
.error-page .code { font-family: var(--font-display); font-style: italic; font-size: 5rem; line-height: 1; color: var(--brand-text); }

/* ---------- Movimento reduzido ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Impressão ---------- */
@media print {
  .sidebar, .topbar, .bottom-nav, .page-actions, .toast-stack { display: none !important; }
  .main { margin: 0 !important; padding: 0 !important; }
}

/* ---------- Prévia de mensagem (balão do WhatsApp) ---------- */
.wa-preview {
  position: relative;
  padding: var(--sp-3) var(--sp-4);
  border-radius: 4px var(--r-md) var(--r-md) var(--r-md);
  background: #E3F4D9;
  color: #1F2A1C;
  font-size: var(--fs-sm);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: var(--shadow-xs);
  min-height: 60px;
}
[data-bs-theme="dark"] .wa-preview { background: #1F3A2E; color: #E3F1E8; }

/* ---------- Seletor de fotos ---------- */
.photo-picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: var(--sp-2); }
.photo-add, .photo-tile { aspect-ratio: 1; border-radius: var(--r-md); }
.photo-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1.5px dashed var(--line-strong);
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--t-fast), color var(--t-fast), background var(--t-fast);
}
.photo-add i { font-size: 1.4rem; }
.photo-add:hover { border-color: var(--brand); color: var(--brand-text); background: var(--brand-soft); }
input[data-photo-input]:focus-visible + * , .photo-picker:focus-within .photo-add { outline: 2px solid var(--brand); outline-offset: 2px; }
.photo-tile { position: relative; overflow: hidden; background: var(--surface-2); }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; }
.photo-remove {
  position: absolute; top: 4px; right: 4px;
  width: 28px; height: 28px; border-radius: 50%; border: 0;
  display: grid; place-items: center;
  background: rgba(30, 18, 24, .7); color: #fff; font-size: 1.1rem;
}

/* ---------- Linha do tempo de unhas ---------- */
.nail-timeline { list-style: none; margin: 0; padding: 0; }
.nail-entry { display: grid; grid-template-columns: 64px 1fr; gap: var(--sp-4); margin-bottom: var(--sp-4); }
.nail-date { text-align: center; padding-top: var(--sp-4); }
.nail-date .d { display: block; font-family: var(--font-display); font-size: 2rem; font-weight: 600; line-height: 1; }
.nail-date .m { display: block; font-size: var(--fs-xs); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.nail-card { margin: 0 !important; }
.nail-thumb { position: relative; padding: 0; border: 0; border-radius: var(--r-sm); overflow: hidden; width: 72px; height: 72px; background: var(--surface-2); }
.nail-thumb img { width: 100%; height: 100%; object-fit: cover; }
.nail-thumb .tag { position: absolute; left: 0; right: 0; bottom: 0; font-size: 10px; font-weight: 700; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.55)); padding: 8px 0 3px; }
@media (max-width: 575.98px) {
  .nail-entry { grid-template-columns: 1fr; gap: var(--sp-2); }
  .nail-date { text-align: left; padding-top: 0; display: flex; gap: 8px; align-items: baseline; }
  .nail-date .d { font-size: 1.4rem; }
}

/* ---------- Lightbox ---------- */
.lightbox-stage { position: relative; display: grid; place-items: center; background: var(--surface-2); border-radius: var(--r-md); min-height: 240px; overflow: hidden; }
.lightbox-stage img { max-width: 100%; max-height: 70vh; object-fit: contain; display: block; }
.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%; border: 0;
  background: color-mix(in srgb, var(--surface) 85%, transparent); color: var(--ink);
  box-shadow: var(--shadow-sm); font-size: 1.2rem;
}
.lb-nav.prev { left: 10px; }
.lb-nav.next { right: 10px; }
.gallery-item .tag { position: absolute; left: 8px; top: 8px; }

/* ==========================================================================
   Agenda (FullCalendar)
   ========================================================================== */
.cal-toolbar { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; margin-bottom: var(--sp-3); }
.cal-panel { padding: var(--sp-2); overflow: hidden; }
#calendar {
  --fc-border-color: var(--line);
  --fc-page-bg-color: var(--surface);
  --fc-neutral-bg-color: var(--surface-2);
  --fc-non-business-color: color-mix(in srgb, var(--surface-2) 75%, transparent);
  --fc-today-bg-color: color-mix(in srgb, var(--brand) 5%, transparent);
  --fc-now-indicator-color: var(--brand);
  --fc-highlight-color: color-mix(in srgb, var(--brand) 14%, transparent);
  --fc-event-border-color: transparent;
  --fc-list-event-hover-bg-color: var(--surface-2);
  --fc-small-font-size: var(--fs-xs);
  font-size: var(--fs-sm);
}
#calendar .fc-scrollgrid { border: 0; }
#calendar .fc-col-header-cell { padding: 8px 0; font-weight: 600; color: var(--ink-2); text-transform: capitalize; }
#calendar .fc-col-header-cell a { color: inherit; }
#calendar .fc-day-today .fc-col-header-cell-cushion { color: var(--brand-text); }
#calendar .fc-timegrid-slot { height: 1.9rem; }
#calendar .fc-timegrid-slot-label { color: var(--muted); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; vertical-align: top; }
#calendar .fc-timegrid-slot-minor { border-top-style: dotted; border-top-color: color-mix(in srgb, var(--line) 60%, transparent); }
#calendar .fc-daygrid-day-number { color: var(--ink-2); font-weight: 600; padding: 6px 8px; }
#calendar .fc-day-other .fc-daygrid-day-number { opacity: .45; }
#calendar .fc-timegrid-now-indicator-line { border-width: 2px 0 0; }
#calendar .fc-timegrid-now-indicator-arrow { border-color: var(--brand); border-bottom-color: transparent; border-top-color: transparent; }

/* evento de agendamento: fundo suave na cor do serviço + faixa lateral */
#calendar .fc-event.ev-appt {
  --sw: var(--brand);
  background: color-mix(in srgb, var(--sw) 16%, var(--surface));
  border: 0;
  border-left: 3px solid var(--sw);
  border-radius: 8px;
  color: var(--ink);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  overflow: hidden;
}
#calendar .fc-timegrid-event.ev-appt { margin: 0 2px 1px 1px; }
#calendar .fc-event.ev-appt:hover { background: color-mix(in srgb, var(--sw) 24%, var(--surface)); }
#calendar .fc-event.ev-appt .fc-event-main { color: var(--ink); padding: 0; }
#calendar .ev-inner { padding: 3px 6px; line-height: 1.25; overflow: hidden; height: 100%; }
#calendar .ev-time { font-size: 11px; font-weight: 600; color: var(--ink-2); display: flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
#calendar .ev-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#calendar .ev-sub { font-size: 11px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#calendar .ev-alert { color: var(--danger); font-size: 11px; }
#calendar .ev-status { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-left: auto; }
#calendar .ev-st-confirmado { background: var(--st-confirmado); }
#calendar .ev-st-concluido { background: var(--st-concluido); }
#calendar .ev-st-faltou { background: var(--st-faltou); }
#calendar .ev-st-cancelado { background: var(--st-cancelado); }
#calendar .fc-event.ev-concluido { opacity: .7; }
#calendar .fc-event.ev-faltou, #calendar .fc-event.ev-cancelado { opacity: .55; background-image: repeating-linear-gradient(-45deg, transparent 0 6px, color-mix(in srgb, var(--ink) 6%, transparent) 6px 12px); }
#calendar .fc-event.ev-cancelado .ev-title { text-decoration: line-through; }
#calendar .fc-event-mirror.ev-appt, #calendar .fc-event.fc-event-dragging { box-shadow: var(--shadow-md); }

/* bloqueios: listrado neutro */
#calendar .fc-event.ev-block {
  background: repeating-linear-gradient(-45deg, var(--surface-2) 0 8px, var(--surface-3) 8px 16px);
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
}
#calendar .fc-event.ev-block .fc-event-main { color: var(--muted); }
#calendar .fc-event.ev-block .ev-title { font-weight: 600; font-size: 11px; white-space: normal; }

/* mês */
#calendar .fc-daygrid-event.ev-appt { border-left-width: 0; background: transparent; box-shadow: none; padding: 1px 2px; }
#calendar .fc-daygrid-event.ev-appt:hover { background: var(--surface-2); }
#calendar .ev-month { display: flex; align-items: center; gap: 4px; padding: 0 2px; white-space: nowrap; overflow: hidden; }
#calendar .ev-month .swatch { width: 8px; height: 11px; }
#calendar .ev-month .ev-title { font-weight: 600; }
#calendar .fc-daygrid-more-link { color: var(--brand-text); font-weight: 600; }
#calendar .fc-popover { background: var(--surface); border-color: var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-md); }
#calendar .fc-popover-header { background: var(--surface-2); border-radius: var(--r-md) var(--r-md) 0 0; }

/* lista */
#calendar .fc-list { border: 0; }
#calendar .fc-list-day-cushion { background: var(--surface-2); font-weight: 700; text-transform: capitalize; }
#calendar .fc-list-event td { border-color: var(--line); }
#calendar .fc-list-event-dot { border-color: var(--sw, var(--brand)); }
#calendar .ev-list { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
#calendar .ev-list-total { margin-left: auto; font-weight: 600; }
#calendar .fc-list-empty { background: transparent; color: var(--muted); }

/* ---------- Modal de agendamento ---------- */
.appt-section { padding: var(--sp-4) 0; border-top: 1px solid var(--line); }
.appt-section:first-child { border-top: 0; padding-top: 0; }
.appt-section.has-error .appt-step span { background: var(--danger); color: #fff; }
.appt-step { display: flex; align-items: center; gap: 10px; font-weight: 700; margin-bottom: var(--sp-3); color: var(--ink); }
.appt-step span { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-text); font-size: var(--fs-xs); flex: none; }
.picked-client { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3); border-radius: var(--r-md); background: var(--surface-2); }
.client-results { max-height: 260px; overflow-y: auto; }
.client-results .list-row { min-height: 52px; padding-left: var(--sp-2); padding-right: var(--sp-2); border-radius: var(--r-sm); }
.quick-client { margin-top: var(--sp-3); padding: var(--sp-3); border-radius: var(--r-md); background: var(--surface-2); }
.svc-group + .svc-group { margin-top: var(--sp-3); }
.svc-group-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.svc-meta { font-weight: 500; color: var(--muted); font-size: 11px; margin-left: 2px; }
.chip-check input:checked + label .svc-meta { color: var(--brand-text); opacity: .8; }
.selected-items:empty { display: none; }
.selected-items .list-row { min-height: 52px; }
.slot-chip {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--r-pill);
  padding: 7px 12px;
  font-size: var(--fs-sm);
  font-weight: 600;
  min-height: 38px;
  font-variant-numeric: tabular-nums;
  transition: all var(--t-fast) var(--ease);
}
.slot-chip:hover { border-color: var(--brand); }
.slot-chip.active { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.slot-status { font-size: var(--fs-sm); font-weight: 600; min-height: 1.2em; }
.appt-summary { line-height: 1.2; }
.appt-summary [data-sum-total] { font-size: 1.15rem; }
@media (max-width: 575.98px) {
  #apptModal .modal-body { padding: var(--sp-4); }
  .cal-toolbar .segmented { order: 3; width: 100%; justify-content: space-between; }
  .cal-toolbar .segmented button { flex: 1; }
}

/* ---------- Financeiro ---------- */
.month-nav { display: flex; align-items: center; gap: var(--sp-2); }
.month-label { font-weight: 700; min-width: 150px; text-align: center; }
.stat-hero { background: var(--brand-soft); border-color: transparent; box-shadow: none; }
.stat-hero .stat-value { font-size: 2.6rem; color: var(--brand-text); }
.stat-hero.is-negative { background: var(--danger-soft); }
.stat-hero.is-negative .stat-value { color: var(--danger); }
.bar-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--sp-4); }
.bar { height: 8px; border-radius: 8px; background: var(--surface-2); margin-top: 6px; overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: 8px; background: var(--bar, var(--brand)); }

/* ---------- Fechamento ---------- */
.close-totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-2); }
.close-totals > div { display: flex; flex-direction: column; padding: var(--sp-3); border-radius: var(--r-md); background: var(--surface-2); }
.close-totals strong { font-size: 1.05rem; }
.close-totals .is-main { background: var(--brand-soft); }
.close-totals .is-main strong { font-family: var(--font-display); font-size: 1.6rem; color: var(--brand-text); line-height: 1.1; }
.pay-line { display: grid; grid-template-columns: 1fr 140px auto; gap: var(--sp-2); align-items: center; margin-bottom: var(--sp-2); }
.pay-line .pay-net { grid-column: 1 / -1; font-size: var(--fs-xs); color: var(--muted); margin-top: -4px; }
@media (max-width: 575.98px) { .pay-line { grid-template-columns: 1fr 120px auto; } }
.stat-value { white-space: nowrap; }
.stat-hero { justify-content: center; }
@media (max-width: 575.98px) { .stat-value { font-size: 1.55rem; } .stat-hero .stat-value { font-size: 2.2rem; } }
.panel-header .btn { white-space: nowrap; }

/* ---------- Estoque ---------- */
.low-banner { display: flex; gap: var(--sp-3); align-items: center; flex-wrap: wrap; padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md); background: var(--warning-soft); color: var(--warning); font-size: var(--fs-sm); }
.low-banner i { font-size: 1.2rem; }
.low-banner strong { font-weight: 700; }
.stock-qty { width: 90px; }
.stock-qty .bar { margin-top: 0; }
.stat-warn { background: var(--warning-soft); border-color: transparent; }
.stat-warn .stat-value { color: var(--warning); }

/* ---------- Lembretes ---------- */
.reminder-list > li + li { border-top: 1px solid var(--line); }
.reminder-row { display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-4) 0; }
.reminder-time { display: flex; flex-direction: column; align-items: center; min-width: 52px; padding-top: 2px; }
.reminder-time strong { font-size: 1.1rem; line-height: 1.1; }
.reminder-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.reminder-actions .sent-info:empty { display: none; }
.reminder-row.is-sent .reminder-time strong { color: var(--muted); }
.reminder-preview summary { cursor: pointer; color: var(--brand-text); font-weight: 600; margin-top: 4px; list-style: none; }
.reminder-preview summary::-webkit-details-marker { display: none; }
.reminder-preview summary::before { content: "▸ "; }
.reminder-preview[open] summary::before { content: "▾ "; }
@media (max-width: 575.98px) {
  .reminder-row { flex-wrap: wrap; }
  .reminder-actions { width: 100%; flex-direction: row-reverse; justify-content: space-between; align-items: center; padding-left: calc(52px + var(--sp-3)); }
}
.reminder-row > .grow { flex: 1; min-width: 0; }
.reminder-actions .btn { white-space: nowrap; }
@media (max-width: 575.98px) { .reminder-actions { flex-wrap: wrap; gap: 8px; } .reminder-actions .sent-info { width: 100%; text-align: right; } }

/* ---------- Relatórios ---------- */
:root { --chart-1: var(--accent); }
[data-bs-theme="dark"] { --chart-1: color-mix(in oklab, var(--accent) 72%, white); }
.report-filters { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.chart-box { position: relative; height: 280px; }
@media (max-width: 575.98px) { .chart-box { height: 220px; } }
.delta { display: inline-flex; align-items: center; font-weight: 700; font-size: var(--fs-xs); }
.delta.up { color: var(--success); }
.delta.down { color: var(--danger); }
.kpi-list { list-style: none; margin: 0; padding: 0; }
.kpi-list li { display: flex; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--line); font-size: var(--fs-sm); }
.kpi-list li:first-child { border-top: 0; }
.rank-pos { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-weight: 700; font-size: var(--fs-xs); flex: none; }
.rank-list li:nth-child(-n+3) .rank-pos { background: var(--brand-soft); color: var(--brand-text); }

/* ---------- Dashboard ---------- */
.next-client .next-name { font-family: var(--font-display); font-size: 1.7rem; font-weight: 600; line-height: 1.1; display: block; }
.next-client .avatar { background: var(--surface); color: var(--brand-text); }
.next-facts { display: flex; flex-wrap: wrap; gap: var(--sp-3) var(--sp-6); margin: var(--sp-3) 0 0; }
.next-facts dt { font-size: var(--fs-xs); font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.next-facts dd { margin: 2px 0 0; font-size: var(--fs-sm); font-weight: 500; }
.stat-link { transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast); }
.stat-link:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); color: inherit; }
.bday-today { background: var(--brand) !important; color: var(--brand-ink) !important; }

/* Cabeçalhos de card com controles: quebram linha em vez de vazar do card */
.panel-header { flex-wrap: wrap; }
@media (max-width: 575.98px) {
  .panel-header > .segmented { width: 100%; }
  .panel-header > .segmented > * { flex: 1; text-align: center; }
}

/* ---------- Tela de entrada ---------- */
.login-body { background:
    radial-gradient(1200px 600px at 10% -10%, var(--brand-soft) 0%, transparent 60%),
    radial-gradient(900px 500px at 110% 110%, var(--lilac-soft) 0%, transparent 60%),
    var(--bg); }
.login-wrap { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: var(--sp-6) var(--sp-4); }
.login-card { width: 100%; max-width: 400px; padding: var(--sp-8) var(--sp-6); border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-md); }
.login-card .swatch-stack { gap: 6px; }
/* Termos de uso e Política de privacidade: mesma moldura da entrada, mais larga para leitura */
.legal-card { max-width: 760px; }
.legal-text { font-size: .95rem; line-height: 1.65; color: var(--ink-2); }
.legal-text h2 { font-family: var(--font-display); font-size: 1.35rem; margin: var(--sp-6) 0 var(--sp-2); color: var(--ink); }
.legal-text ul { padding-left: 1.2rem; }
.legal-text li { margin-bottom: .35rem; }
.legal-meta { font-size: .8rem; color: var(--muted); }

/* ---------- Primeiros passos (início) ---------- */
.onboarding-progress { height: 6px; border-radius: 999px; background: var(--surface-2, var(--line)); overflow: hidden; margin-bottom: var(--sp-3); }
.onboarding-progress span { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width .3s ease; }
.onboarding-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
@media (min-width: 992px) { .onboarding-steps { grid-template-columns: 1fr 1fr; column-gap: var(--sp-4); } }
.onboarding-steps a { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2) var(--sp-1); min-height: 44px; border-radius: var(--r-md); color: inherit; text-decoration: none; }
.onboarding-steps a:hover { background: var(--brand-soft); }
.onboarding-steps .bi-circle { color: var(--muted); font-size: 1.15rem; }
.onboarding-steps .bi-check-circle-fill { color: var(--accent); font-size: 1.15rem; }
.onboarding-steps li.done strong { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in oklab, var(--muted) 60%, transparent); }

/* ---------- Convite para instalar o app ---------- */
.install-icon { width: 48px; height: 48px; border-radius: 12px; flex-shrink: 0; }

/* Página da cliente: ao trocar de aba, a página recarrega já posicionada nas abas
   (#abas); o recuo evita que a barra do topo cubra as abas */
#abas, #nailForm { scroll-margin-top: 72px; }
/* Taxas: exemplo do líquido alinhado ao nome (depois do botão liga/desliga) */
.fee-example { padding-left: 3.1em; margin-top: 2px; }
/* Nomes compostos (ex.: "Alongamento em fibra"): quebram em até 2 linhas em vez de cortar */
.list-row .title.title-wrap { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3; }
.list-row .meta.meta-wrap { white-space: normal; line-height: 1.4; }
.list-row > a.grow { min-width: 0; }

/* ---------- Preço e lucro (Serviços) ---------- */
.price-list { display: grid; gap: 0; }
.price-row { padding: var(--sp-3) 0; border-bottom: 1px solid var(--line); }
.price-row:last-child { border-bottom: 0; }
.price-breakdown { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-4); margin: var(--sp-2) 0 0 calc(22px + var(--sp-2)); }
.price-material { display: inline-flex; align-items: center; gap: var(--sp-2); margin: 0; }
.price-material .input-group { width: 120px; }
.price-material .form-control, .price-material .input-group-text { min-height: 34px; font-size: var(--fs-sm); }
.price-suggest { margin: var(--sp-2) 0 0 calc(22px + var(--sp-2)); padding: 6px 10px; border-radius: var(--r-sm); }
.price-suggest.is-below { background: color-mix(in oklab, var(--brand) 10%, transparent); color: var(--ink); }
.price-suggest.is-ok { color: var(--success, #2f855a); }

/* ---------- Termômetro do MEI ---------- */
.mei-bar { position: relative; height: 10px; border-radius: 999px; background: var(--surface-2); overflow: visible; }
.mei-bar span { display: block; height: 100%; border-radius: inherit; background: var(--success); transition: width .4s ease; }
.mei-card.is-warn .mei-bar span { background: var(--warning, #C98A2E); }
.mei-card.is-over .mei-bar span { background: var(--danger, #B4384F); }
.mei-mark { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--muted); opacity: .5; border-radius: 1px; }

/* ---------- Página pública de agendamento (/agendar/<slug>) ---------- */
.booking-wrap { max-width: 560px; margin: 0 auto; padding: var(--sp-5) var(--sp-4) 120px; }
.booking-brand { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.booking-brand .brand-logo { width: 56px; height: 56px; border-radius: 16px; object-fit: cover; }
.booking-studio { font-family: var(--font-display); font-size: 1.9rem; line-height: 1.1; color: var(--ink); }
.booking-intro { color: var(--ink-2); margin-bottom: var(--sp-4); }
.booking-step-title { font-size: 1.1rem; display: flex; align-items: center; gap: var(--sp-2); margin: 0; }
.step-num { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-size: .85rem; font-weight: 700; }
.booking-services { display: grid; gap: var(--sp-2); }
.booking-service { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3); min-height: 56px; border: 1px solid var(--line-strong); border-radius: var(--r-md); cursor: pointer; background: var(--surface); transition: border-color var(--t-fast), background var(--t-fast); }
.booking-service input { position: absolute; opacity: 0; pointer-events: none; }
.booking-service > .grow { flex: 1 1 auto; min-width: 0; }
.booking-service:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.booking-service:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--brand) 35%, transparent); outline-offset: 2px; }
.booking-days { display: flex; gap: var(--sp-2); overflow-x: auto; padding: 4px 2px var(--sp-2); scroll-snap-type: x mandatory; margin-top: var(--sp-3); }
.booking-day { flex: 0 0 auto; scroll-snap-align: start; min-width: 64px; min-height: 56px; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); color: var(--ink); text-align: center; line-height: 1.2; }
.booking-times { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: var(--sp-2); }
.booking-time { min-height: 44px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.booking-day.active, .booking-time.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.booking-day.active .text-muted { color: rgba(255, 255, 255, .85) !important; }
.booking-health { margin-top: var(--sp-3); padding: var(--sp-3); border-radius: var(--r-md); background: var(--surface-2); }
.booking-health summary { cursor: pointer; font-size: var(--fs-sm); }
.booking-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) max(var(--sp-4), calc((100vw - 560px) / 2 + var(--sp-4))) calc(var(--sp-3) + var(--safe-bottom));
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); border-top: 1px solid var(--line); }
.booking-bar .btn { flex-shrink: 0; }
.booking-done { padding-top: var(--sp-8); }
.booking-done-icon { width: 64px; height: 64px; margin: 0 auto var(--sp-3); border-radius: 50%; display: grid; place-items: center; font-size: 2rem; background: var(--success-soft); color: var(--success); }
.booking-done-icon.is-cancelled { background: var(--danger-soft); color: var(--danger); }
.booking-footer { text-align: center; margin-top: var(--sp-6); }
.booking-link { font-size: 1.15rem; font-weight: 700; color: var(--ink); }
#calendar .ev-online { color: var(--lilac, #8C7BC4); font-size: .85em; }
/* Proteção contra falta: aviso ao escolher a cliente */
.risk-alert { display: flex; gap: var(--sp-2); align-items: flex-start; padding: 8px 12px; border-radius: var(--r-sm); background: var(--warning-soft); color: var(--warning); font-size: var(--fs-sm); font-weight: 600; }
/* Sinal pendente (agenda) */
.deposit-box { padding: 10px 12px; border-radius: var(--r-md); background: var(--warning-soft); color: var(--ink); }
#calendar .ev-deposit { color: var(--warning); font-size: .85em; }
/* Sinal por Pix (página da cliente) */
.pix-box { border: 2px solid var(--brand); }
.pix-qr { display: grid; place-items: center; }
.pix-qr svg { width: 220px; height: 220px; background: #fff; border-radius: var(--r-sm); }
.pix-qr svg .dark { fill: #000; }
.booking-waitlist summary { cursor: pointer; }

/* ==========================================================================
   Pacotes e fidelidade
   ========================================================================== */
.choice-card {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4); border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); cursor: pointer;
}
.choice-card .form-check-input { margin: 0; flex-shrink: 0; }
.choice-card:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.choice-card .grow { min-width: 0; }
/* Selos do cartão fidelidade */
.stamps { display: flex; flex-wrap: wrap; gap: 6px; }
.stamps span {
  width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px dashed var(--line-strong, var(--line)); background: var(--surface);
}
.stamps span.on { border: 0; background: var(--brand); box-shadow: inset 0 0 0 3px var(--brand-soft-2, rgba(255,255,255,.35)); }
.benefit-row { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2) 0; }
.benefit-row + .benefit-row { border-top: 1px solid var(--line); }
.benefit-row .grow { min-width: 0; }
.pkg-use { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs, .75rem); color: var(--brand); cursor: pointer; margin-top: 2px; }
.pkg-use input { margin: 0; }
.loyalty-box { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-2) var(--sp-3); border-radius: var(--r-md); background: var(--brand-soft); font-size: var(--fs-sm, .875rem); }
.loyalty-box label { cursor: pointer; }

/* ==========================================================================
   Teste grátis e assinatura
   ========================================================================== */
.trial-bar {
  display: flex; align-items: center; gap: var(--sp-2);
  max-width: 1200px; margin: 0 auto var(--sp-4); padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-md); background: var(--brand-soft); color: var(--brand-text);
  font-size: var(--fs-sm); text-decoration: none;
}
.trial-bar:hover { color: var(--brand-text); background: var(--brand-soft-2); }
.trial-bar.is-ending { background: color-mix(in oklab, #C98A2E 16%, var(--surface)); color: var(--ink); }
.subscription-card { max-width: 440px; }
.plan-box { margin-top: var(--sp-4); padding: var(--sp-4); border-radius: var(--r-md); border: 1px solid var(--brand-soft-2); background: var(--brand-soft); }
