/* Panel de Comercios (simulado) · Rapa Nui
   Tokens copiados del panel real commerce.realtravelapp.com (design system Real Travel). */
@layer tokens, base, layout, components, utils;

@layer tokens {
  :root {
    color-scheme: light;
    --rt-brand: #b50933; --rt-brand-hover: #95082b; --rt-brand-active: #7d0624; --rt-brand-bright: #d30d2b;
    --rt-brand-tint: #fbe2e7; --rt-brand-wash: #fdf1f3;
    --rt-amber: #f2a65a; --rt-amber-tint: #fcecd9;
    --rt-ink: #0c0c13; --rt-slate: #333652; --rt-slate-muted: #6c6f86; --rt-slate-faint: #8b8da0;
    --rt-bg: #f2f3ef; --rt-surface: #ffffff; --rt-border: #dcdcdc; --rt-border-soft: #e8e9e4;
    --ok-bg: #d1fae5; --ok-text: #047857;
    --icon-blue-bg: #eff6ff; --icon-blue: #2563eb; --icon-green-bg: #ecfdf5; --icon-green: #059669;
    --icon-purple-bg: #faf5ff; --icon-purple: #9333ea; --icon-amber-bg: #fcecd9; --icon-amber: #b45309;
    --shadow-card: 0 6px 20px rgba(12, 12, 19, .10);
    --shadow-soft-lg: 0 14px 34px rgba(12, 12, 19, .16);
    --shadow-brand: 0 8px 22px rgba(181, 9, 51, .28);
    --radius: 12px;
    /* Alias que usan los gráficos traídos de rt-analitica */
    --surface: var(--rt-surface); --surface-2: var(--rt-bg); --text: var(--rt-ink); --text-2: var(--rt-slate-muted);
    --border: var(--rt-border-soft); --grid: #eceee8; --axis: #d4d6cf;
    --accent: var(--rt-brand); --accent-text: var(--rt-brand); --accent-soft: var(--rt-brand-wash); --accent-wash: rgba(181, 9, 51, .09);
    --up: #1f7a3a; --down: var(--rt-brand); --serie-2: #8a8c9c; --serie-3: #d9dbe3; --focus-ring: var(--rt-brand-bright);
    --font: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      color-scheme: dark;
      --rt-brand: #ef4a6c; --rt-brand-hover: #f36d89; --rt-brand-active: #ff8ba3; --rt-brand-bright: #ff6b88;
      --rt-brand-tint: #4a1824; --rt-brand-wash: #2d151b;
      --rt-amber-tint: #3b2a17;
      --rt-ink: #f1f1f5; --rt-slate: #c9cad8; --rt-slate-muted: #a2a4b8; --rt-slate-faint: #8a8ca0;
      --rt-bg: #111218; --rt-surface: #1a1b23; --rt-border: #34364a; --rt-border-soft: #2a2c3a;
      --ok-bg: #0f3a2b; --ok-text: #6ee7b7;
      --icon-blue-bg: #172340; --icon-blue: #7aa7ff; --icon-green-bg: #10302a; --icon-green: #5fd6a9;
      --icon-purple-bg: #2a1a3d; --icon-purple: #c79bff; --icon-amber-bg: #3b2a17; --icon-amber: #f2b36f;
      --shadow-card: 0 6px 20px rgba(0, 0, 0, .35); --shadow-soft-lg: 0 14px 34px rgba(0, 0, 0, .5); --shadow-brand: 0 8px 22px rgba(239, 74, 108, .25);
      --grid: #262836; --axis: #3a3c50; --accent-wash: rgba(239, 74, 108, .15); --up: #4cc271; --serie-2: #8f91a6; --serie-3: #3d3f52;
    }
  }
  :root[data-theme="dark"] {
    color-scheme: dark;
    --rt-brand: #ef4a6c; --rt-brand-hover: #f36d89; --rt-brand-active: #ff8ba3; --rt-brand-bright: #ff6b88;
    --rt-brand-tint: #4a1824; --rt-brand-wash: #2d151b;
    --rt-amber-tint: #3b2a17;
    --rt-ink: #f1f1f5; --rt-slate: #c9cad8; --rt-slate-muted: #a2a4b8; --rt-slate-faint: #8a8ca0;
    --rt-bg: #111218; --rt-surface: #1a1b23; --rt-border: #34364a; --rt-border-soft: #2a2c3a;
    --ok-bg: #0f3a2b; --ok-text: #6ee7b7;
    --icon-blue-bg: #172340; --icon-blue: #7aa7ff; --icon-green-bg: #10302a; --icon-green: #5fd6a9;
    --icon-purple-bg: #2a1a3d; --icon-purple: #c79bff; --icon-amber-bg: #3b2a17; --icon-amber: #f2b36f;
    --shadow-card: 0 6px 20px rgba(0, 0, 0, .35); --shadow-soft-lg: 0 14px 34px rgba(0, 0, 0, .5); --shadow-brand: 0 8px 22px rgba(239, 74, 108, .25);
    --grid: #262836; --axis: #3a3c50; --accent-wash: rgba(239, 74, 108, .15); --up: #4cc271; --serie-2: #8f91a6; --serie-3: #3d3f52;
  }
}

