/*
 * HUB Barber - tipografia global (fonte unica da verdade)
 *
 *   Sora  -> titulos, cabecalhos, indicadores, numeros de destaque e valores financeiros
 *   Inter -> todo o resto: textos, menus, botoes, formularios, tabelas, campos, descricoes
 *
 * Carregamento: Google Fonts com display=swap e so os pesos usados (Inter 400/500/600,
 * Sora 500/600/700). Este arquivo deve ser o ULTIMO CSS do <head> de cada pagina.
 * Nenhum componente deve declarar font-family proprio: use var(--font-sans) ou var(--font-display).
 */

:root {
  /* Familias */
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-display: 'Sora', 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;

  /* Aliases dos tokens antigos (barbershop-theme, templates): tudo aponta para as duas familias */
  --font-primary: var(--font-sans);
  --font-heading: var(--font-display);
  --ct-body-font-family: var(--font-sans);
  --bs-body-font-family: var(--font-sans);
  --bs-font-sans-serif: var(--font-sans);

  /* Pesos (nada acima de 700; texto corrido 400, enfase 500/600) */
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-display: 600;
  --fw-display-strong: 700;

  /* Escala (rem; base 16px) */
  --fs-caption: 0.75rem;     /* 12px */
  --fs-small: 0.8125rem;     /* 13px */
  --fs-body: 0.9375rem;      /* 15px */
  --fs-lead: 1.0625rem;      /* 17px */
  --fs-h6: 1rem;
  --fs-h5: 1.125rem;
  --fs-h4: 1.25rem;
  --fs-h3: 1.5rem;
  --fs-h2: 1.75rem;
  --fs-h1: 2rem;
  --fs-metric: clamp(1.5rem, 1.1rem + 1.6vw, 2.25rem);   /* numeros de destaque */

  /* Alturas de linha */
  --lh-tight: 1.2;
  --lh-snug: 1.35;
  --lh-body: 1.55;

  /* Espacamento entre letras */
  --ls-display: -0.015em;
  --ls-body: 0;
  --ls-label: 0.04em;
}

@media (max-width: 575.98px) {
  :root {
    --fs-h1: 1.625rem;
    --fs-h2: 1.375rem;
    --fs-h3: 1.1875rem;
    --fs-h4: 1.0625rem;
    --fs-h5: 1rem;
    --fs-h6: 0.9375rem;
  }
}

/* ---------- Base ---------- */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html body {
  font-family: var(--font-sans);
  font-weight: var(--fw-regular);
  line-height: var(--lh-body);
  letter-spacing: var(--ls-body);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ---------- Componentes de texto/entrada: Inter ---------- */
html body p, html body span, html body li, html body label, html body small,
html body a, html body td, html body th, html body dd, html body dt, html body blockquote,
html body input, html body select, html body textarea, html body button, html body option,
html body .btn, html body .form-control, html body .form-select, html body .form-label,
html body .nav-link, html body .dropdown-item, html body .page-link, html body .badge,
html body .table, html body .alert, html body .tooltip, html body .popover,
html body .toast, html body .toast-message,
html body .modal-body, html body .modal-footer,
html body .swal2-popup, html body .swal2-html-container, html body .swal2-styled,
html body .select2-container, html body .select2-results__option, html body .select2-selection,
html body .dataTables_wrapper,
html body .fc, html body .fc .fc-button,
html body .admin-menu-item, html body .admin-menu-item-text {
  font-family: var(--font-sans);
}

/* Icones (FA, MDI, Tabler) mantem as fontes proprias: elas usam seletores de classe (.fas, .mdi...) mais especificos que estes */

/* ---------- Titulos, indicadores e valores: Sora ---------- */
html body h1, html body h2, html body h3, html body h4, html body h5, html body h6,
html body .h1, html body .h2, html body .h3, html body .h4, html body .h5, html body .h6,
html body .modal-title, html body .card-title, html body .swal2-title, html body .offcanvas-title,
html body .page-title, html body .page-title-barbershop, html body .stat-value, html body .fc .fc-toolbar-title,
html body .admin-topbar-logo, html body .admin-sidebar-brand h1,
html body [class*="stat-value"], html body [class*="kpi-value"], html body [class*="metric-value"],
html body [class*="stat-number"], html body [class*="total-value"], html body [class*="amount-value"] {
  font-family: var(--font-display);
  font-weight: var(--fw-display);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-display);
  text-transform: none;
}

html body h1, html body .h1 { font-size: var(--fs-h1); }
html body h2, html body .h2 { font-size: var(--fs-h2); }
html body h3, html body .h3 { font-size: var(--fs-h3); }
html body h4, html body .h4 { font-size: var(--fs-h4); }
html body h5, html body .h5 { font-size: var(--fs-h5); line-height: var(--lh-snug); }
html body h6, html body .h6 { font-size: var(--fs-h6); line-height: var(--lh-snug); }
html body .modal-title, html body .card-title, html body .swal2-title { font-size: var(--fs-h5); line-height: var(--lh-snug); }
html body .page-title-barbershop { font-size: var(--fs-h1); }

/* Numeros de destaque e valores financeiros */
html body .stat-value,
html body [class*="stat-value"], html body [class*="kpi-value"], html body [class*="metric-value"],
html body [class*="stat-number"], html body [class*="total-value"], html body [class*="amount-value"] {
  font-size: var(--fs-metric);
  font-weight: var(--fw-display);
}
html body .stat-value, html body td, html body th, html body .text-end, html body input[type="number"] {
  font-variant-numeric: tabular-nums;
}

/* Marca no menu/topo */
html body .admin-topbar-logo, html body .admin-sidebar-brand h1 { letter-spacing: 0; font-weight: var(--fw-display-strong); }
html body .admin-sidebar-brand h1 { font-size: 1.5rem; }

/* ---------- Pesos: nada excessivamente pesado ---------- */
html body b, html body strong, html body .fw-bold, html body .fw-bolder, html body .font-weight-bold { font-weight: var(--fw-semibold) !important; }
html body .fw-semibold { font-weight: var(--fw-semibold) !important; }
html body .fw-medium { font-weight: var(--fw-medium) !important; }
html body .btn, html body .nav-link, html body .page-link, html body .badge { font-weight: var(--fw-medium); letter-spacing: var(--ls-body); }
html body th, html body .table thead th { font-weight: var(--fw-semibold); letter-spacing: var(--ls-label); }
html body .form-label, html body label { font-weight: var(--fw-medium); }
html body small, html body .small, html body .text-muted { line-height: var(--lh-snug); }

/* ---------- Mobile: legibilidade ---------- */
@media (max-width: 767.98px) {
  /* 16px evita o zoom automatico do iOS ao focar um campo */
  html body input, html body select, html body textarea, html body .form-control, html body .form-select { font-size: 16px; }
  html body p, html body li, html body td { line-height: var(--lh-body); }
}

/* Codigo e campos monoespacados (cupons, tokens, links) */
html body code, html body pre, html body kbd, html body samp { font-family: var(--font-mono); }
