/* ============================================================
   CMR Nexo — Design tokens (fuente de verdad)
   ============================================================
   - --accent / --accent-*  → plataforma (home, buscador, super-admin)
   - --business-accent      → solo ficha pública y panel del negocio
   - Estados semánticos     → fijos en toda la plataforma
   ============================================================ */

/* Inter self-hosted (sin link externo / sin next/font: stack HTML+Express) */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/inter/inter-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/inter/inter-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/inter/inter-latin-ext-500-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/inter/inter-latin-500-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/inter/inter-latin-ext-600-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/inter/inter-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/inter/inter-latin-ext-700-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/inter/inter-latin-700-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Acento primario de la plataforma (CMR Nexo) */
  --accent: #6366F1;
  --accent-hover: #4F46E5;
  --accent-light: #EEF2FF;

  /* Color de marca del negocio (default = plataforma; se pisa solo en ficha/admin del negocio) */
  --business-accent: var(--accent);
  --business-accent-hover: var(--accent-hover);
  --business-accent-light: var(--accent-light);

  /* Layout */
  --sidebar-bg: #0A0A0A;
  --content-bg: #F7F8FA;
  --card-bg: #FFFFFF;
  --border-color: #E4E4E7;

  /* Texto */
  --text-primary: #18181B;
  --text-secondary: #71717A;
  --text-on-dark: #F4F4F5;

  /* Estados semánticos (fijos — no dependen del color de marca) */
  --success: #22C55E;
  --success-bg: #DCFCE7;
  --warning: #F59E0B;
  --warning-bg: #FEF3C7;
  --danger: #EF4444;
  --danger-bg: #FEE2E2;
  --neutral: #71717A;
  --neutral-bg: #F4F4F5;

  /* Tipografía */
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --text-metric: 1.875rem;   /* 30px — métricas dashboard */
  --text-h1: 1.5rem;         /* 24px */
  --text-h2: 1.125rem;       /* 18px */
  --text-h3: 1rem;           /* 16px */
  --text-body: 0.875rem;     /* 14px */
  --text-meta: 0.8125rem;    /* 13px */
  --text-meta-sm: 0.75rem;   /* 12px */

  /* Radius / sombra de cards */
  --radius-card: 16px;
  --radius-xl: 12px;
  --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-card-soft: 0 4px 16px rgba(15, 23, 42, 0.05);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-body);
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--content-bg);
}

h1,
.text-h1 {
  font-size: var(--text-h1);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
}

h2,
.text-h2 {
  font-size: var(--text-h2);
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-primary);
}

h3,
.text-h3 {
  font-size: var(--text-h3);
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
}

.text-metric {
  font-size: var(--text-metric);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.text-body,
.label,
.btn {
  font-size: var(--text-body);
  font-weight: 500;
}

.text-meta {
  font-size: var(--text-meta);
  font-weight: 400;
  color: var(--text-secondary);
}

.text-meta-sm {
  font-size: var(--text-meta-sm);
  font-weight: 400;
  color: var(--text-secondary);
}

/* Card estándar plataforma */
.ds-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

/* Botón primario (plataforma; en scope de negocio usa --business-accent) */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  font-family: var(--font-sans);
  font-size: var(--text-body);
  font-weight: 500;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  transition: background 150ms ease;
}
.btn-primary:hover {
  background: var(--accent-hover);
}

.scope-business .btn-primary {
  background: var(--business-accent);
}
.scope-business .btn-primary:hover {
  background: var(--business-accent-hover);
}

/* Sidebar */
.ds-sidebar {
  background: var(--sidebar-bg);
  color: var(--text-on-dark);
}
.ds-sidebar__item {
  color: var(--text-on-dark);
  opacity: 0.75;
}
.ds-sidebar__item.is-active {
  opacity: 1;
  background: var(--accent);
  color: #fff;
}
.scope-business .ds-sidebar__item.is-active {
  background: var(--business-accent);
}

/* Badges de estado (siempre semánticos fijos) */
.badge-success {
  color: var(--success);
  background: var(--success-bg);
}
.badge-warning {
  color: #B45309;
  background: var(--warning-bg);
}
.badge-danger {
  color: var(--danger);
  background: var(--danger-bg);
}
.badge-neutral {
  color: var(--neutral);
  background: var(--neutral-bg);
}

.hidden {
  display: none !important;
}
