:root {
  --a-bg: #f4f5f7;
  --a-sidebar: #1c1510;
  --a-sidebar-hover: #2a2019;
  --a-gold: #c9974a;
  --a-gold-light: #e0b573;
  --a-text: #23201d;
  --a-muted: #8a8580;
  --a-border: #e6e3df;
  --a-card: #ffffff;
  --a-radius: 12px;
  --a-font: 'Segoe UI', Arial, sans-serif;
}
* { box-sizing: border-box; }
body.admin-body {
  margin: 0;
  font-family: var(--a-font);
  background: var(--a-bg);
  color: var(--a-text);
}
a { text-decoration: none; color: inherit; }
ul { margin: 0; padding: 0; list-style: none; }

.admin-layout { display: flex; min-height: 100vh; }

/* Sidebar */
.admin-sidebar {
  width: 240px;
  background: var(--a-sidebar);
  color: #ece7e0;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.admin-sidebar .logo { display: flex; align-items: center; gap: 10px; padding: 6px 10px 20px; }
.admin-sidebar .logo b { display: block; color: var(--a-gold); font-size: 16px; }
.admin-sidebar .logo span { display: block; font-size: 9px; letter-spacing: 1px; color: #9c948a; }
.sidebar-collapse-toggle {
  margin-left: auto; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14);
  color: #d8d2c8; width: 26px; height: 26px; border-radius: 7px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0;
}
.sidebar-collapse-toggle:hover { background: rgba(255,255,255,.14); color: #fff; }
.nav-group { margin-top: 6px; }
.nav-group-title {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; margin: 8px 0 2px;
  cursor: pointer; border-radius: 8px; user-select: none;
  font-size: 10.5px; letter-spacing: 1px; color: #9c948a; text-transform: uppercase;
}
.nav-group-title:hover { background: var(--a-sidebar-hover); color: #fff; }
.nav-group-title .ic { width: 16px; text-align: center; font-size: 13px; }
.nav-group-title .label { flex: 1; }
.nav-group-title .chev {
  font-size: 13px; transition: transform .15s, color .15s; flex-shrink: 0; color: #c9974a;
  width: 18px; height: 18px; display: flex; align-items: center; justify-content: center;
}
.nav-group-title:hover .chev { color: #fff; }
.nav-group.collapsed .nav-group-title .chev { transform: rotate(-90deg); }
.nav-group-body { overflow: hidden; }
.nav-group.collapsed .nav-group-body { display: none; }
.nav-reset-orden {
  background: none; border: none; color: #9c948a; font-size: 13px; cursor: pointer; line-height: 1;
  padding: 2px 4px; border-radius: 4px; opacity: 0; transition: opacity .15s, color .15s; flex-shrink: 0;
}
.nav-group-title:hover .nav-reset-orden { opacity: 1; }
.nav-reset-orden:hover { color: var(--a-gold); }
.admin-sidebar nav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px;
  font-size: 13.5px; color: #d8d2c8; flex: 1; min-width: 0;
}
.admin-sidebar nav a .ic { width: 18px; text-align: center; }
.nav-badge { margin-left: auto; background: #e05656; color: #fff; font-size: 10.5px; font-weight: 700; border-radius: 10px; padding: 1px 7px; }
.admin-sidebar nav a:hover { background: var(--a-sidebar-hover); color: #fff; }
.admin-sidebar nav a.active { background: var(--a-gold); color: #1c1510; font-weight: 600; }
.nav-item { display: flex; align-items: center; margin-bottom: 2px; border-radius: 8px; }
.nav-drag-handle {
  cursor: grab; width: 16px; text-align: center; color: #7c766d; font-size: 12px;
  opacity: 0; transition: opacity .15s; flex-shrink: 0;
}
.nav-item:hover .nav-drag-handle { opacity: 1; }
.nav-item.dragging { opacity: .4; }
.nav-item.dragging .nav-drag-handle { cursor: grabbing; }
.sidebar-footer {
  margin-top: auto; background: rgba(201,151,74,.08); border: 1px solid rgba(201,151,74,.3);
  border-radius: 10px; padding: 14px; font-size: 12px; color: #b8ada0;
}
.sidebar-footer b { color: var(--a-gold); display: block; margin-bottom: 4px; }

/* Barra lateral contraída a solo íconos (escritorio) */
.admin-sidebar.rail { width: 68px; padding: 20px 8px; transition: width .2s ease; }
.admin-sidebar.rail .logo { justify-content: center; padding: 6px 0 20px; }
.admin-sidebar.rail .logo > div { display: none; }
.admin-sidebar.rail .sidebar-collapse-toggle { margin-left: 0; }
.admin-sidebar.rail .nav-group-title { justify-content: center; padding: 8px; }
.admin-sidebar.rail .nav-group-title .label,
.admin-sidebar.rail .nav-group-title .chev,
.admin-sidebar.rail .nav-reset-orden,
.admin-sidebar.rail .nav-drag-handle,
.admin-sidebar.rail nav a .label,
.admin-sidebar.rail .sidebar-footer { display: none; }
.admin-sidebar.rail .nav-group-body { display: block !important; }
.admin-sidebar.rail nav a { justify-content: center; padding: 10px; gap: 0; position: relative; }
.admin-sidebar.rail nav a .ic { width: auto; font-size: 17px; }
.admin-sidebar.rail .nav-badge { position: absolute; top: 2px; right: 2px; margin-left: 0; }

/* Main */
.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.admin-main > .admin-content { flex: 1; }
/* Versión fija al pie del área central: no se mueve con el scroll ni con el menú lateral. */
.app-version {
  position: sticky; bottom: 0; margin-top: auto; padding: 8px 0; text-align: center;
  font-size: 11.5px; color: var(--a-muted); background: var(--a-bg); border-top: 1px solid var(--a-border);
}
.admin-topbar {
  display: flex; align-items: center; justify-content: space-between;
  background: #fff; border-bottom: 1px solid var(--a-border); padding: 16px 28px;
  /* Título de la página y campanita quedan fijos arriba mientras se hace scroll. */
  position: sticky; top: 0; z-index: 50;
}
.admin-topbar h1 { font-size: 20px; margin: 0; }
.admin-topbar .sub { font-size: 13px; color: var(--a-muted); margin: 2px 0 0; }
.topbar-actions { display: flex; align-items: center; gap: 16px; }
.admin-content { padding: 26px 28px; }

.badge-bell { position: relative; cursor: pointer; }
.badge-bell .count {
  position: absolute; top: -6px; right: -8px; background: #e05656; color: #fff;
  font-size: 10px; border-radius: 50%; width: 16px; height: 16px; display: flex; align-items: center; justify-content: center;
}
.notif-dropdown {
  display: none; position: absolute; top: 32px; right: 0; width: 300px; max-height: 360px; overflow-y: auto;
  background: var(--a-card); border: 1px solid var(--a-border); border-radius: 10px; box-shadow: 0 12px 28px rgba(0,0,0,.15); z-index: 60;
}
.notif-dropdown.show { display: block; }
.notif-dropdown-head { padding: 12px 14px; font-weight: 700; font-size: 13px; border-bottom: 1px solid var(--a-border); }
.notif-item { display: flex; align-items: center; gap: 10px; padding: 12px 14px; font-size: 13px; color: var(--a-text); border-bottom: 1px solid var(--a-border); cursor: pointer; }
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--a-bg); }
.notif-item .ic { font-size: 16px; }
.notif-empty { padding: 20px 14px; text-align: center; font-size: 12.5px; color: var(--a-muted); }

/* Avisos flotantes en pantalla cuando llega algo nuevo mientras el panel está abierto */
.toast-stack {
  position: fixed; top: 18px; right: 18px; z-index: 9999;
  display: flex; flex-direction: column; gap: 10px; width: 320px; max-width: calc(100vw - 32px);
}
.toast-aviso {
  background: var(--a-card); border: 1px solid var(--a-border); border-left: 4px solid var(--a-gold);
  border-radius: var(--a-radius); box-shadow: 0 10px 28px rgba(0,0,0,.18);
  padding: 13px 14px; display: flex; align-items: flex-start; gap: 10px; cursor: pointer;
  animation: toast-entrada .25s ease-out;
}
.toast-aviso:hover { background: var(--a-bg); }
.toast-aviso .ic { font-size: 18px; line-height: 1.3; }
.toast-aviso .txt { font-size: 13px; color: var(--a-text); flex: 1; line-height: 1.4; }
.toast-aviso .cerrar { color: var(--a-muted); font-size: 15px; line-height: 1; cursor: pointer; padding: 2px; }
.toast-aviso.saliendo { animation: toast-salida .2s ease-in forwards; }
@keyframes toast-entrada { from { transform: translateX(30px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toast-salida { to { transform: translateX(30px); opacity: 0; } }
@media (max-width: 600px) {
  .toast-stack { left: 16px; right: 16px; width: auto; top: 12px; }
}
.admin-user { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.admin-user .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--a-border); display: flex; align-items: center; justify-content: center; }
.admin-user b { display: block; }
.admin-user span { color: var(--a-muted); font-size: 11px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 8px; font-size: 13px; font-weight: 600; border: 1px solid transparent; cursor: pointer; }
.wa-icon { width: 16px; height: 16px; flex-shrink: 0; }
.btn-whatsapp { background: #25D366; color: #fff; border-color: #25D366; }
.btn-whatsapp:hover { background: #1fb959; border-color: #1fb959; }

.hamburger-btn {
  display: none; width: 38px; height: 38px; border-radius: 8px; border: 1px solid var(--a-border);
  background: #fff; font-size: 18px; cursor: pointer; align-items: center; justify-content: center; flex-shrink: 0;
}
.sidebar-backdrop { display: none; }

@media (max-width: 880px) {
  .hamburger-btn { display: flex; }
  .admin-topbar { gap: 12px; }
  .admin-topbar > div:first-child { display: flex; align-items: center; gap: 12px; }
  .admin-sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 90;
    transform: translateX(-100%); transition: transform .25s ease;
  }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-sidebar.rail { width: 240px; }
  .admin-sidebar.rail .logo > div,
  .admin-sidebar.rail .sidebar-footer { display: block; }
  .admin-sidebar.rail .nav-group-title .label,
  .admin-sidebar.rail .nav-group-title .chev,
  .admin-sidebar.rail nav a .label { display: inline; }
  .admin-sidebar.rail .nav-group-title,
  .admin-sidebar.rail nav a { justify-content: flex-start; }
  .sidebar-collapse-toggle { display: none; }
  .sidebar-backdrop.show {
    display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 80;
  }
  .admin-topbar { flex-wrap: wrap; }
  .topbar-actions { flex-wrap: wrap; gap: 10px; }
  .admin-user span { display: none; }
}
.btn-gold { background: var(--a-gold); color: #fff; }
.btn-gold:hover { background: var(--a-gold-light); }
.btn-light { background: #fff; border-color: var(--a-border); color: var(--a-text); }
.btn-light:hover { background: #f2f0ec; }
.btn-danger { background: #fdeceb; color: #c0392b; border-color: #f6d3d0; }
.btn-sm { padding: 6px 10px; font-size: 12px; }

/* Cards / stats */
.stat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; margin-bottom: 22px; }
.stat-grid > *, .grid-2 > *, .grid-2b > * { min-width: 0; }
canvas { max-width: 100%; }
.stat-card {
  background: var(--a-card); border: 1px solid var(--a-border); border-radius: var(--a-radius); padding: 13px;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
a.stat-card { display: block; text-decoration: none; color: inherit; cursor: pointer; }
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 10px 22px rgba(0,0,0,.08); border-color: var(--a-gold); }
.stat-card .top { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.stat-card .icon { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 13px; }
.stat-card .label { font-size: 9px; letter-spacing: .3px; text-transform: uppercase; color: var(--a-muted); }
.stat-card .value { font-size: 16px; font-weight: 700; }
.stat-card .delta { font-size: 9.5px; color: #2f9e5a; margin-top: 3px; }

.icon-blue { background: #eaf1ff; color: #3d6fe0; }
.icon-green { background: #e9f9ef; color: #2f9e5a; }
.icon-purple { background: #f3ecff; color: #8256d6; }
.icon-orange { background: #fff2e4; color: #e0902f; }
.icon-teal { background: #e6faf7; color: #1fa397; }
.icon-red { background: #fdeaea; color: #c0392b; }

.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; margin-bottom: 22px; }
.grid-2b { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; }
.panel { background: var(--a-card); border: 1px solid var(--a-border); border-radius: var(--a-radius); padding: 20px; }

/* Dashboard arrastrable */
.dash-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; align-items: start; }
.dash-widget { position: relative; grid-column: span 1; min-width: 0; }
.dash-widget[data-span="2"] { grid-column: span 2; }
.dash-widget[data-span="3"] { grid-column: span 3; }
.dash-widget[data-span="4"] { grid-column: span 4; }
.dash-widget .stat-grid { margin-bottom: 0; }
.dash-widget.dragging { opacity: .4; }
.dash-drag-handle {
  position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 6px;
  background: rgba(0,0,0,.05); color: var(--a-muted); display: flex; align-items: center; justify-content: center;
  cursor: grab; opacity: 0; transition: opacity .15s, background .15s, color .15s; z-index: 5; font-size: 13px;
}
.dash-widget:hover .dash-drag-handle { opacity: 1; }
.dash-drag-handle:hover { background: rgba(0,0,0,.1); color: var(--a-gold); }
.dash-drag-handle.grabbing { cursor: grabbing; }
@media (max-width: 950px) {
  .dash-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-widget[data-span="3"], .dash-widget[data-span="4"] { grid-column: span 2; }
}
@media (max-width: 700px) {
  .dash-grid { grid-template-columns: 1fr; }
  .dash-widget, .dash-widget[data-span="2"], .dash-widget[data-span="3"], .dash-widget[data-span="4"] { grid-column: span 1; }
}
.panel h3 { margin: 0 0 16px; font-size: 15px; }
.panel .panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }

.activity-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--a-border); }
.activity-item:last-child { border-bottom: none; }
.activity-item .ic { width: 34px; height: 34px; border-radius: 8px; background: #f2f0ec; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.activity-item b { display: block; font-size: 13px; }
.activity-item span { font-size: 11.5px; color: var(--a-muted); }

/* Tables */
.table-responsive { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th { text-align: left; font-size: 11.5px; text-transform: uppercase; color: var(--a-muted); padding: 10px; border-bottom: 1px solid var(--a-border); }
.admin-table td { padding: 10px; border-bottom: 1px solid var(--a-border); font-size: 13.5px; vertical-align: middle; }
.admin-table img.thumb { width: 42px; height: 42px; border-radius: 8px; object-fit: cover; background: #f2f0ec; }
.table-actions { display: flex; gap: 6px; }
.pill { padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.pill-green { background: #e9f9ef; color: #2f9e5a; }
.pill-gray { background: #f2f0ec; color: #8a8580; }
.pill-orange { background: #fff2e4; color: #e0902f; }
.pill-red { background: #fdeceb; color: #c0392b; }
.pill-blue { background: #e8f1fc; color: #2b70c9; }
.pill-purple { background: #f2eafc; color: #7b3fc4; }
.pill-gold { background: #fbf1de; color: #a9762c; }

.confirm-overlay {
  display: none; position: fixed; inset: 0; background: rgba(20,15,10,.55); z-index: 200;
  align-items: center; justify-content: center; padding: 20px;
}
.confirm-overlay.show { display: flex; }
.confirm-box {
  background: var(--a-card); border-radius: 12px; padding: 24px; max-width: 380px; width: 100%;
  box-shadow: 0 20px 50px rgba(0,0,0,.35); border-top: 4px solid var(--a-gold);
}
.confirm-box p { margin: 0 0 22px; font-size: 14.5px; color: var(--a-text); line-height: 1.5; }
.confirm-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* Temas de temporada */
.temas-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.tema-btn {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 12px 10px; border: 1px solid var(--a-border); border-radius: 10px;
  background: #fff; cursor: pointer; font-family: var(--a-font); transition: border-color .15s, box-shadow .15s;
}
.tema-btn:hover { border-color: var(--a-gold); }
.tema-btn.active { border-color: var(--a-gold); box-shadow: 0 0 0 2px rgba(201, 151, 74, .25); }
.tema-swatches { display: flex; gap: 4px; }
.tema-swatches span { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(0,0,0,.1); }
.tema-nombre { font-size: 12px; font-weight: 600; color: var(--a-text); text-align: center; }

/* Forms */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { margin-bottom: 16px; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; color: #4d4a45; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--a-border);
  font-family: var(--a-font); font-size: 13.5px; background: #fff;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--a-gold); }
.form-actions { display: flex; gap: 10px; margin-top: 6px; }
.current-image { margin-bottom: 10px; }
.current-image img { width: 90px; height: 90px; object-fit: cover; border-radius: 8px; border: 1px solid var(--a-border); }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--a-sidebar); }
.login-card { background: #fff; border-radius: 16px; padding: 40px; width: 360px; }
.login-card .logo { text-align: center; margin-bottom: 24px; }
.login-card .logo b { display: block; font-size: 20px; color: var(--a-text); }
.login-card .logo span { font-size: 11px; letter-spacing: 1px; color: var(--a-gold); font-weight: 700; }

.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 13px; }
.alert-success { background: #e9f9ef; color: #2f9e5a; }
.alert-error { background: #fdeceb; color: #c0392b; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--a-muted); }
.empty-state .ic { font-size: 40px; margin-bottom: 12px; }

.quick-links { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 12px; }
.quick-links a { border: 1px solid var(--a-border); border-radius: 10px; padding: 14px; text-align: center; font-size: 12.5px; font-weight: 600; }
.quick-links a:hover { background: #f7f5f1; }

.storage-bar { height: 8px; border-radius: 6px; background: #f0eee9; overflow: hidden; margin: 10px 0; }
.storage-bar > div { height: 100%; background: var(--a-gold); }

@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-2b { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}

/* Editor de fotos (assets/js/editor-foto.js) */
.ef-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.7); display: none; align-items: center; justify-content: center; z-index: 2000; padding: 16px; }
.ef-overlay.ef-abierto { display: flex; }
.ef-dialog { background: var(--a-card, #fff); color: var(--a-text, inherit); border-radius: 14px; padding: 20px; width: 100%; max-width: 480px; max-height: 96vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.ef-titulo { margin: 0 0 4px; font-size: 18px; }
.ef-ayuda { margin: 0 0 12px; font-size: 12.5px; color: var(--a-muted, #888); }
.ef-lienzo { display: block; width: 100%; max-width: 420px; height: auto; margin: 0 auto 12px; border-radius: 10px; border: 1px solid var(--a-border, #ddd); touch-action: none; cursor: grab; }
.ef-lienzo:active { cursor: grabbing; }
.ef-controles { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: center; margin-bottom: 14px; }
.ef-rango { flex: 1 1 120px; min-width: 100px; accent-color: var(--a-gold, #c9974a); }
.ef-acciones { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.ef-proporcion { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; font-size: 13px; }
.ef-proporcion select { flex: 1; padding: 6px 8px; border: 1px solid var(--a-border, #ddd); border-radius: 8px; background: transparent; color: inherit; }
.ef-fila { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; font-size: 13px; }
.ef-fila label { font-weight: 600; }
.ef-angulo { flex: 1 1 140px; min-width: 100px; accent-color: var(--a-gold, #c9974a); }
.ef-ang-txt { min-width: 46px; text-align: right; font-variant-numeric: tabular-nums; }
.ef-zoom { display: flex; gap: 8px; align-items: center; flex: 1 1 220px; }
.ef-zoom .ef-rango { flex: 1 1 100px; }
.btn-estrella { background: none; border: 0; font-size: 20px; line-height: 1; cursor: pointer; padding: 4px 6px; border-radius: 6px; color: var(--a-muted, #999); transition: transform .1s, background .15s; }
.btn-estrella:hover { background: rgba(201,151,74,.15); transform: scale(1.15); }
.btn-estrella:disabled { opacity: .5; cursor: wait; }
.insignia-rep { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 8px; border-radius: 999px; background: #e63946; color: #fff; font-size: 11.5px; font-weight: 700; line-height: 1; }
.admin-table img.thumb-editar { cursor: pointer; transition: transform .12s, box-shadow .12s; }
.admin-table a:hover img.thumb-editar { transform: scale(1.08); box-shadow: 0 2px 8px rgba(0,0,0,.25); }

/* Aviso llamativo de pedidos nuevos en la barra lateral */
@keyframes nav-badge-pulso { 0%, 100% { box-shadow: 0 0 0 0 rgba(230,57,70,.75); transform: scale(1); } 50% { box-shadow: 0 0 0 7px rgba(230,57,70,0); transform: scale(1.14); } }
@keyframes nav-campana { 0%, 60%, 100% { transform: rotate(0); } 10% { transform: rotate(14deg); } 20% { transform: rotate(-12deg); } 30% { transform: rotate(9deg); } 40% { transform: rotate(-6deg); } 50% { transform: rotate(3deg); } }
.nav-badge-pedidos, .nav-badge-grupo { background: #e63946; font-size: 11.5px; padding: 2px 8px; animation: nav-badge-pulso 1.5s ease-in-out infinite; }
.nav-item a.con-alerta { background: linear-gradient(90deg, rgba(230,57,70,.28), rgba(230,57,70,.04)); box-shadow: inset 3px 0 0 #e63946; font-weight: 700; }
.nav-item a.con-alerta .ic { display: inline-block; transform-origin: 50% 10%; animation: nav-campana 2.2s ease-in-out infinite; }
.nav-badge-grupo { display: none; margin-left: auto; margin-right: 6px; }
.nav-group.collapsed .nav-badge-grupo { display: inline-block; }
@media (prefers-reduced-motion: reduce) { .nav-badge-pedidos, .nav-badge-grupo, .nav-item a.con-alerta .ic { animation: none; } }

/* Productos en cuadrícula: fotos grandes con borrar y editar a la mano */
.grid-productos { --tam: 240px; display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--tam), 1fr)); gap: 14px; }
.tarjeta-producto { display: flex; flex-direction: column; border: 1px solid var(--a-border, #ddd); border-radius: 12px; overflow: hidden; background: var(--a-card, transparent); }
.tarjeta-img { position: relative; aspect-ratio: 1 / 1; overflow: hidden; background: rgba(127,127,127,.12); }
.tarjeta-ampliar { position: absolute; inset: 0; display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.tarjeta-ampliar img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s ease; }
.tarjeta-ampliar:hover img { transform: scale(1.04); }
.tarjeta-check { position: absolute; top: 8px; left: 8px; z-index: 2; background: rgba(255,255,255,.92); border-radius: 7px; padding: 4px 6px; line-height: 1; cursor: pointer; }
.tarjeta-check input { width: 17px; height: 17px; margin: 0; cursor: pointer; }
.tarjeta-estrella { position: absolute; top: 8px; right: 8px; z-index: 2; background: rgba(255,255,255,.92); border-radius: 50%; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; padding: 0; }
.tarjeta-inactivo { position: absolute; left: 8px; bottom: 8px; background: rgba(0,0,0,.65); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 10px; }
.tarjeta-info { padding: 9px 11px 4px; flex: 1; }
.tarjeta-nombre { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tarjeta-meta { font-size: 12px; color: var(--a-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tarjeta-acciones { display: flex; gap: 6px; padding: 8px 11px 11px; flex-wrap: wrap; }
.tarjeta-acciones form { margin: 0; margin-left: auto; }
.tarjeta-producto:has(.lote-check:checked) { outline: 3px solid var(--a-gold, #c9a227); outline-offset: -3px; }
.visor-foto { position: fixed; inset: 0; z-index: 10000; background: rgba(0,0,0,.88); align-items: center; justify-content: center; padding: 20px; }
.visor-foto figure { margin: 0; max-width: 92vw; max-height: 92vh; text-align: center; }
.visor-foto img { max-width: 92vw; max-height: 84vh; object-fit: contain; border-radius: 8px; box-shadow: 0 10px 50px rgba(0,0,0,.6); }
.visor-foto figcaption { color: #fff; margin-top: 10px; font-size: 14px; }
.visor-cerrar, .visor-nav { position: absolute; background: rgba(255,255,255,.14); color: #fff; border: 0; cursor: pointer; border-radius: 50%; width: 46px; height: 46px; font-size: 26px; line-height: 1; }
.visor-cerrar { top: 16px; right: 16px; font-size: 20px; }
.visor-nav { top: 50%; transform: translateY(-50%); }
.visor-ant { left: 16px; } .visor-sig { right: 16px; }
.visor-cerrar:hover, .visor-nav:hover { background: rgba(255,255,255,.3); }

/* Fotos adicionales mostradas como tarjetas en la cuadrícula de productos */
.tarjeta-extra { border-style: dashed; border-color: var(--a-gold, #c9a227); }
.tarjeta-extra-etq { position: absolute; left: 8px; top: 8px; z-index: 2; background: var(--a-gold, #c9a227); color: #1a1208; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 10px; }

/* Barras de acciones en lote: se quedan visibles al bajar, justo debajo de la barra superior del panel (que también es fija) */
.barra-fija { position: sticky; top: calc(var(--topbar-h, 80px) + 10px); z-index: 40; box-shadow: 0 6px 18px rgba(0,0,0,.12); }

/* Botones y filtros del listado de productos: se quedan fijos, justo debajo de la barra superior, al bajar por la lista */
.barra-herramientas { position: sticky; top: var(--topbar-h, 80px); z-index: 40; background: var(--a-card); margin: -20px -20px 10px; padding: 10px 20px 2px; border-radius: var(--a-radius) var(--a-radius) 0 0; box-shadow: 0 8px 16px -10px rgba(0,0,0,.25); }
.barra-herramientas .panel-head { margin-bottom: 8px; }
@media (max-width: 760px) { .barra-herramientas { position: static; box-shadow: none; } }

/* Barra de herramientas del listado de productos: una fila con el título y las acciones, y otra con la búsqueda y los filtros. */
.herr-acciones { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.menu-herr { position: relative; }
.menu-herr > summary { list-style: none; cursor: pointer; user-select: none; }
.menu-herr > summary::-webkit-details-marker { display: none; }
.menu-herr > summary::after { content: '▾'; margin-left: 6px; font-size: 11px; }
.menu-herr[open] > summary { background: var(--a-gold); color: #fff; }
.menu-herr-lista { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 310px; padding: 6px; background: var(--a-card); border: 1px solid var(--a-border); border-radius: 10px; box-shadow: 0 14px 34px rgba(0,0,0,.28); }
.menu-herr-lista a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: 7px; color: inherit; text-decoration: none; font-size: 13.5px; }
.menu-herr-lista a:hover { background: rgba(0,0,0,.06); }
.menu-herr-lista hr { border: 0; border-top: 1px solid var(--a-border); margin: 4px 2px; }
.menu-herr-lista .insignia-rep { margin-left: 0; }
.barra-herramientas #buscadorProductos { margin: 0 0 8px !important; gap: 8px !important; }
.barra-herramientas #buscadorProductos select, .barra-herramientas #buscadorProductos input[type=search] { padding: 6px 8px; font-size: 13px; }
.barra-herramientas #buscadorProductos select { max-width: 150px; }
.barra-herramientas #buscadorProductos > div:first-child { min-width: 180px !important; }
.menu-herr-lista button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 0; border-radius: 7px; background: none; color: inherit; font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; }
.menu-herr-lista button:hover { background: rgba(0,0,0,.06); }

/* Dashboard: los 10 productos más vistos */
/* Listado de productos: el precio se cambia con un clic */
.fila-producto .precio-prod { cursor: text; border-radius: 6px; padding: 1px 4px; margin: -1px -4px; transition: background .15s ease; }
.fila-producto .precio-prod:hover { background: rgba(201,151,74,.18); }
.fila-producto .precio-prod:hover::after { content: " ✏️"; font-size: 11px; }
.fila-producto .precio-prod input { cursor: text; }
.mas-vistos { display: flex; flex-direction: column; gap: 4px; }
.mas-visto { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; color: inherit; text-decoration: none; transition: background .15s ease; }
.mas-visto:hover { background: rgba(0,0,0,.05); }
.mv-pos { width: 26px; text-align: center; font-weight: 700; font-size: 15px; color: var(--a-muted); flex: none; }
.mas-visto .thumb { width: 42px; height: 42px; border-radius: 8px; object-fit: cover; flex: none; }
.mv-datos { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mv-datos b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mv-datos small { font-size: 11.5px; color: var(--a-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mv-barra { display: block; height: 5px; border-radius: 4px; background: rgba(0,0,0,.07); overflow: hidden; margin-top: 2px; }
.mv-barra > span { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--a-gold, #c9974a), #e8b765); }
.mv-visitas { flex: none; font-weight: 700; font-size: 14px; min-width: 44px; text-align: right; }
.tarjeta-inactivo.btn-estado-prod { font-family: inherit; line-height: 1.4; background: rgba(120,40,40,.88); }
.tarjeta-inactivo.btn-estado-prod:disabled { cursor: default; }
.pill.btn-estado-prod { font-family: inherit; }
.app-version a { color: inherit; text-decoration: none; }
.app-version a:hover { color: var(--a-gold); text-decoration: underline; }
.version-actual { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.version-actual .num { font-size: 34px; font-weight: 700; color: var(--a-gold); line-height: 1; }
.version-item { border-left: 3px solid var(--a-border); padding: 4px 0 4px 14px; margin: 0 0 18px; }
.version-item.actual { border-left-color: var(--a-gold); }
.version-item h4 { margin: 0 0 4px; font-size: 15px; }
.version-item ul { margin: 6px 0 0 18px; padding: 0; font-size: 13.5px; line-height: 1.55; }
