:root{--adm-bg:#f5f7fb;--adm-panel:rgba(255,255,255,.9);--adm-strong:#fff;--adm-text:#0f172a;--adm-muted:#64748b;--adm-border:rgba(15,23,42,.1);--adm-primary:#4f46e5;--adm-primary2:#7c3aed;--adm-radius:18px;--adm-shadow:0 16px 45px rgba(15,23,42,.08)}
@media(prefers-color-scheme:dark){:root{--adm-bg:#070b16;--adm-panel:rgba(15,23,42,.82);--adm-strong:#111827;--adm-text:#e5e7eb;--adm-muted:#94a3b8;--adm-border:rgba(226,232,240,.12);--adm-shadow:0 16px 45px rgba(0,0,0,.32)}}
*{box-sizing:border-box}body.admin-premium-ui,body{font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif!important;background:radial-gradient(circle at top left,rgba(99,102,241,.13),transparent 32rem),radial-gradient(circle at top right,rgba(124,58,237,.11),transparent 30rem),var(--adm-bg)!important;color:var(--adm-text)!important;letter-spacing:-.01em}a{color:var(--adm-primary);text-decoration:none}a:hover{text-decoration:none;filter:brightness(1.05)}
body.admin-premium-ui main,body.admin-premium-ui .content,body.admin-premium-ui .container,body.admin-premium-ui .admin-content{max-width:1440px;margin-inline:auto;padding:22px}h1,h2,h3{letter-spacing:-.035em;color:var(--adm-text);line-height:1.1}h1{font-size:clamp(1.8rem,3vw,2.7rem);margin:0 0 1rem}.muted,small,.small{color:var(--adm-muted)!important}
nav,aside,.sidebar,.admin-sidebar{background:linear-gradient(180deg,var(--adm-panel),rgba(255,255,255,.62))!important;border:1px solid var(--adm-border)!important;border-radius:22px!important;box-shadow:var(--adm-shadow)!important;backdrop-filter:blur(18px);padding:14px!important}@media(prefers-color-scheme:dark){nav,aside,.sidebar,.admin-sidebar{background:linear-gradient(180deg,rgba(17,24,39,.86),rgba(15,23,42,.68))!important}}
nav a,aside a,.sidebar a,.admin-sidebar a{display:flex;align-items:center;gap:.65rem;border-radius:13px;padding:.72rem .85rem;color:var(--adm-muted)!important;font-weight:650;font-size:.93rem;transition:.18s ease;margin:.1rem 0}nav a:hover,aside a:hover,.sidebar a:hover,.admin-sidebar a:hover,nav a.active,aside a.active,.sidebar a.active{background:linear-gradient(135deg,rgba(79,70,229,.14),rgba(124,58,237,.1));color:var(--adm-text)!important;transform:translateX(2px)}
.card,.box,.panel,.widget,.table-wrap,form:not(.inline):not([class*="search"]){background:var(--adm-panel)!important;border:1px solid var(--adm-border)!important;border-radius:var(--adm-radius)!important;box-shadow:0 8px 24px rgba(15,23,42,.06)!important;backdrop-filter:blur(14px);padding:20px;margin-bottom:18px}.card:hover,.box:hover,.panel:hover,.widget:hover{box-shadow:var(--adm-shadow)!important;transform:translateY(-1px);transition:.2s ease}
table{width:100%;border-collapse:separate!important;border-spacing:0!important;background:transparent!important}.table-wrap{overflow:auto;padding:0!important}th{position:sticky;top:0;background:rgba(248,250,252,.88)!important;color:var(--adm-muted)!important;text-transform:uppercase;font-size:.72rem;letter-spacing:.08em;font-weight:800}@media(prefers-color-scheme:dark){th{background:rgba(15,23,42,.94)!important}}th,td{padding:14px 16px!important;border-bottom:1px solid var(--adm-border)!important;text-align:left}tbody tr:hover{background:rgba(79,70,229,.055)!important}tbody tr:last-child td{border-bottom:0!important}
input,select,textarea{max-width:100%;background:var(--adm-strong)!important;color:var(--adm-text)!important;border:1px solid var(--adm-border)!important;border-radius:13px!important;padding:.72rem .9rem!important;outline:none!important;transition:.18s ease;box-shadow:none!important}textarea{min-height:120px}input:focus,select:focus,textarea:focus{border-color:rgba(79,70,229,.55)!important;box-shadow:0 0 0 4px rgba(79,70,229,.13)!important}
button,.btn,input[type="submit"],input[type="button"],a.button,.button{appearance:none;border:0!important;border-radius:13px!important;background:linear-gradient(135deg,var(--adm-primary),var(--adm-primary2))!important;color:#fff!important;font-weight:750!important;padding:.72rem 1rem!important;box-shadow:0 12px 24px rgba(79,70,229,.24)!important;cursor:pointer;display:inline-flex;align-items:center;gap:.5rem;transition:.18s ease;text-decoration:none!important}button:hover,.btn:hover,input[type="submit"]:hover,a.button:hover{transform:translateY(-1px);box-shadow:0 16px 30px rgba(79,70,229,.30)!important}.secondary,.btn-secondary{background:var(--adm-strong)!important;color:var(--adm-text)!important;border:1px solid var(--adm-border)!important;box-shadow:0 8px 24px rgba(15,23,42,.06)!important}.danger,.btn-danger,button[name*="delete"],button.delete{background:linear-gradient(135deg,#ef4444,#b91c1c)!important}
.badge,.status,[class*="status-"]{display:inline-flex;align-items:center;border-radius:999px;padding:.32rem .62rem;font-size:.76rem;font-weight:800;background:rgba(79,70,229,.12);color:var(--adm-primary)}.notice,.success,.alert-success{background:rgba(22,163,74,.10)!important;border:1px solid rgba(22,163,74,.22)!important;color:#16a34a!important;border-radius:15px!important;padding:12px 14px!important}.error,.alert-danger{background:rgba(220,38,38,.10)!important;border:1px solid rgba(220,38,38,.22)!important;color:#dc2626!important;border-radius:15px!important;padding:12px 14px!important}
.admin-premium-fade{animation:admFade .34s ease both}@keyframes admFade{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}@media(max-width:860px){body.admin-premium-ui main,body.admin-premium-ui .content,body.admin-premium-ui .container,body.admin-premium-ui .admin-content{padding:14px}th,td{padding:11px!important}.card,.box,.panel,.widget,form:not(.inline):not([class*="search"]){padding:15px}}

/* Categorías buscables: mejora UX en edición de producto sin tocar el backend */
.premium-hidden-select{position:absolute!important;left:-9999px!important;width:1px!important;height:1px!important;opacity:0!important;pointer-events:none!important}
.premium-combobox{position:relative;max-width:min(620px,100%);display:block}
.premium-combobox-input{width:100%!important;padding-right:2.75rem!important}
.premium-combobox-clear{position:absolute!important;right:.45rem;top:50%;transform:translateY(-50%)!important;width:2rem;height:2rem;padding:0!important;border-radius:999px!important;background:transparent!important;color:var(--adm-muted)!important;box-shadow:none!important;font-size:1.35rem!important;line-height:1!important;justify-content:center!important}
.premium-combobox-clear:hover{background:rgba(79,70,229,.10)!important;color:var(--adm-text)!important;transform:translateY(-50%)!important;box-shadow:none!important}
.premium-combobox-list{display:none;position:absolute;z-index:9999;left:0;right:0;top:calc(100% + 8px);max-height:320px;overflow:auto;background:var(--adm-strong)!important;border:1px solid var(--adm-border)!important;border-radius:16px!important;box-shadow:0 22px 50px rgba(15,23,42,.20)!important;padding:8px;backdrop-filter:blur(14px)}
.premium-combobox.open .premium-combobox-list{display:block}
.premium-combobox-option{width:100%;justify-content:flex-start!important;text-align:left!important;background:transparent!important;color:var(--adm-text)!important;box-shadow:none!important;border-radius:12px!important;padding:.72rem .82rem!important;font-weight:650!important;white-space:normal!important;line-height:1.25!important}
.premium-combobox-option:hover,.premium-combobox-option.selected{background:linear-gradient(135deg,rgba(79,70,229,.14),rgba(124,58,237,.10))!important;color:var(--adm-text)!important;transform:none!important;box-shadow:none!important}
.premium-combobox-empty{padding:.9rem;color:var(--adm-muted);font-weight:650}

/* Buscador del listado de categorías */
.premium-category-search{display:flex!important;align-items:center;gap:.75rem;flex-wrap:wrap;background:var(--adm-panel)!important;border:1px solid var(--adm-border)!important;border-radius:var(--adm-radius)!important;box-shadow:0 8px 24px rgba(15,23,42,.06)!important;padding:14px!important;margin:0 0 18px!important;backdrop-filter:blur(14px)}
.premium-category-search-label{font-weight:800;color:var(--adm-text);margin-right:.1rem}
.premium-category-search input[type="search"]{min-width:min(430px,100%);flex:1 1 280px!important}
.premium-category-search-clear{display:inline-flex!important}
@media(max-width:640px){.premium-category-search{align-items:stretch}.premium-category-search-label{width:100%}.premium-category-search input[type="search"],.premium-category-search button,.premium-category-search .button{width:100%;justify-content:center}}

/* Botón de unificación de subcategorías pequeñas */
.premium-category-unify{display:block!important;margin:-4px 0 18px!important;background:transparent!important;border:0!important;padding:0!important;box-shadow:none!important}
.premium-category-unify-box{display:flex;align-items:center;justify-content:space-between;gap:1rem;flex-wrap:wrap;background:linear-gradient(135deg,rgba(79,70,229,.10),rgba(124,58,237,.08))!important;border:1px solid rgba(79,70,229,.20)!important;border-radius:var(--adm-radius)!important;box-shadow:0 8px 24px rgba(15,23,42,.06)!important;padding:15px 16px!important;backdrop-filter:blur(14px)}
.premium-category-unify-text{display:flex;flex-direction:column;gap:.18rem;min-width:240px;flex:1 1 420px;color:var(--adm-text)}
.premium-category-unify-text strong{font-size:.98rem;font-weight:900;letter-spacing:-.02em}
.premium-category-unify-text span{font-size:.86rem;color:var(--adm-muted);line-height:1.35}
.premium-category-unify-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;justify-content:flex-end}
.premium-category-unify-button{white-space:nowrap;background:linear-gradient(135deg,#0f172a,#334155)!important;box-shadow:0 12px 24px rgba(15,23,42,.22)!important}
.premium-category-duplicate-button{white-space:nowrap;background:linear-gradient(135deg,#16a34a,#15803d)!important;color:#fff!important;box-shadow:0 12px 24px rgba(22,163,74,.22)!important;border:0!important;border-radius:12px!important;font-weight:850!important}
.premium-category-zero-button{white-space:nowrap;background:linear-gradient(135deg,#dc2626,#991b1b)!important;color:#fff!important;box-shadow:0 12px 24px rgba(220,38,38,.22)!important;border:0!important;border-radius:12px!important;font-weight:800!important}
.premium-category-ai-button{white-space:nowrap;background:linear-gradient(135deg,#7c3aed,#4f46e5)!important;color:#fff!important;box-shadow:0 12px 24px rgba(124,58,237,.24)!important;border:0!important;border-radius:12px!important;font-weight:850!important}
@media(max-width:640px){.premium-category-unify-box{align-items:stretch}.premium-category-unify-actions{width:100%;align-items:stretch}.premium-category-unify-button,.premium-category-duplicate-button,.premium-category-zero-button,.premium-category-ai-button{width:100%;justify-content:center}}

/* Miniaturas de producto en admin: listado, edición y plantilla masiva */
.premium-product-thumb-col{width:74px!important;min-width:74px!important;text-align:center!important}
.premium-product-thumb-cell{width:74px!important;min-width:74px!important;text-align:center!important;vertical-align:middle!important}
.premium-product-thumb{display:inline-flex;align-items:center;justify-content:center;width:58px;height:58px;border-radius:14px;border:1px solid var(--adm-border);background:rgba(148,163,184,.08);overflow:hidden;box-shadow:0 8px 18px rgba(15,23,42,.08)}
.premium-product-thumb img{display:block;width:100%;height:100%;object-fit:contain;background:#fff}
.premium-product-thumb-empty{font-size:.72rem;font-weight:800;color:var(--adm-muted);letter-spacing:.02em}
.premium-product-edit-preview{display:flex;align-items:center;gap:16px;background:var(--adm-panel)!important;border:1px solid var(--adm-border)!important;border-radius:18px!important;box-shadow:0 8px 24px rgba(15,23,42,.06)!important;padding:16px!important;margin:0 0 18px!important;backdrop-filter:blur(14px)}
.premium-product-edit-preview .premium-product-thumb{width:96px;height:96px;border-radius:18px;flex:0 0 auto}
.premium-product-edit-preview-title{display:flex;flex-direction:column;gap:.25rem;color:var(--adm-text);font-weight:900;letter-spacing:-.02em}
.premium-product-edit-preview-title small{font-weight:650;color:var(--adm-muted)!important;letter-spacing:0}
.premium-product-inline-preview{display:flex;align-items:center;gap:12px;margin:.65rem 0 .9rem;padding:10px 12px;border:1px solid var(--adm-border);border-radius:16px;background:rgba(148,163,184,.07)}
.premium-product-inline-preview .premium-product-thumb{width:62px;height:62px;flex:0 0 auto}

/* Plantilla masiva con IA para productos */
.premium-product-ai-template-box{display:flex;align-items:center;justify-content:space-between;gap:1rem;flex-wrap:wrap;background:linear-gradient(135deg,rgba(14,165,233,.10),rgba(124,58,237,.09))!important;border:1px solid rgba(79,70,229,.20)!important;border-radius:var(--adm-radius)!important;box-shadow:0 8px 24px rgba(15,23,42,.06)!important;padding:15px 16px!important;margin:0 0 18px!important;backdrop-filter:blur(14px)}
.premium-product-ai-template-text{display:flex;flex-direction:column;gap:.18rem;min-width:260px;flex:1 1 460px;color:var(--adm-text)}
.premium-product-ai-template-text strong{font-size:.98rem;font-weight:900;letter-spacing:-.02em}
.premium-product-ai-template-text span{font-size:.86rem;color:var(--adm-muted);line-height:1.35}
.premium-product-ai-template-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;justify-content:flex-end}
.premium-product-ai-template-button,.premium-product-ai-link{white-space:nowrap;background:linear-gradient(135deg,#0ea5e9,#7c3aed)!important;color:#fff!important;box-shadow:0 12px 24px rgba(14,165,233,.22)!important;border:0!important;border-radius:12px!important;font-weight:850!important;margin-left:6px!important}
.premium-product-ai-review-button{white-space:nowrap;background:#fff!important;color:#1e3a8a!important;border:1px solid rgba(37,99,235,.22)!important;border-radius:12px!important;font-weight:850!important;padding:.58rem .9rem!important;box-shadow:0 8px 18px rgba(15,23,42,.08)!important}
.premium-product-ai-review-button:hover{background:#eff6ff!important;color:#1d4ed8!important}
@media(max-width:640px){.premium-product-ai-template-box{align-items:stretch}.premium-product-ai-template-actions{width:100%;align-items:stretch}.premium-product-ai-template-button,.premium-product-ai-review-button{width:100%;justify-content:center}.premium-product-ai-link{margin-left:0!important;margin-top:6px!important}}
