/* ═══════════════════════════════════════════════════════════════
   admin.css — Panel de administración FA Soluciones Informáticas
   ═══════════════════════════════════════════════════════════════ */
body{background:var(--blue-50)}
[data-ico]{display:inline-flex}

/* ── Acceso ── */
.auth-screen{min-height:100vh;display:grid;place-items:center;padding:1.5rem;background:radial-gradient(900px 500px at 50% -10%,rgba(8,100,255,.22),transparent 60%),var(--grad-electric)}
.auth-card{width:min(420px,100%);background:#fff;border-radius:var(--r-lg);padding:2rem;box-shadow:0 30px 80px rgba(0,0,0,.3);text-align:center}
.auth-card img{width:150px;height:auto;margin:0 auto .6rem}
.auth-card h1{font-size:1.7rem;margin-bottom:.3rem}
.auth-card>p{font-size:.88rem;margin-bottom:1.2rem}
.auth-card form{text-align:left}
.back-link{display:inline-block;margin-top:1rem;font-size:.84rem;color:var(--blue);font-weight:600}

/* ── Layout ── */
.app{display:grid;grid-template-columns:250px 1fr;min-height:100vh}
.side{position:sticky;top:0;height:100vh;background:var(--grad-electric);color:#dbe7ff;display:flex;flex-direction:column;padding:1.2rem .9rem}
.side-logo img{width:150px;height:auto;margin:0 auto 1.5rem}
.side-nav{display:flex;flex-direction:column;gap:.25rem;flex:1}
.side-nav button,.side-foot a,.side-foot button{display:flex;align-items:center;gap:.7rem;padding:.7rem .85rem;border-radius:12px;font-weight:600;font-size:.9rem;text-align:left;color:#dbe7ff;transition:.2s;width:100%}
.side-nav button:hover,.side-foot a:hover,.side-foot button:hover{background:rgba(255,255,255,.1);color:#fff}
.side-nav button[aria-current=page]{background:#fff;color:var(--navy);box-shadow:0 8px 20px rgba(0,0,0,.2)}
.side-nav .ico{width:20px;height:20px}
.dot-pend{width:9px;height:9px;border-radius:50%;background:#fbbf24;margin-left:auto;box-shadow:0 0 0 3px rgba(251,191,36,.3)}
.side-foot{border-top:1px solid rgba(255,255,255,.15);padding-top:.8rem;display:flex;flex-direction:column;gap:.2rem}
.main{min-width:0;padding:0 1.6rem 3rem}
.topbar-a{position:sticky;top:0;z-index:20;display:flex;align-items:center;gap:1rem;padding:1rem 0;background:rgba(244,247,255,.92);backdrop-filter:blur(10px)}
.page-t{font-family:var(--f-head);font-weight:900;color:var(--navy);font-size:1.5rem}
.menu-btn{display:none}
.pub-state{margin-left:auto;display:flex;align-items:center;gap:.6rem;font-size:.82rem;font-weight:600}
.pub-state .chip-s{padding:.35rem .7rem;border-radius:99px;background:#dcfce7;color:#166534}
.pub-state .chip-s.pend{background:#fef3c7;color:#92400e}
.sec-a{animation:tIn .2s}

/* ── Tarjetas ── */
.card-a{background:#fff;border:1.5px solid var(--line);border-radius:var(--r);padding:1.3rem;margin-bottom:1rem}
.card-t{font-family:var(--f-head);font-weight:800;color:var(--navy);font-size:1.05rem;margin-bottom:.9rem}
.stats{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:1rem;margin-bottom:1rem}
.stat{background:#fff;border:1.5px solid var(--line);border-radius:var(--r);padding:1.1rem;display:flex;gap:.9rem;align-items:center;text-align:left;transition:.2s}
button.stat:hover{border-color:var(--blue);transform:translateY(-2px)}
.stat .circle-ico{width:46px;height:46px;box-shadow:none}
.stat .circle-ico .ico{width:22px;height:22px}
.stat b{display:block;font-family:var(--f-head);font-weight:900;font-size:1.6rem;color:var(--navy);line-height:1}
.stat small{color:var(--muted);font-size:.8rem;font-weight:600}
.stat.warn .circle-ico{background:linear-gradient(135deg,#f59e0b,#d97706)}
.steps-help{display:grid;grid-template-columns:repeat(3,1fr);gap:1rem}
.steps-help li{background:var(--blue-50);border-radius:12px;padding:1rem;font-size:.86rem}
.steps-help b{display:block;color:var(--navy);margin-bottom:.3rem}
.steps-help .n{display:inline-grid;place-items:center;width:24px;height:24px;border-radius:8px;background:var(--navy);color:#fff;font-size:.75rem;font-weight:800;margin-right:.4rem}

/* ── Toolbar / tabla ── */
.toolbar{display:flex;gap:.6rem;flex-wrap:wrap;align-items:center;margin-bottom:.8rem}
.tb-search{flex:1;min-width:220px;display:flex;align-items:center;gap:.5rem;background:#fff;border:1.5px solid var(--line);border-radius:12px;padding:0 .8rem;color:var(--muted)}
.tb-search:focus-within{border-color:var(--blue)}
.tb-search input{flex:1;border:0;outline:none;padding:.7rem 0;background:none}
.toolbar select{padding:.7rem .8rem;border-radius:12px;border:1.5px solid var(--line);background:#fff}
.count{font-size:.82rem;color:var(--muted);margin-bottom:.6rem}
.table-wrap{background:#fff;border:1.5px solid var(--line);border-radius:var(--r);overflow:auto}
.tbl{width:100%;border-collapse:collapse;font-size:.87rem}
.tbl th{position:sticky;top:0;background:#fff;text-align:left;font-size:.72rem;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);padding:.7rem .8rem;border-bottom:1.5px solid var(--line);z-index:1}
.tbl td{padding:.55rem .8rem;border-bottom:1px solid var(--line);vertical-align:middle}
.tbl tr:last-child td{border-bottom:0}
.tbl tr:hover td{background:#fafcff}
.tbl tr.off td{opacity:.55}
.t-thumb{width:52px;height:52px;border-radius:10px;overflow:hidden;border:1px solid var(--line);display:grid;place-items:center;position:relative}
.t-thumb.ph .ico{width:55%;height:55%}
.t-thumb .n{position:absolute;right:2px;bottom:2px;background:var(--navy);color:#fff;font-size:.6rem;font-weight:800;padding:0 .3rem;border-radius:5px}
.t-name b{display:block;font-weight:700;color:var(--ink);line-height:1.3;cursor:pointer}
.t-name b:hover{color:var(--blue)}
.t-name small{color:var(--muted);font-size:.75rem}
.t-price{width:130px;padding:.45rem .6rem;border-radius:9px;border:1.5px solid transparent;background:var(--blue-50);font-weight:700;color:var(--navy)}
.t-price:focus{outline:none;border-color:var(--blue);background:#fff}
.t-stock{padding:.4rem .5rem;border-radius:9px;border:1.5px solid var(--line);background:#fff;font-size:.8rem}
.star{font-size:1.2rem;color:#cbd5e1;line-height:1}
.star[aria-pressed=true]{color:#f59e0b}
.row-acts{display:flex;gap:.3rem;justify-content:flex-end}
.row-acts .icon-btn{width:34px;height:34px;border-radius:9px}
.row-acts .icon-btn .ico{width:16px;height:16px}
.icon-btn.danger:hover{border-color:var(--danger);color:var(--danger)}

/* ── Editor de producto ── */
.editor{width:min(1040px,96vw)}
.ed-grid{display:grid;grid-template-columns:1fr 1.15fr;gap:1.5rem;align-items:start}
.drop{border:2px dashed var(--blue-100);border-radius:var(--r);padding:1.4rem;text-align:center;background:var(--blue-50);cursor:pointer;transition:.2s;color:var(--navy)}
.drop:hover,.drop.over{border-color:var(--blue);background:#eaf1ff}
.drop .circle-ico{margin:0 auto .7rem}
.drop b{display:block}
.drop small{color:var(--muted);font-size:.78rem}
.imgs{display:grid;grid-template-columns:repeat(auto-fill,minmax(105px,1fr));gap:.6rem;margin-top:.8rem}
.img-it{position:relative;aspect-ratio:1;border-radius:12px;overflow:hidden;border:2px solid var(--line);background:#fff;cursor:grab}
.img-it:first-child{border-color:var(--blue)}
.img-it:first-child::after{content:'Principal';position:absolute;left:6px;top:6px;background:var(--blue);color:#fff;font-size:.62rem;font-weight:800;padding:.1rem .4rem;border-radius:6px;text-transform:uppercase}
.img-it.dragging{opacity:.4}
.img-it.drop-target{border-color:var(--ok)}
.img-it img{width:100%;height:100%;object-fit:cover}
.img-acts{position:absolute;inset:auto 0 0 0;display:flex;justify-content:center;gap:.25rem;padding:.3rem;background:linear-gradient(transparent,rgba(7,28,96,.75));opacity:0;transition:.2s}
.img-it:hover .img-acts,.img-it:focus-within .img-acts{opacity:1}
.img-acts button{width:26px;height:26px;border-radius:7px;background:#fff;color:var(--navy);display:grid;place-items:center;font-size:.75rem;font-weight:800}
.img-acts button .ico{width:14px;height:14px}
.img-acts button.del:hover{background:#fee2e2;color:var(--danger)}
.processing{display:flex;align-items:center;gap:.5rem;color:var(--muted);font-size:.82rem;margin-top:.6rem}
.spin{width:16px;height:16px;border:2px solid var(--blue-100);border-top-color:var(--blue);border-radius:50%;animation:spin .8s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.ed-sec{border-top:1.5px dashed var(--line);margin-top:.8rem;padding-top:.9rem}
.ed-sec h3{font-size:.8rem;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);margin-bottom:.6rem}
.grid3{display:grid;grid-template-columns:repeat(3,1fr);gap:0 .7rem}
.toggles{display:flex;gap:1.4rem;flex-wrap:wrap;margin:.3rem 0 .6rem}
.toggles label{display:flex;align-items:center;gap:.5rem;font-size:.88rem;font-weight:600;cursor:pointer;color:var(--navy)}
.var-row{display:grid;grid-template-columns:1fr 2fr 34px;gap:.5rem;margin-bottom:.5rem}
.var-row input{padding:.55rem .7rem;border-radius:9px;border:1.5px solid var(--line);outline:none;min-width:0}
.var-row input:focus{border-color:var(--blue)}
.ed-foot{position:sticky;bottom:0;display:flex;justify-content:space-between;gap:.6rem;flex-wrap:wrap;padding:1rem 1.6rem;background:#fff;border-top:1px solid var(--line)}
.ed-foot>div{display:flex;gap:.5rem}

/* ── Categorías ── */
.inline-form{display:flex;gap:.6rem;align-items:end;margin-bottom:1rem}
.cat-list li{display:flex;align-items:center;gap:.7rem;padding:.6rem .4rem;border-bottom:1px solid var(--line)}
.cat-list li:last-child{border-bottom:0}
.cat-list .ci{width:36px;height:36px;border-radius:10px;background:var(--blue-50);color:var(--blue);display:grid;place-items:center}
.cat-list .ci .ico{width:20px;height:20px}
.cat-list b{flex:1;font-weight:700;color:var(--navy)}
.cat-list small{color:var(--muted);font-size:.78rem;min-width:90px}
.cat-list .icon-btn{width:32px;height:32px;border-radius:9px}
.cat-list .icon-btn .ico{width:15px;height:15px}

/* ── Reparaciones ── */
.seg{display:flex;background:#fff;border:1.5px solid var(--line);border-radius:12px;padding:.2rem}
.seg button{padding:.5rem .8rem;border-radius:9px;font-size:.84rem;font-weight:700;color:var(--muted)}
.seg button[aria-pressed=true]{background:var(--navy);color:#fff}
.repairs{display:grid;grid-template-columns:repeat(auto-fill,minmax(330px,1fr));gap:1rem}
.rep{background:#fff;border:1.5px solid var(--line);border-radius:var(--r);padding:1rem;display:flex;flex-direction:column;gap:.6rem}
.rep-h{display:flex;justify-content:space-between;gap:.5rem;align-items:start}
.rep-code{font-family:var(--f-head);font-weight:900;color:var(--blue);letter-spacing:.04em;cursor:copy}
.rep-h b{display:block;color:var(--navy)}
.rep small{color:var(--muted);font-size:.78rem}
.status{font-size:.7rem;font-weight:800;padding:.28rem .65rem;border-radius:99px;background:#dbeafe;color:#1e40af;white-space:nowrap}
.status.ready{background:#dcfce7;color:#166534}.status.wait{background:#fef3c7;color:#92400e}.status.done{background:#e5e7eb;color:#374151}
.rep-steps{display:flex;gap:.25rem}
.rep-steps button{flex:1;height:8px;border-radius:99px;background:var(--blue-100);padding:0}
.rep-steps button.on{background:var(--blue)}
.rep-steps button:hover{background:var(--navy)}
.rep-note{font-size:.84rem;background:var(--blue-50);border-radius:10px;padding:.55rem .7rem}
.rep-acts{display:flex;gap:.4rem;flex-wrap:wrap;margin-top:auto}
.empty{grid-column:1/-1;text-align:center;padding:3rem 1rem;color:var(--muted);background:#fff;border:1.5px dashed var(--line);border-radius:var(--r)}
.empty .circle-ico{margin:0 auto 1rem}

/* ── Configuración ── */
.cfg{display:grid;grid-template-columns:1fr 1fr;gap:1rem;align-items:start}
.cfg .card-a{margin:0}
.hours-grid{display:grid;grid-template-columns:110px 1fr;gap:.4rem .8rem;align-items:center}
.hours-grid label{font-weight:700;font-size:.85rem;color:var(--navy)}
.hours-grid input{padding:.55rem .7rem;border-radius:9px;border:1.5px solid var(--line);outline:none}
.hours-grid input:focus{border-color:var(--blue)}
.opt-cards{display:flex;flex-direction:column;gap:.5rem}
.opt-cards label{display:flex;gap:.6rem;align-items:flex-start;border:1.5px solid var(--line);border-radius:12px;padding:.75rem;cursor:pointer;font-size:.88rem}
.opt-cards label:has(input:checked){border-color:var(--blue);background:var(--blue-50)}
.opt-cards input{accent-color:var(--blue);margin-top:.2rem}
.opt-cards b{display:block;color:var(--navy)}
.opt-cards small{color:var(--muted);font-size:.78rem}
.cfg-save{grid-column:1/-1;display:flex;justify-content:flex-end}
.cfg-cred{max-width:720px;margin-top:1rem}

/* ── Publicar ── */
.pub-grid{display:grid;grid-template-columns:1.2fr 1fr;gap:1rem;align-items:start}
.pub-status{display:flex;align-items:center;gap:1rem;padding:1rem;border-radius:14px;background:#ecfdf5;color:#065f46;margin-bottom:1rem}
.pub-status.pend{background:#fffbeb;color:#92400e}
.pub-status b{display:block;font-size:1rem}
.pub-status small{font-size:.8rem}
.pub-actions{display:flex;flex-direction:column;gap:.6rem}
.pub-actions .btn{justify-content:flex-start}
.help{font-size:.85rem;color:var(--muted)}
.help li{margin:.35rem 0 .35rem 1.2rem;list-style:decimal}
.help code{background:var(--blue-50);padding:.05rem .35rem;border-radius:5px;color:var(--navy);font-size:.82rem}

@media(max-width:980px){
  .app{grid-template-columns:1fr}
  .side{position:fixed;left:0;top:0;z-index:100;width:260px;transform:translateX(-100%);transition:transform .25s}
  .side.open{transform:none;box-shadow:20px 0 60px rgba(0,0,0,.3)}
  .menu-btn{display:inline-grid}
  .main{padding:0 1rem 3rem}
  .ed-grid,.cfg,.pub-grid,.steps-help{grid-template-columns:1fr}
  .grid3{grid-template-columns:1fr 1fr}
}
@media(max-width:600px){.tbl .hide-sm{display:none}.pub-state{display:none}.repairs{grid-template-columns:1fr}}
@media print{.app,.toasts{display:none!important}}