@layer base {
  *, *::before, *::after { box-sizing: border-box; }
  * { margin: 0; }
  html, body { height: 100%; }
  body { background: var(--rt-bg); color: var(--rt-ink); font-family: var(--font); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
  button, input, textarea, select { font: inherit; color: inherit; }
  a { color: inherit; text-decoration: none; }
  img { max-width: 100%; display: block; }
  svg.i { width: 16px; height: 16px; flex: none; }
  :focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
  .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  @media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
}

@layer layout {
  .shell { display: flex; height: 100vh; }
  .shell > .col { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
  main.contenido { flex: 1; overflow-y: auto; padding: 24px; }
  .w-4xl { max-width: 896px; }
  .w-2xl { max-width: 672px; }
  .w-6xl { max-width: 1152px; }
  @media (max-width: 860px) {
    .shell { flex-direction: column; height: auto; min-height: 100vh; }
    .shell > .col { overflow: visible; }
    main.contenido { padding: 20px 16px 48px; overflow: visible; }
  }
}

@layer components {
  /* Barra lateral */
  .sidebar { width: 240px; flex: none; display: flex; flex-direction: column; background: var(--rt-surface); border-right: 1px solid var(--rt-border-soft); overflow-y: auto; }
  .sidebar .marca { padding: 16px; border-bottom: 1px solid var(--rt-border-soft); }
  .logo { display: flex; align-items: center; gap: 10px; }
  .logo img { border-radius: 10px; }
  .logo .wm { font-size: 18px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; color: var(--rt-ink); }
  .logo .wm b { color: var(--rt-brand); font-weight: 700; }
  .logo .subt { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--rt-slate-faint); }
  .entidad { margin: 16px 12px 0; display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--radius); border: 1px solid var(--rt-border-soft); background: var(--rt-brand-wash); }
  .entidad p { font-size: 14px; font-weight: 600; }
  .entidad span { font-size: 12px; color: var(--rt-slate-muted); }
  .avatar { width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--rt-brand-tint); color: var(--rt-brand); font-weight: 600; font-size: 14px; }
  .avatar.sm { width: 32px; height: 32px; font-size: 12px; }
  .rotulo-nav { margin-top: 24px; padding: 0 16px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--rt-slate-faint); }
  .nav { display: flex; flex-direction: column; gap: 4px; padding: 12px; }
  .nav a { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: var(--radius); font-size: 14px; font-weight: 500; color: var(--rt-slate); transition: background .15s, color .15s; }
  .nav a:hover { background: var(--rt-bg); color: var(--rt-ink); }
  .nav a[aria-current="page"] { background: var(--rt-brand-wash); color: var(--rt-brand); }
  .nav .nuevo { margin-left: auto; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding: 1px 7px; border-radius: 99px; background: var(--rt-amber-tint); color: var(--icon-amber); }
  .sidebar .pie { margin-top: auto; padding: 14px 16px; border-top: 1px solid var(--rt-border-soft); font-size: 11.5px; color: var(--rt-slate-faint); }
  .sidebar .pie a { text-decoration: underline; }
  .sidebar .pie button { all: unset; cursor: pointer; text-decoration: underline; }
  .sidebar .pie button:focus-visible { outline: 2px solid var(--focus-ring); }
  @media (max-width: 860px) {
    .sidebar { width: 100%; border-right: 0; border-bottom: 1px solid var(--rt-border-soft); overflow: visible; }
    .sidebar .marca { border-bottom: 0; padding: 12px 16px 4px; }
    .entidad, .sidebar .pie { display: none; }
    .rotulo-nav { display: none; }
    .nav { flex-direction: row; overflow-x: auto; padding: 8px 12px 10px; gap: 4px; scrollbar-width: none; }
    .nav a { white-space: nowrap; padding: 7px 10px; font-size: 13px; gap: 6px; }
    .nav .nuevo { display: none; }
  }

  /* Encabezado */
  .header { height: 64px; flex: none; display: flex; align-items: center; justify-content: flex-end; gap: 16px; padding: 0 24px; background: var(--rt-surface); border-bottom: 1px solid var(--rt-border-soft); }
  .header .demo { margin-right: auto; font-size: 12px; color: var(--icon-amber); background: var(--rt-amber-tint); padding: 4px 10px; border-radius: 99px; font-weight: 500; }
  .header .yo { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--rt-slate); min-width: 0; }
  .header .yo span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .salir { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--rt-slate-muted); transition: color .15s; }
  .salir:hover { color: var(--rt-brand); }
  .salir:focus-visible { outline: 2px solid var(--focus-ring); border-radius: 6px; }
  @media (max-width: 860px) { .header { height: 52px; padding: 0 16px; } .header .yo span { display: none; } }
  @media (max-width: 420px) { .header .demo { font-size: 11px; } }

  /* Tipografía */
  h1.t { font-size: 24px; font-weight: 600; line-height: 1.3; }
  .lead { margin-top: 4px; font-size: 14px; color: var(--rt-slate-muted); }
  h2.t2 { font-size: 18px; font-weight: 600; margin-bottom: 12px; }
  .muted { color: var(--rt-slate-muted); }
  .faint { color: var(--rt-slate-faint); }

  /* Tarjetas */
  .card { background: var(--rt-surface); border: 1px solid var(--rt-border-soft); border-radius: var(--radius); box-shadow: var(--shadow-card); min-width: 0; }
  a.card, .card.clic { display: block; transition: box-shadow .2s, transform .2s; }
  a.card:hover, .card.clic:hover { box-shadow: var(--shadow-soft-lg); }
  .p6 { padding: 24px; } .p4 { padding: 16px; }
  .grid3 { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid2 { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  @media (max-width: 640px) { .grid3, .grid2 { grid-template-columns: 1fr; } }
  .ico { width: 40px; height: 40px; border-radius: var(--radius); display: inline-flex; align-items: center; justify-content: center; flex: none; }
  .ico svg { width: 20px; height: 20px; }
  .ico.azul { background: var(--icon-blue-bg); color: var(--icon-blue); }
  .ico.verde { background: var(--icon-green-bg); color: var(--icon-green); }
  .ico.morado { background: var(--icon-purple-bg); color: var(--icon-purple); }
  .ico.ambar { background: var(--icon-amber-bg); color: var(--icon-amber); }
  .ico.marca { background: var(--rt-brand); color: #fff; }
  .ico.tinta { background: var(--rt-ink); color: var(--rt-surface); }
  .cifra-g { font-size: 24px; font-weight: 700; margin-top: 12px; }
  .accion { display: flex; align-items: center; gap: 12px; }
  .accion p { font-size: 14px; font-weight: 600; }
  .accion span { font-size: 12px; color: var(--rt-slate-muted); }
  .mt2 { margin-top: 8px; } .mt4 { margin-top: 16px; } .mt6 { margin-top: 24px; } .mt8 { margin-top: 32px; } .mb4 { margin-bottom: 16px; } .mb6 { margin-bottom: 24px; }

  /* Botones y campos */
  .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: var(--radius); border: 0; font-size: 14px; font-weight: 500; cursor: pointer; transition: background .15s, transform .1s, opacity .15s; background: var(--rt-brand); color: #fff; box-shadow: var(--shadow-brand); white-space: nowrap; }
  .btn:hover { background: var(--rt-brand-hover); }
  .btn:active { transform: scale(.97); }
  .btn:disabled { opacity: .5; pointer-events: none; }
  .btn.sec { background: var(--rt-surface); color: var(--rt-ink); border: 1px solid var(--rt-border); box-shadow: none; }
  .btn.sec:hover { background: var(--rt-bg); }
  .btn.ghost { background: transparent; color: var(--rt-slate); box-shadow: none; }
  .btn.ghost:hover { background: var(--rt-bg); }
  .btn.peligro { background: transparent; color: var(--rt-brand); box-shadow: none; border: 1px solid var(--rt-brand-tint); }
  .btn.peligro:hover { background: var(--rt-brand-wash); }
  .btn.sm { height: 34px; padding: 0 12px; font-size: 12.5px; }
  .btn.full { width: 100%; }
  .input, .textarea { display: block; width: 100%; border-radius: 10px; border: 1px solid var(--rt-border); background: var(--rt-surface); padding: 8px 12px; font-size: 14px; color: var(--rt-ink); transition: box-shadow .15s, border-color .15s; }
  .input { height: 40px; }
  .textarea { min-height: 96px; resize: vertical; line-height: 1.55; }
  .input::placeholder, .textarea::placeholder { color: var(--rt-slate-faint); }
  .input:focus, .textarea:focus { outline: none; border-color: transparent; box-shadow: 0 0 0 2px var(--rt-brand-bright); }
  label.l { display: block; margin-bottom: 4px; font-size: 14px; font-weight: 500; }
  .campo + .campo { margin-top: 16px; }
  .ayuda { font-size: 12px; color: var(--rt-slate-muted); margin-top: 4px; }
  .con-ico { position: relative; }
  .con-ico svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--rt-slate-faint); pointer-events: none; }
  .con-ico .input { padding-left: 36px; }
  .buscar { display: flex; gap: 8px; margin-bottom: 16px; }
  .buscar .input { flex: 1; }
  .check { display: flex; align-items: center; gap: 8px; font-size: 14px; }
  .check input { width: 16px; height: 16px; accent-color: var(--rt-brand); }
  .msg-ok { font-size: 14px; color: var(--ok-text); }
  .msg-err { font-size: 14px; color: var(--rt-brand); }
  .acciones-form { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 20px; }

  /* Tabla */
  table.lista { width: 100%; border-collapse: collapse; font-size: 14px; }
  table.lista thead { background: var(--rt-bg); border-bottom: 1px solid var(--rt-border-soft); }
  table.lista th { padding: 12px 16px; text-align: left; font-weight: 500; color: var(--rt-slate-muted); }
  table.lista td { padding: 12px 16px; border-bottom: 1px solid var(--rt-border-soft); vertical-align: middle; }
  table.lista tr:last-child td { border-bottom: 0; }
  table.lista tbody tr:hover { background: var(--rt-bg); }
  table.lista td.nom { font-weight: 500; }
  table.lista td.nom small { display: block; font-weight: 400; font-size: 12px; color: var(--rt-slate-faint); }
  table.lista td.der { text-align: right; white-space: nowrap; }
  table.lista .mini { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; background: var(--rt-bg); }
  table.lista .celda-nom { display: flex; align-items: center; gap: 12px; }
  .vinculo { font-size: 12px; font-weight: 500; color: var(--rt-brand); }
  .vinculo:hover { text-decoration: underline; }
  .vacio-t { padding: 32px 16px; text-align: center; color: var(--rt-slate-faint); }
  .overflow { overflow: hidden; }
  .tabla-scroll { overflow-x: auto; }
  @media (max-width: 640px) { table.lista .ocultar-m { display: none; } table.lista th, table.lista td { padding: 10px 12px; } }

  .badge { display: inline-flex; align-items: center; border-radius: 99px; padding: 2px 10px; font-size: 12px; font-weight: 500; }
  .badge.ok { background: var(--ok-bg); color: var(--ok-text); }
  .badge.neutro { background: var(--rt-bg); color: var(--rt-slate-muted); }
  .badge.ambar { background: var(--rt-amber-tint); color: var(--icon-amber); }
  .badge.marca { background: var(--rt-brand-tint); color: var(--rt-brand); }

  .paginacion { margin-top: 16px; display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 14px; color: var(--rt-slate-muted); }
  .volver { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; color: var(--rt-slate-muted); margin-bottom: 16px; }
  .volver:hover { color: var(--rt-ink); }
  .tabs { display: flex; flex-wrap: wrap; gap: 12px; margin: 4px 0 24px; }
  .tabs a { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--rt-slate); border: 1px solid var(--rt-border); border-radius: var(--radius); padding: 6px 12px; transition: background .15s; }
  .tabs a:hover { background: var(--rt-bg); }
  .tabs a[aria-current="page"] { border-color: var(--rt-brand); color: var(--rt-brand); background: var(--rt-brand-wash); }
  .tabs .n { font-size: 11px; background: var(--rt-bg); border-radius: 99px; padding: 0 6px; color: var(--rt-slate-muted); }
  .portada { width: 100%; height: 160px; object-fit: cover; border-radius: var(--radius); margin-bottom: 16px; background: var(--rt-border-soft); }
  dl.ficha { display: grid; gap: 16px; }
  dl.ficha dt { font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; color: var(--rt-slate-muted); }
  dl.ficha dd { margin-top: 4px; font-size: 14px; white-space: pre-wrap; }
  .spinner { display: flex; justify-content: center; padding: 48px 0; }
  .spinner::after { content: ""; width: 32px; height: 32px; border-radius: 50%; border: 4px solid var(--rt-border); border-top-color: var(--rt-brand); animation: gira .8s linear infinite; }
  @keyframes gira { to { transform: rotate(360deg); } }

  /* Imágenes */
  .galeria { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .foto { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--rt-border-soft); aspect-ratio: 4 / 3; }
  .foto img { width: 100%; height: 100%; object-fit: cover; }
  .foto .quitar { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(12, 12, 19, .72); color: #fff; cursor: pointer; }
  .foto .quitar:hover { background: var(--rt-brand); }
  .foto .pie-f { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 6px; font-size: 11px; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .7)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .subir { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border: 2px dashed var(--rt-border); border-radius: var(--radius); aspect-ratio: 4 / 3; color: var(--rt-slate-muted); font-size: 13px; cursor: pointer; text-align: center; padding: 8px; transition: border-color .15s, color .15s; }
  .subir:hover, .subir:focus-within { border-color: var(--rt-brand); color: var(--rt-brand); }
  .subir input { position: absolute; opacity: 0; width: 1px; height: 1px; }

  /* Tips */
  .tip { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: start; padding: 16px; border-bottom: 1px solid var(--rt-border-soft); }
  .tip:last-child { border-bottom: 0; }
  .tip p { font-size: 14px; white-space: pre-wrap; }
  .tip p.en { color: var(--rt-slate-muted); font-size: 13px; margin-top: 4px; }
  .tip .bt { display: flex; gap: 6px; }
  .tip-form { display: grid; gap: 10px; padding: 16px; }

  /* Diálogo */
  dialog { border: 0; border-radius: var(--radius); padding: 0; max-width: min(440px, calc(100% - 32px)); background: var(--rt-surface); color: var(--rt-ink); box-shadow: var(--shadow-soft-lg); }
  dialog::backdrop { background: rgba(12, 12, 19, .45); }
  dialog .cuerpo { padding: 24px; }
  dialog h3 { font-size: 17px; font-weight: 600; }
  dialog p { margin-top: 8px; color: var(--rt-slate-muted); }
  dialog .bts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

  /* Aviso flotante */
  .toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--rt-ink); color: var(--rt-surface); padding: 10px 16px; border-radius: 10px; font-size: 14px; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; z-index: 50; max-width: calc(100% - 32px); }
  .toast.ver { opacity: 1; transform: translate(-50%, 0); }

  /* Login */
  .login { display: flex; min-height: 100vh; background: var(--rt-bg); }
  .login .foto-l { position: relative; width: 50%; display: none; overflow: hidden; }
  @media (min-width: 1024px) { .login .foto-l { display: block; } }
  .login .foto-l img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
  .login .velo { position: absolute; inset: 0; background: linear-gradient(120deg, rgba(0, 0, 0, .62) 0%, rgba(0, 0, 0, .25) 55%, rgba(0, 0, 0, .66) 100%); }
  .login .texto-l { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; padding: 48px; color: #fff; }
  .login .texto-l .logo .wm, .login .texto-l .logo .wm b { color: #fff; }
  .login .texto-l .logo .wm b { opacity: .9; }
  .login .texto-l .logo img { box-shadow: 0 6px 18px rgba(0, 0, 0, .3); }
  .login .texto-l .k { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; opacity: .85; }
  .login .texto-l h1 { margin-top: 14px; font-size: 36px; font-weight: 700; line-height: 1.15; letter-spacing: -.02em; max-width: 28rem; }
  .login .texto-l p { margin-top: 16px; font-size: 16px; line-height: 1.6; opacity: .92; max-width: 28rem; }
  .login .texto-l small { font-size: 12px; opacity: .8; }
  .login .form-l { flex: 1; display: flex; align-items: center; justify-content: center; padding: 32px 16px; }
  .login .caja { width: 100%; max-width: 384px; }
  .login h2 { margin-top: 24px; font-size: 24px; font-weight: 600; }
  .login form { margin-top: 24px; display: grid; gap: 16px; }
  .nota-demo { margin-top: 20px; padding: 12px 14px; border-radius: 10px; background: var(--rt-amber-tint); color: var(--rt-ink); font-size: 13px; }
  .reset { margin-top: 16px; }
  .reset .enlace { all: unset; cursor: pointer; font-size: 14px; color: var(--rt-slate-muted); text-decoration: underline; }
  .reset .enlace:hover { color: var(--rt-ink); }
  .reset .enlace:focus-visible { outline: 2px solid var(--focus-ring); }
  .reset form { margin-top: 0; padding: 16px; border: 1px solid var(--rt-border); border-radius: 10px; gap: 12px; }
  .reset .fila { display: flex; gap: 8px; }
  .reset .fila .btn { flex: 1; }
  .credito { margin-top: 32px; font-size: 12px; color: var(--rt-slate-faint); }
  .credito a { text-decoration: underline; }

  /* ---------- Analítica (traída de rt-analitica, con la piel del panel) ---------- */
  .filtros { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 20px; }
  .chip { border: 1px solid var(--rt-border); background: var(--rt-surface); border-radius: 99px; padding: 6px 14px; font-size: 13px; color: var(--rt-slate-muted); cursor: pointer; transition: border-color .15s, color .15s, background .15s; }
  .chip:hover { border-color: var(--rt-slate-muted); color: var(--rt-ink); }
  .chip[aria-pressed="true"] { border-color: var(--rt-brand); color: var(--rt-brand); background: var(--rt-brand-wash); font-weight: 500; }
  .an .card { padding: 24px; }
  .an .card h2 { font-size: 16px; font-weight: 600; }
  .an .card .nota { font-size: 13px; color: var(--text-2); margin-top: 2px; }
  .an .card-head { margin-bottom: 16px; }
  .kicker { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); }
  .bloque + .bloque, .tarjetas > .bloque { margin-top: 16px; }
  .g2 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
  .g3 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
  .resumen { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.1fr) minmax(0, 2fr); }
  @media (max-width: 960px) { .resumen { grid-template-columns: 1fr; } }
  .hero .valor { font-size: clamp(44px, 6vw, 60px); font-weight: 700; line-height: 1; margin-top: 10px; letter-spacing: -.03em; }
  .hero .detalle { font-size: 13px; color: var(--text-2); margin-top: 10px; }
  .tiles { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); align-content: start; }
  @media (max-width: 640px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  .tile .valor { font-size: 24px; font-weight: 700; margin-top: 4px; line-height: 1.2; letter-spacing: -.02em; }
  .delta { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 500; margin-top: 4px; }
  .delta.bien { color: var(--up); } .delta.mal { color: var(--down); } .delta.igual, .delta.nd { color: var(--text-2); font-weight: 400; }
  .grafico { position: relative; }
  .grafico svg { display: block; width: 100%; overflow: visible; }
  .grafico .tick { font-size: 11px; fill: var(--text-2); font-variant-numeric: tabular-nums; font-family: var(--font); }
  .tooltip { position: absolute; pointer-events: none; background: var(--rt-ink); color: var(--rt-surface); border-radius: 8px; padding: 8px 12px; box-shadow: 0 4px 16px rgba(0, 0, 0, .25); font-size: 12px; min-width: 150px; opacity: 0; transition: opacity .1s; z-index: 2; }
  .tooltip.visible { opacity: 1; }
  .tooltip .fecha { opacity: .7; margin-bottom: 4px; }
  .tooltip .fila { display: flex; justify-content: space-between; gap: 16px; }
  .tooltip .fila strong { font-weight: 600; font-variant-numeric: tabular-nums; }
  .tooltip .fila span { display: inline-flex; align-items: center; gap: 6px; opacity: .85; }
  .tooltip .linea { width: 12px; height: 2px; background: var(--accent); border-radius: 1px; }
  .barras { list-style: none; padding: 0; display: grid; gap: 10px; }
  .barras li { display: grid; grid-template-columns: minmax(90px, 38%) 1fr; gap: 12px; align-items: center; font-size: 13.5px; }
  .barras .nombre { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .barras .nombre a { color: inherit; }
  .barras .nombre a:hover { color: var(--rt-brand); text-decoration: underline; }
  .barras .pista { display: grid; grid-template-columns: 1fr 48px; align-items: center; gap: 8px; min-width: 0; }
  .barras .carril { display: block; min-width: 0; }
  .barras .barra { display: block; height: 12px; background: var(--accent); border-radius: 0 4px 4px 0; min-width: 2px; }
  .barras .cifra { font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
  .vacio { color: var(--text-2); font-size: 14px; padding: 8px 0; }
  details.tabla { margin-top: 16px; font-size: 13px; }
  details.tabla summary { cursor: pointer; color: var(--text-2); width: fit-content; }
  details.tabla .scroll { max-height: 280px; overflow: auto; margin-top: 8px; border: 1px solid var(--border); border-radius: 8px; }
  details.tabla table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
  details.tabla th, details.tabla td { text-align: right; padding: 6px 10px; border-bottom: 1px solid var(--grid); }
  details.tabla th:first-child, details.tabla td:first-child { text-align: left; }
  details.tabla th { font-weight: 500; color: var(--text-2); position: sticky; top: 0; background: var(--surface); }
  .aviso { background: var(--rt-brand-wash); border-radius: var(--radius); padding: 14px 16px; font-size: 14px; margin-bottom: 16px; }
  .an[aria-busy="true"] .card { opacity: .55; transition: opacity .2s; }
  .fuente { margin-top: 24px; font-size: 12px; color: var(--text-2); }
  .hallazgos { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); margin-top: 20px; }
  .hallazgo { display: flex; flex-direction: column; container-type: inline-size; }
  .hallazgo.ancho { grid-column: 1 / -1; }
  .hallazgo .titular { font-size: clamp(17px, 2vw, 20px); font-weight: 600; line-height: 1.35; margin-top: 8px; text-wrap: pretty; }
  .hallazgo .detalle { font-size: 13.5px; color: var(--text-2); margin-top: 10px; text-wrap: pretty; }
  .hallazgo .grafico { margin-top: 20px; }
  .hallazgo details.tabla { margin-top: auto; padding-top: 16px; }
  .leyenda { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--text-2); margin-bottom: 12px; }
  .leyenda span { display: inline-flex; align-items: center; gap: 6px; }
  .leyenda i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
  .leyenda i.hueco { background: var(--surface) !important; border: 2px solid var(--serie-2); border-radius: 50%; }
  .panel + .panel { margin-top: 14px; }
  .panel .etiqueta { font-size: 12px; color: var(--text-2); margin-bottom: 4px; }
  .marca-dato { cursor: default; }
  .marca-dato:focus-visible { outline: 2px solid var(--focus-ring); }
  .duo { list-style: none; padding: 0; display: grid; gap: 12px; }
  .duo li { display: grid; grid-template-columns: minmax(90px, 34%) 1fr; gap: 12px; align-items: center; font-size: 13.5px; }
  .duo .barritas { display: grid; gap: 3px; }
  .duo .linea-b { display: grid; grid-template-columns: 1fr 42px; gap: 8px; align-items: center; }
  .duo .linea-b span:first-child { display: block; height: 8px; border-radius: 0 4px 4px 0; min-width: 2px; }
  .duo .cifra { font-size: 12px; color: var(--text-2); text-align: right; font-variant-numeric: tabular-nums; }
  .apilada { list-style: none; padding: 0; display: grid; gap: 12px; }
  .apilada li { display: grid; grid-template-columns: minmax(70px, 22%) 1fr; gap: 12px; align-items: center; font-size: 13.5px; }
  .apilada .franja { display: flex; gap: 2px; height: 22px; }
  .apilada .franja span { display: grid; place-items: center; font-size: 11px; font-weight: 500; overflow: hidden; white-space: nowrap; min-width: 0; }
  .apilada .franja span:first-child { border-radius: 4px 0 0 4px; }
  .apilada .franja span:last-child { border-radius: 0 4px 4px 0; }
  .calor { display: grid; grid-template-columns: 34px repeat(24, minmax(0, 1fr)); gap: 2px; font-size: 11px; color: var(--text-2); }
  .calor .celda { aspect-ratio: 1; border-radius: 3px; background: var(--accent); min-height: 8px; }
  .calor .dia { display: flex; align-items: center; }
  .calor .hora { text-align: center; font-variant-numeric: tabular-nums; }
  @container (max-width: 520px) { .calor .hora:nth-child(odd of .hora) { visibility: hidden; } }
  .mini-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
  .mini-kpis .v { font-size: 20px; font-weight: 700; }
  .mini-kpis .k { font-size: 12px; color: var(--rt-slate-muted); }
  .chispa { margin-top: 12px; height: 48px; }
  .chispa svg { width: 100%; height: 48px; display: block; }
  .an-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
}
