/* =========================================================
   ZYRION Admin — plain, functional, Shopify-flavoured.
   No hero art, no animations: forms, tables, buttons.
   ========================================================= */
:root{
  --ink:#101012; --body:#4c4c52; --muted:#74747c;
  --line:#e4e4e7; --bg:#f6f6f7; --white:#fff;
  --accent:#8d7ac9; --danger:#c0392b;
  --r:10px;
}
*{ box-sizing:border-box; }
body{
  margin:0; background:var(--bg); color:var(--ink);
  font:15px/1.55 "Manrope", "Segoe UI", Arial, sans-serif;
}
img{ max-width:100%; display:block; }

.top{
  position:sticky; top:0; z-index:10;
  display:flex; align-items:center; justify-content:space-between;
  padding:12px 20px; background:var(--ink); color:#fff;
}
.top__brand{ display:flex; align-items:center; gap:10px; font-size:15px; }
.top__store{ color:#fff; font-weight:700; font-size:13.5px; text-decoration:none; }
.top__store:hover{ text-decoration:underline; }

.shell{ display:grid; grid-template-columns:210px 1fr; gap:22px; max-width:1180px; margin:22px auto; padding:0 18px; }
.side{ display:flex; flex-direction:column; gap:4px; align-self:start; position:sticky; top:66px; }
.side__link{
  text-align:left; padding:10px 14px; border:0; border-radius:8px;
  background:none; font:inherit; font-weight:600; color:var(--body); cursor:pointer;
}
.side__link:hover{ background:#ececee; }
.side__link.is-on{ background:var(--white); color:var(--ink); box-shadow:0 1px 3px rgba(0,0,0,.08); font-weight:800; }

.panel{ display:none; }
.panel.is-on{ display:block; }
.panel h1{ margin:4px 0 6px; font-size:1.5rem; }
.hint{ margin:0 0 18px; color:var(--muted); font-size:13.5px; }

.card{
  background:var(--white); border:1px solid var(--line); border-radius:var(--r);
  padding:20px; margin-bottom:20px;
  overflow-x:auto;   /* wide tables (inventory QR + barcode) pan inside the card */
}
.card h2{ margin:0 0 14px; font-size:1.05rem; }

label{ display:block; font-size:13px; font-weight:700; color:var(--body); margin-bottom:12px; }
input, select, textarea{
  display:block; width:100%; margin-top:5px;
  padding:9px 11px; font:inherit; font-size:14px; color:var(--ink);
  background:var(--white); border:1px solid var(--line); border-radius:8px;
}
input:focus, select:focus, textarea:focus{ outline:2px solid var(--accent); outline-offset:0; border-color:transparent; }
textarea{ resize:vertical; }

.grid2{ display:grid; grid-template-columns:1fr 1fr; gap:0 16px; }
.grid3{ display:grid; grid-template-columns:1fr 1fr 1fr; gap:0 16px; }

.fieldset{ border-top:1px solid var(--line); padding-top:14px; margin:6px 0 14px; }
.fieldset__head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; }
.fieldset__head h3{ margin:0; font-size:14px; }

.coloradd{ display:flex; gap:8px; align-items:center; }
.coloradd input{ margin-top:0; width:220px; }
.vrow{
  display:grid; grid-template-columns:18px 90px 1fr 1.2fr 36px;
  gap:8px; align-items:center; margin-bottom:10px;
}
.vrow input{ margin-top:0; }
.vrow input[type="file"]{ padding:6px; font-size:12.5px; }
.vdot{ width:16px; height:16px; border-radius:50%; border:1px solid rgba(16,16,18,.2); }
.vrow b{ font-size:13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
/* the colour's photo strip — one thumb per photo, ✕ to remove */
.vthumbs{ grid-column:1/-1; display:flex; flex-wrap:wrap; gap:8px; }
.vthumbs:empty{ display:none; }
.vthumbs span{
  position:relative; width:64px; height:54px; border:1px solid var(--line); border-radius:7px;
  background:#fafafa; display:grid; place-items:center; overflow:hidden;
}
.vthumbs img{ max-width:100%; max-height:100%; object-fit:contain; }
.vthumbs button{
  position:absolute; top:1px; right:1px; width:24px; height:24px; line-height:1;
  border:0; border-radius:50%; background:rgba(16,16,18,.75); color:#fff; font-size:12px; cursor:pointer;
}
.vrow .vx{
  border:1px solid var(--line); background:var(--white); border-radius:8px;
  height:34px; font-size:14px; color:var(--muted); cursor:pointer;
}
.vrow .vx:hover{ color:var(--danger); border-color:var(--danger); }
@media (max-width:820px){
  .vrow{ grid-template-columns:18px 1fr 1fr 36px; }
  .vrow input[type="file"]{ display:none; }
}

/* PC build part rows: type · our-product · name · link · remove */
.partrow{
  display:grid; grid-template-columns:110px 180px 1.1fr 1.1fr 92px 36px;
  gap:8px; align-items:center; margin-bottom:8px;
}
/* precio a mano: para las tiendas que bloquean la lectura automatica */
.partrow input[data-pprice]{ text-align:right; }
.partrow input, .partrow select{ margin-top:0; }
.partrow button{
  border:1px solid var(--line); background:var(--white); border-radius:8px;
  height:34px; font-size:14px; color:var(--muted); cursor:pointer;
}
.partrow button:hover{ color:var(--danger); border-color:var(--danger); }
/* products page head + the form's own page */
.pagehead{
  display:flex; align-items:center; justify-content:space-between;
  gap:14px; flex-wrap:wrap;
}
.pagehead h1{ margin:0; }
.backlink{
  border:0; background:none; padding:0; margin:0 0 16px;
  font:inherit; font-size:14px; font-weight:800; color:var(--body); cursor:pointer;
}
.backlink:hover{ color:var(--ink); }

/* edit mode: banner above the form + per-row Edit button */
.editbar{
  background:#fdf4da; border:1px solid #eadfb8; border-radius:8px;
  padding:10px 14px; margin-bottom:16px; font-size:13.5px;
  display:flex; align-items:center; gap:10px; flex-wrap:wrap;
}
.editbar .btn{ margin-left:auto; }
.editbtn{
  border:1px solid var(--line); background:var(--white); border-radius:7px;
  padding:5px 12px; font-size:12.5px; font-weight:700; cursor:pointer;
}
.editbtn:hover{ border-color:var(--ink); }

/* remove-subcategory ✕ inside the categories table */
.subdel{
  border:0; background:none; color:var(--muted); cursor:pointer;
  font-size:11px; padding:2px 4px; vertical-align:middle;
}
.subdel:hover{ color:var(--danger); }
@media (max-width:820px){
  /* boxed rows: without the border the 9 wrapped rows read as one grid
     and the ✕ sits closer to the NEXT row's fields than to its own */
  .partrow{
    grid-template-columns:1fr 1fr;
    border:1px solid var(--line); border-radius:8px;
    padding:10px; margin-bottom:12px;
  }
  .partrow button{ justify-self:end; width:44px; }
}

/* inventory table: QR, barcode and quick stock adjust */
.inv-qr svg{ width:54px; height:54px; display:block; }
.inv-bar svg{ max-width:130px; }
.inv-qty{ white-space:nowrap; }
.inv-qty button{
  width:26px; height:26px; border:1px solid var(--line); background:var(--white);
  border-radius:7px; font-size:14px; cursor:pointer; vertical-align:middle;
}
.inv-qty button:hover{ border-color:var(--ink); }
.inv-qty b{ display:inline-block; min-width:28px; text-align:center; }

.specrow{ display:grid; grid-template-columns:1fr 1.4fr 36px; gap:8px; margin-bottom:8px; }
.specrow input{ margin-top:0; }
.specrow button{
  border:1px solid var(--line); background:var(--white); border-radius:8px;
  font-size:15px; color:var(--muted); cursor:pointer;
}
.specrow button:hover{ color:var(--danger); border-color:var(--danger); }

.filelab input{ padding:7px; }
.thumbs{ display:flex; flex-wrap:wrap; gap:8px; margin-top:4px; }
.thumbs span{
  position:relative; width:74px; height:74px; border:1px solid var(--line); border-radius:8px;
  background:#fafafa; display:grid; place-items:center; overflow:hidden;
}
.thumbs img{ max-width:100%; max-height:100%; object-fit:contain; }
.thumbs button{
  position:absolute; top:2px; right:2px; width:20px; height:20px; line-height:1;
  border:0; border-radius:50%; background:rgba(16,16,18,.75); color:#fff; font-size:11px; cursor:pointer;
}

.btn{
  display:inline-block; padding:10px 18px; border:0; border-radius:8px;
  background:var(--ink); color:#fff; font:inherit; font-size:14px; font-weight:700; cursor:pointer;
}
.btn:hover{ background:#2b2b31; }
.btn--ghost{ background:var(--white); color:var(--ink); border:1px solid var(--line); }
.btn--ghost:hover{ background:#f1f1f3; }
.btn--danger{ background:var(--white); color:var(--danger); border:1px solid var(--danger); }
.btn--danger:hover{ background:#fdf1ef; }
.btn--sm{ padding:6px 12px; font-size:13px; }

.actions{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.actions--sticky{
  position:sticky; bottom:0; padding:12px 0; background:linear-gradient(transparent, var(--bg) 30%);
}
.msg{ font-size:13px; font-weight:700; color:var(--accent); }

.table{ width:100%; border-collapse:collapse; font-size:14px; }
.table th{
  text-align:left; font-size:11.5px; text-transform:uppercase; letter-spacing:.06em;
  color:var(--muted); padding:8px 10px; border-bottom:1px solid var(--line);
}
.table td{ padding:9px 10px; border-bottom:1px solid var(--line); vertical-align:middle; }
.table img{ width:44px; height:44px; object-fit:contain; }
.table .del{
  border:1px solid var(--line); background:var(--white); border-radius:7px;
  padding:5px 10px; font-size:12.5px; font-weight:700; color:var(--danger); cursor:pointer;
}
.table .del:hover{ border-color:var(--danger); }

/* editor de slides / promos */
.item{
  background:var(--white); border:1px solid var(--line); border-radius:var(--r);
  padding:18px; margin-bottom:14px;
}
.item__head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; }
.item__head b{ font-size:14px; }
.item__preview{
  width:100%; max-width:340px; aspect-ratio:15/4; object-fit:cover;
  border:1px solid var(--line); border-radius:8px; background:#fafafa; margin-bottom:10px;
}
.item__preview--card{ aspect-ratio:4/3; max-width:150px; object-fit:contain; }

.toast{
  position:fixed; left:50%; bottom:20px; transform:translateX(-50%) translateY(80px);
  background:var(--ink); color:#fff; padding:11px 20px; border-radius:999px;
  font-size:14px; font-weight:700; opacity:0; transition:.3s; pointer-events:none; z-index:50;
}
.toast.is-on{ opacity:1; transform:translateX(-50%); }

@media (max-width:820px){
  .shell{ grid-template-columns:1fr; }
  .side{ position:static; flex-direction:row; flex-wrap:wrap; }
  .grid2, .grid3{ grid-template-columns:1fr; }
}

/* =========================================================
   FACELIFT — capa visual: sidebar con iconos, statbar,
   tablas y tarjetas pulidas. Solo aspecto, cero lógica.
   ========================================================= */
body{ background:#f3f4f6; }

.top{ padding:13px 22px; background:linear-gradient(120deg,#101012,#1d1d24); }
.top__brand b{ letter-spacing:.01em; }
.top__brand::after{
  content:"console"; margin-left:2px; padding:3px 9px; border-radius:999px;
  background:rgba(255,255,255,.12); font-size:10.5px; font-weight:800;
  letter-spacing:.08em; text-transform:uppercase; color:rgba(255,255,255,.75);
}
.top__store{
  padding:8px 16px; border-radius:999px; background:rgba(255,255,255,.1);
  border:1px solid rgba(255,255,255,.18); transition:background .2s;
}
.top__store:hover{ background:rgba(255,255,255,.2); text-decoration:none; }

.side__link{
  display:flex; align-items:center; gap:11px;
  padding:11px 14px; border-radius:10px; position:relative;
}
.side__link svg{
  width:18px; height:18px; flex:0 0 auto;
  fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round;
  opacity:.75;
}
.side__link.is-on{
  background:var(--white); color:var(--ink);
  box-shadow:0 1px 4px rgba(0,0,0,.08), inset 3px 0 0 var(--accent);
}
.side__link.is-on svg{ opacity:1; stroke-width:2; }

.statbar{
  display:grid; grid-template-columns:repeat(5,1fr); gap:12px; margin-bottom:20px;
}
.stat{
  background:var(--white); border:1px solid var(--line); border-radius:12px;
  padding:12px 16px; display:grid; gap:1px;
}
.stat b{ font-size:22px; font-weight:800; letter-spacing:-.02em; }
.stat span{ font-size:11.5px; font-weight:700; letter-spacing:.05em; text-transform:uppercase; color:var(--muted); }

.card{ border-radius:14px; box-shadow:0 1px 3px rgba(16,16,18,.05); }
.card h2{ font-size:1.02rem; letter-spacing:-.01em; }

.table th{ background:#fafafb; padding:9px 10px; }
.table tbody tr{ transition:background .15s; }
.table tbody tr:hover{ background:#fafafb; }
.table td{ border-bottom:1px solid #efeff2; }

.btn{ border-radius:9px; transition:background .2s, transform .15s, box-shadow .2s; }
.btn:hover{ transform:translateY(-1px); box-shadow:0 4px 10px rgba(16,16,18,.15); }
.btn--ghost:hover, .btn--danger:hover{ box-shadow:0 3px 8px rgba(16,16,18,.08); }
.table .del{ transition:all .15s; }

.panel h1{ font-size:1.45rem; letter-spacing:-.02em; }
.hint{ line-height:1.55; }
.hint b{ color:var(--ink); }

input:focus, select:focus, textarea:focus{ outline-color:var(--accent); }

@media (max-width:900px){
  .statbar{ grid-template-columns:repeat(2,1fr); }
  .side__link{ padding:9px 12px; }
}

/* =========================================================
   BILLING — tabla de impuesto y envio por estado
   ========================================================= */
/* 51 filas: se hace scroll dentro de la tarjeta en vez de estirar
   la pagina, y la cabecera se queda fija al desplazar */
.tablewrap{ max-height:min(60vh, 620px); overflow:auto; border:1px solid var(--line); border-radius:10px; }
.tablewrap .table th{ position:sticky; top:0; z-index:1; }
.tablewrap .table td input{ width:100%; margin:0; }
.muted{ color:var(--muted); }
.pill{
  display:inline-block; padding:2px 9px; border-radius:999px;
  font-size:11px; font-weight:800; letter-spacing:.03em;
}
.pill--ok{ background:#e7f6ec; color:#1e7a41; }

/* ---- coste y margen dentro del formulario de producto ---- */
.costbox{ margin-top:16px; padding-top:16px; border-top:1px solid var(--line); }
.costbox__head{ display:flex; align-items:flex-start; justify-content:space-between; gap:16px; }
.costbox__head h3{ margin:0; font-size:.98rem; }
.costbox__tax{ display:flex; align-items:center; gap:10px; margin:12px 0 0; font-size:13px; font-weight:700; }
.costbox__tax input{ width:100px; margin:0; }
.costbox__tax .hint{ margin:0; font-weight:600; }
.costbox__table{ margin-top:14px; }
.costbox__miss td{ opacity:.65; }
.costbox__sum{ margin:14px 0 0; display:grid; gap:2px; max-width:420px; }
.costbox__sum div{ display:flex; align-items:baseline; justify-content:space-between; gap:16px; padding:5px 0; }
.costbox__sum dt{ font-size:13px; color:var(--muted); }
.costbox__sum dd{ margin:0; font-size:14px; font-weight:700; }
.costbox__sum--strong{ border-top:1px solid var(--line); }
.costbox__sum--strong dt{ color:var(--ink); font-weight:700; }
.costbox__sum--strong dd{ font-size:16px; }
.costbox__sum .is-good dd{ color:#1e7a41; }
.costbox__sum .is-bad dd{ color:var(--danger); }
.costbox__sum small{ font-weight:600; color:var(--muted); }
.costbox__warn{ margin-top:10px; color:var(--danger); }
