:root {
  --bg: #0b0d14; --surface: #12151f; --surface-2: #181c29; --border: #252a3a;
  --text: #eef0f6; --muted: #9aa1b5; --brand: #7c6cff; --brand-2: #28d1c4;
  --ok: #3ddc84; --warn: #febc2e; --bad: #ff5f7a;
  --eatsy: #ff7a45; --stockify: #3dd6a3;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-family: Inter, system-ui, sans-serif; line-height: 1.5; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
a { color: inherit; }
.wrap { width: min(1100px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); margin: 0; }
.small { font-size: .85rem; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.1rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px; border-radius: 999px; border: 0;
  font: inherit; font-weight: 600; font-size: .92rem; color: #fff; cursor: pointer;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn.ghost { background: transparent; border: 1px solid var(--border); }
.btn.ghost:hover { border-color: var(--muted); }
.btn.peligro { background: var(--bad); }
.btn.mini { padding: 6px 12px; font-size: .82rem; }
.btn:focus-visible, input:focus-visible, select:focus-visible, .chip:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; }

label { display: grid; gap: 6px; font-size: .9rem; font-weight: 500; }
input, select { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: #0e1119; color: var(--text); font: inherit; }
.error { color: var(--bad); font-size: .9rem; margin: 0; white-space: pre-line; }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(50% 50% at 50% 30%, rgba(124, 108, 255, .18), transparent 70%), var(--bg); }
.login-card { width: min(380px, 100%); display: grid; gap: 16px; padding: 32px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); }

/* Barra */
.top { position: sticky; top: 0; z-index: 5; background: rgba(11, 13, 20, .85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.top-inner { display: flex; justify-content: space-between; align-items: center; height: 64px; gap: 12px; }
.top-actions { display: flex; gap: 8px; }

.head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin: 32px 0 20px; }
.head h1 { margin: 0 0 4px; font-size: 1.8rem; letter-spacing: -.02em; }
.filtros { display: flex; gap: 6px; }
.chip { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--muted); font: inherit; font-size: .88rem; cursor: pointer; }
.chip.activo { color: var(--text); border-color: var(--brand); background: rgba(124, 108, 255, .12); }

/* Lista */
.lista { display: grid; gap: 12px; padding-bottom: 48px; }
.vacio { text-align: center; padding: 56px 16px; border: 1px dashed var(--border); border-radius: 16px; color: var(--muted); }
.neg { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; padding: 18px 20px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--border); }
.neg-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; color: #fff; }
.neg-ic.eatsy { background: linear-gradient(135deg, #ff7a45, #ffb547); }
.neg-ic.stockify { background: linear-gradient(135deg, #3dd6a3, #2fb5ff); }
.neg h3 { margin: 0; font-size: 1.05rem; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.neg .meta { color: var(--muted); font-size: .86rem; margin-top: 2px; display: flex; gap: 12px; flex-wrap: wrap; }
.neg .meta a { color: var(--brand-2); text-decoration: none; }
.neg .meta a:hover { text-decoration: underline; }
.neg-acc { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.estado { font-size: .75rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; }
.estado.activo { background: rgba(61, 220, 132, .14); color: var(--ok); }
.estado.suspendido { background: rgba(254, 188, 46, .14); color: var(--warn); }
.estado.error { background: rgba(255, 95, 122, .14); color: var(--bad); }
.estado.proceso { background: rgba(124, 108, 255, .16); color: #b3a9ff; }
.estado.proceso::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: gira .8s linear infinite; vertical-align: -1px; }
@keyframes gira { to { transform: rotate(360deg); } }
.tag { font-size: .72rem; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.neg .err { grid-column: 1 / -1; margin: 0; padding: 10px 12px; border-radius: 10px; background: rgba(255, 95, 122, .08);
  color: #ffb3c0; font-size: .82rem; white-space: pre-wrap; font-family: ui-monospace, Consolas, monospace; }

/* Diálogos */
dialog { width: min(560px, 100% - 32px); padding: 0; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); color: var(--text); }
dialog::backdrop { background: rgba(5, 6, 10, .7); backdrop-filter: blur(3px); }
dialog form { display: grid; gap: 16px; padding: 28px; }
dialog h2 { margin: 0; font-size: 1.35rem; }
.productos { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.productos legend { font-size: .9rem; font-weight: 500; margin-bottom: 6px; }
.prod { position: relative; display: block; cursor: pointer; }
.prod input { position: absolute; opacity: 0; }
.prod span { display: grid; padding: 14px; border-radius: 12px; border: 1px solid var(--border); background: #0e1119; }
.prod small { color: var(--muted); }
.prod.eatsy input:checked + span { border-color: var(--eatsy); box-shadow: 0 0 0 1px var(--eatsy) inset; }
.prod.stockify input:checked + span { border-color: var(--stockify); box-shadow: 0 0 0 1px var(--stockify) inset; }
.prod input:focus-visible + span { outline: 2px solid var(--brand-2); outline-offset: 2px; }
.sub { display: flex; gap: 8px; align-items: center; }
.sub span { color: var(--muted); white-space: nowrap; }
.dos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.acciones { display: flex; justify-content: flex-end; gap: 8px; }
code { color: var(--brand-2); font-family: ui-monospace, Consolas, monospace; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); padding: 12px 18px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); z-index: 20; max-width: calc(100% - 32px); }

@media (max-width: 700px) {
  .neg { grid-template-columns: auto 1fr; }
  .neg-acc { grid-column: 1 / -1; justify-content: flex-start; }
  .dos, .productos { grid-template-columns: 1fr; }
  .top-actions .ghost { display: none; }
}
