/* ==========================================================================
   Tema «Moderno» — se carga después de app.css cuando el estilo de la interfaz es «moderno».
   Lenguaje visual inspirado en shadcn/ui (neutral / zinc): fuente Geist, bordes finos,
   tarjetas blancas con sombra leve, controles rectangulares de esquinas suaves y densidad compacta.
   Solo sobrescribe variables y componentes: no cambia el HTML ni la lógica.
   Fuente Geist © The Geist Authors, licencia SIL Open Font License 1.1.
   ========================================================================== */

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/geist-latin-ext.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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/geist-latin.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 {
  --ink: #09090b;
  --ink-soft: #27272a;
  --muted: #71717a;
  --faint: #a1a1aa;
  --canvas: #ffffff;
  --soft: #f4f4f5;
  --soft-2: #e4e4e7;
  --field: #ffffff;
  --hair-soft: #e4e4e7;
  --hair: #e4e4e7;
  --accent: #2563eb;

  --r-sm: 6px;
  --r-md: 12px;
  /* --r-full se conserva (interruptores, barras de progreso y avatares siguen redondos) */

  --w-heading: 600;
  --w-text: 400;
  --w-light: 400;
  --w-semi: 500;

  --font: "Geist", "Inter", -apple-system, "Segoe UI", sans-serif;
  --sidebar: 248px;
  --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / .05);
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / .08), 0 1px 2px -1px rgb(0 0 0 / .08);
  --shadow-md: 0 4px 12px -2px rgb(0 0 0 / .10), 0 2px 4px -2px rgb(0 0 0 / .08);
  --surface: #ffffff;          /* tarjetas, campos y zona principal */
  --surface-sunken: #fafafa;   /* fondo de la página y del menú lateral */
  --bg-app: var(--surface-sunken);
  --ink-nav: #3f3f46;
}

body { font-size: 14px; line-height: 1.5; background: var(--bg-app); letter-spacing: -.006em; }

