:root {
  --fondo: #f6f7f9;
  --tarjeta: #ffffff;
  --texto: #171a1f;
  --suave: #5d6675;
  --linea: #e2e5ea;
  --acento: #1f3a5f;
  --acento-2: #2b4f80;
  --ok: #1f7a4d;
  --ok-fondo: #e6f4ec;
  --ojo: #8a5a00;
  --ojo-fondo: #fdf3dc;
  --mal: #a3261f;
  --mal-fondo: #fbe9e7;
  --radio: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fondo: #0f1216; --tarjeta: #171b21; --texto: #eceff4; --suave: #9aa4b2; --linea: #2a303a;
    --acento: #6ea0e0; --acento-2: #8db6ee; --ok: #58c08a; --ok-fondo: #12281d; --ojo: #e6b755;
    --ojo-fondo: #2b2210; --mal: #ef8b83; --mal-fondo: #2e1614;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fondo); color: var(--texto);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
[hidden] { display: none !important; }
h1 { font-size: 1.35rem; margin: 0 0 .25rem; }
h2 { font-size: 1.05rem; margin: 2rem 0 .75rem; letter-spacing: .01em; }
a { color: var(--acento); }
.suave { color: var(--suave); }
.error { color: var(--mal); margin: .5rem 0 0; }
svg.ico { width: 1.1em; height: 1.1em; vertical-align: -0.2em; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* botones */
button {
  font: inherit; cursor: pointer; border-radius: 8px; border: 1px solid var(--linea); background: var(--tarjeta);
  color: var(--texto); padding: .45rem .85rem; display: inline-flex; align-items: center; gap: .45rem; line-height: 1.2;
}
button:hover:not(:disabled) { border-color: var(--acento); }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 2px solid var(--acento); outline-offset: 2px; }
button:disabled { opacity: .5; cursor: not-allowed; }
button.primario { background: var(--acento); border-color: var(--acento); color: #fff; }
@media (prefers-color-scheme: dark) { button.primario { color: #0f1216; } }
button.primario:hover:not(:disabled) { background: var(--acento-2); border-color: var(--acento-2); }
button.fantasma { background: transparent; }
button.peligro { color: var(--mal); }

/* entrada */
.login { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.login-caja { width: 100%; max-width: 380px; background: var(--tarjeta); border: 1px solid var(--linea); border-radius: 14px; padding: 2rem; display: flex; flex-direction: column; gap: .5rem; }
.marca-login { color: var(--acento); margin-bottom: .5rem; }
.marca-login svg { width: 34px; height: 34px; }
label { font-weight: 600; font-size: .9rem; margin-top: .5rem; display: block; }
input, select, textarea {
  font: inherit; width: 100%; padding: .55rem .7rem; border-radius: 8px; border: 1px solid var(--linea);
  background: var(--tarjeta); color: var(--texto);
}
input[type=color] { padding: .15rem; height: 2.4rem; }
.ayuda { font-size: .82rem; color: var(--suave); margin: .2rem 0 0; }

/* barra */
.barra { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: .7rem 1.25rem; background: var(--tarjeta); border-bottom: 1px solid var(--linea); }
.barra-marca { display: flex; align-items: center; gap: .6rem; color: var(--acento); }
.barra-marca strong { color: var(--texto); }
.barra-marca svg { width: 24px; height: 24px; }
.barra-der { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.chip { font-size: .8rem; padding: .2rem .55rem; border: 1px solid var(--linea); border-radius: 99px; }

.contenido { max-width: 1120px; margin: 0 auto; padding: 1.25rem; }
.aviso { background: var(--ojo-fondo); color: var(--ojo); border: 1px solid var(--ojo); border-radius: var(--radio); padding: .7rem 1rem; }

/* resumen */
.resumen { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; }
.dato { background: var(--tarjeta); border: 1px solid var(--linea); border-radius: var(--radio); padding: .8rem 1rem; }
.dato b { display: block; font-size: 1.5rem; line-height: 1.2; }
.dato span { color: var(--suave); font-size: .85rem; }

/* tiendas */
.tiendas { display: grid; gap: .9rem; }
.tienda { background: var(--tarjeta); border: 1px solid var(--linea); border-radius: 12px; padding: 1rem 1.15rem; display: grid; gap: .8rem; }
.tienda-cab { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: flex-start; }
.tienda-nombre { font-size: 1.1rem; font-weight: 650; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.slug { color: var(--suave); font-weight: 400; font-size: .85rem; }
.pastilla { font-size: .75rem; font-weight: 600; padding: .15rem .55rem; border-radius: 99px; border: 1px solid transparent; }
.pastilla.ok { background: var(--ok-fondo); color: var(--ok); }
.pastilla.ojo { background: var(--ojo-fondo); color: var(--ojo); }
.pastilla.mal { background: var(--mal-fondo); color: var(--mal); }
.pastilla.gris { background: transparent; color: var(--suave); border-color: var(--linea); }
.dominios { display: flex; gap: .4rem 1rem; flex-wrap: wrap; font-size: .9rem; }
.dominios a { display: inline-flex; align-items: center; gap: .3rem; text-decoration: none; }
.dominios a:hover { text-decoration: underline; }
.numeros { display: flex; flex-wrap: wrap; gap: .4rem 1.6rem; }
.numeros div { display: flex; flex-direction: column; }
.numeros b { font-size: 1.05rem; }
.numeros span { font-size: .78rem; color: var(--suave); }
.acciones { display: flex; flex-wrap: wrap; gap: .5rem; }
.marca-color { display: inline-block; width: .9rem; height: .9rem; border-radius: 50%; border: 1px solid var(--linea); vertical-align: -0.1em; }
.nota { font-size: .82rem; color: var(--suave); margin: 0; }

/* trabajos */
.trabajos { display: grid; gap: .5rem; }
.trabajo { background: var(--tarjeta); border: 1px solid var(--linea); border-radius: var(--radio); padding: .6rem .9rem; display: grid; gap: .3rem; }
.trabajo-cab { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.trabajo pre { margin: 0; white-space: pre-wrap; word-break: break-word; font-size: .8rem; color: var(--suave); max-height: 9rem; overflow: auto; }
.girando { animation: gira 1s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .girando { animation: none; } }

/* dialogos */
dialog { border: 1px solid var(--linea); border-radius: 14px; background: var(--tarjeta); color: var(--texto); padding: 0; width: min(560px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); }
dialog::backdrop { background: rgba(10, 14, 20, .55); }
.dlg-cab { padding: 1rem 1.25rem .5rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.dlg-cab h3 { margin: 0; font-size: 1.1rem; }
.dlg-cuerpo { padding: .25rem 1.25rem 1rem; display: grid; gap: .25rem; overflow: auto; max-height: calc(100vh - 12rem); }
.dlg-pie { padding: .75rem 1.25rem 1.1rem; display: flex; justify-content: flex-end; gap: .5rem; border-top: 1px solid var(--linea); flex-wrap: wrap; }
.dos-col { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
@media (max-width: 560px) { .dos-col { grid-template-columns: 1fr; } }
.fila-copiar { display: flex; gap: .4rem; align-items: center; }
.fila-copiar code { flex: 1; background: var(--fondo); border: 1px solid var(--linea); border-radius: 8px; padding: .45rem .6rem; overflow-x: auto; white-space: nowrap; font-size: .9rem; }
.lista-dom { list-style: none; padding: 0; margin: .25rem 0; display: grid; gap: .35rem; }
.lista-dom li { display: flex; justify-content: space-between; align-items: center; gap: .5rem; border: 1px solid var(--linea); border-radius: 8px; padding: .35rem .6rem; }
.progreso { background: var(--fondo); border: 1px solid var(--linea); border-radius: 8px; padding: .6rem .8rem; font-size: .82rem; white-space: pre-wrap; max-height: 12rem; overflow: auto; min-height: 3rem; }

/* avisos */
.avisos { position: fixed; right: 1rem; bottom: 1rem; display: grid; gap: .5rem; z-index: 50; max-width: min(420px, calc(100vw - 2rem)); }
.aviso-flotante { background: var(--texto); color: var(--fondo); padding: .65rem .9rem; border-radius: 10px; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); }
.aviso-flotante.mal { background: var(--mal); color: #fff; }