/* ─── Tipografía ─────────────────────────────────────────────────────────── */
.t-h1 { font-size: clamp(32px, 4.4vw, 48px); letter-spacing: -.035em; line-height: 1.08; }
.t-h2 { font-size: clamp(26px, 3.6vw, 36px); letter-spacing: -.03em; line-height: 1.15; }
.t-h3 { font-size: 24px; letter-spacing: -.025em; line-height: 1.2; }
.t-h4 { font-size: 20px; letter-spacing: -.02em; line-height: 1.25; }
.t-title { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.t-lead { font-size: 15px; color: var(--muted); font-weight: 400; line-height: 1.55; }
.t-sm { font-size: 13px; line-height: 1.45; }
.t-cap { font-size: 12px; }
.t-label { font-size: 12px; }

/* ─── Botones ────────────────────────────────────────────────────────────── */
.btn { height: 36px; padding: 0 16px; border-radius: 6px; font-size: 14px; font-weight: 500; gap: 8px; box-shadow: var(--shadow-xs); }
.btn:hover { background: var(--ink-soft); border-color: var(--ink-soft); }
.btn-outline { background: var(--surface); border-color: var(--hair); color: var(--ink); }
.btn-outline:hover { background: var(--soft); border-color: var(--hair); }
.btn-soft { background: var(--soft); border-color: transparent; box-shadow: none; }
.btn-soft:hover { background: var(--soft-2); border-color: transparent; }
.btn-ghost { box-shadow: none; }
.btn-ghost:hover { background: var(--soft); }
.btn-danger { background: var(--surface); color: #b91c1c; border: 1px solid #fecaca; }
.btn-danger:hover { background: #b91c1c; color: #fff; border-color: #b91c1c; }
.btn-lg { height: 40px; padding: 0 22px; font-size: 14px; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-xs { height: 28px; padding: 0 10px; font-size: 12px; }
.btn-icon, .btn-icon.btn-sm, .btn-icon.btn-xs { padding: 0; }
.btn-icon { width: 36px; height: 36px; }
.btn-icon.btn-sm { width: 32px; height: 32px; }
.btn-icon.btn-xs { width: 28px; height: 28px; }
.btn:focus-visible { outline: 3px solid rgb(161 161 170 / .45); outline-offset: 1px; }

/* ─── Campos ─────────────────────────────────────────────────────────────── */
.label { font-size: 14px; font-weight: 500; }
.field { gap: 6px; }
.input, .select, .textarea { min-height: 36px; padding: 6px 12px; border-radius: 6px; border: 1px solid var(--hair); background-color: var(--surface); font-size: 14px; box-shadow: var(--shadow-xs); }
.textarea { min-height: 80px; }
.input:focus, .select:focus, .textarea:focus { border-color: #a1a1aa; background-color: var(--surface); box-shadow: 0 0 0 3px rgb(161 161 170 / .35); }
.input-sm, .select.input-sm { min-height: 32px; padding: 4px 10px; border-radius: 6px; font-size: 13px; }
.input-icon .input { padding-left: 38px; }
.input-icon .icon { left: 12px; }
.help { font-size: 13px; }
.switch input { width: 36px; height: 20px; background: var(--soft-2); }
.switch input::after { width: 16px; height: 16px; top: 2px; left: 2px; box-shadow: var(--shadow-xs); }
.switch input:checked::after { transform: translateX(16px); }
.switch .sw-text { font-size: 14px; }
.switch .sw-text small { font-size: 13px; }

/* ─── Tarjetas y bloques ─────────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--hair); border-radius: 12px; box-shadow: var(--shadow-sm); padding: 24px; }
.card-soft { background: var(--soft); border: 1px solid transparent; border-radius: 12px; }
.card-head h2, .card-head h3 { font-size: 16px; }
.card-link:hover { background: var(--surface-sunken); border-color: var(--hair); }
.tile { border-radius: 8px; background: var(--soft); }
.tile-ink { background: var(--ink); color: var(--canvas); }
.tile-white { background: var(--surface); border-color: var(--hair); }
.stat { background: var(--surface); border: 1px solid var(--hair); border-radius: 12px; box-shadow: var(--shadow-sm); padding: 18px 20px; }
.stat .s-value { font-size: clamp(26px, 3vw, 32px); letter-spacing: -.03em; }
.stat .s-label { font-size: 13px; }
.stat.stat-ink { background: var(--ink); border-color: var(--ink); color: var(--canvas); }
.stat.stat-ink .s-label, .stat.stat-ink .s-sub { color: #a1a1aa; }
.kv { font-size: 14px; }

/* ─── Insignias, pestañas y avisos ───────────────────────────────────────── */
.badge { border-radius: 6px; height: auto; padding: 2px 8px; font-size: 12px; font-weight: 500; line-height: 1.5; border: 1px solid transparent; }
.badge-ink { background: var(--ink); color: var(--canvas); }
.badge-outline { background: var(--surface); border-color: var(--hair); color: var(--ink); }
.badge-dashed { background: var(--surface); border: 1px solid var(--hair); color: var(--muted); }
.seg { background: var(--soft); border-radius: 8px; padding: 3px; gap: 2px; }
.seg a, .seg button { border-radius: 6px; height: 28px; padding: 0 12px; font-size: 13px; font-weight: 500; color: var(--muted); }
.seg .is-active, .seg a.is-active, .seg button.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.pager a, .pager span { border-radius: 6px; height: 32px; min-width: 32px; font-size: 13px; }
.chip { border-radius: 6px; height: 28px; font-size: 13px; }
.alert { border-radius: 8px; border: 1px solid var(--hair); background: var(--surface); font-size: 14px; padding: 12px 16px; }
.alert-dashed, .alert-outline { border-style: solid; background: var(--surface); }
.alert-ink { background: var(--ink); border-color: var(--ink); color: var(--canvas); }
.toast { border-radius: 8px; font-size: 14px; box-shadow: var(--shadow-md); }
.toast.toast-error { border-style: solid; border-color: #fecaca; }

/* ─── Tablas ─────────────────────────────────────────────────────────────── */
.table-card { background: var(--surface); border: 1px solid var(--hair); border-radius: 12px; box-shadow: var(--shadow-xs); overflow: hidden; }
.table th { font-size: 13px; font-weight: 500; color: var(--muted); background: transparent; text-transform: none; letter-spacing: 0; }
.table td { font-size: 14px; }
.table tbody tr:hover td { background: var(--surface-sunken); }

/* ─── Menús, ventanas y menú lateral ─────────────────────────────────────── */
.menu { border-radius: 8px; box-shadow: var(--shadow-md); border: 1px solid var(--hair); padding: 4px; }
.menu a, .menu button { height: 32px; border-radius: 6px; font-size: 14px; }
.modal-head h3 { font-size: 18px; letter-spacing: -.02em; }

.sidebar { background: var(--surface-sunken); border-right: 1px solid var(--hair); padding: 16px 12px; gap: 12px; }
.brand { font-size: 17px; letter-spacing: -.02em; }
.brand .tile { width: 32px; height: 32px; border-radius: 8px; }
.nav a { height: 32px; font-size: 14px; font-weight: 500; border-radius: 6px; gap: 10px; color: var(--ink-nav); }
.nav a:hover { background: var(--soft); }
.nav a.is-active { background: var(--soft); color: var(--ink); }
.nav-title { font-size: 12px; font-weight: 500; color: var(--muted); padding: 12px 8px 4px; }
.me { border-radius: 8px; }
.main-wrap { padding: 0; }
.main { border-radius: 0; background: var(--surface); min-height: 100vh; padding: 28px 36px 48px; }
.page-head { margin-bottom: 20px; }

/* ─── Editor de plantillas ───────────────────────────────────────────────── */
.tb-btn, .tb-color { border-radius: 6px; }
.tb-select { border-radius: 6px; }
.editor-toolbar, .editor-btnbar { border-radius: 8px; }

/* ─── Sitio público (inicio, precios, acceso) ────────────────────────────── */
.nav-pill { border-radius: 12px; border: 1px solid var(--hair); box-shadow: var(--shadow-sm); background: rgba(255, 255, 255, .9); backdrop-filter: blur(8px); }
.nav-pill .np-links a:not(.btn) { border-radius: 6px; height: 32px; font-size: 14px; font-weight: 500; }
.nav-pill .np-links a:not(.btn):hover { background: var(--soft); }
body.site { background: var(--surface); }
