/* ============================================================
   YOM · Store Execution Intelligence — Design System (v2)
   Estética de marca Yom: lavanda base, púrpura protagonista,
   cyan secundario, verde para positivo/CTAs. DM Sans.
   ============================================================ */

:root {
  /* Surfaces */
  /* === TEMA CLARO (default) === */
  --surface-1: #f6f5fb;      /* base (fondo app) */
  --surface-2: #ffffff;      /* cards / paneles */
  --surface-3: #f7f6fe;      /* hover suave / zebra */
  --surface-dark: #241b47;   /* púrpura oscuro (tooltips/code) */
  --surface-dark-2: #2f2458;
  --sidebar-bg: #faf9ff;     /* sidebar */
  --sidebar-fg: #5b5474;

  /* Accents */
  --accent-purple: #6b4bf0;
  --accent-purple-600: #5a3cb8;
  --accent-purple-soft: #ece7fb;
  --accent-cyan: #1dbaef;
  --accent-cyan-soft: #e0f6fd;
  --accent-green: #3cc96b;
  --accent-green-soft: #e2f7ea;
  --accent-amber: #f0a92b;
  --accent-amber-soft: #fdf1dc;
  --accent-red: #e5484d;
  --accent-red-soft: #fce7e8;

  /* Text */
  --text-1: #1c1633;
  --text-2: #5b5474;
  --text-3: #6b6688;
  --text-on-dark: #f4f2ff;
  --text-on-dark-2: #b9b2df;

  /* Lines */
  --border: #e6e3f5;
  --border-strong: #9a93bf;

  /* Shape */
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(36, 27, 71, .06), 0 1px 3px rgba(36, 27, 71, .05);
  --shadow-md: 0 4px 16px rgba(36, 27, 71, .09);
  --shadow-lg: 0 12px 40px rgba(36, 27, 71, .16);

  --sidebar-w: 268px;
  --font: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'DM Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: var(--font);
  background: var(--surface-1);
  color: var(--text-1);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ---------- App shell ---------- */
.app { display: flex; min-height: 100vh; }

/* ---------- Sidebar ---------- */
/* === TEMA OSCURO (opt-in por usuario: <html data-theme="dark">) === */
[data-theme="dark"] {
  /* Hace que los controles NATIVOS (checkbox, radio, scrollbar, flecha del select,
     date/color pickers) rendericen en oscuro. Mata los "rincones claros". */
  color-scheme: dark;
  --surface-1: #14102a;
  --surface-2: #1e1740;
  --surface-3: #271e50;
  --surface-dark: #0f0b22;
  --surface-dark-2: #1a1338;
  --sidebar-bg: #0f0b22;
  --sidebar-fg: #b9b2df;
  --accent-purple: #8b6dff;
  --accent-purple-600: #7a5cf0;
  --accent-purple-soft: #2a2152;
  --accent-cyan: #3fc9f5;
  --accent-cyan-soft: #123039;
  --accent-green: #46d47a;
  --accent-green-soft: #123626;
  --accent-amber: #f5b942;
  --accent-amber-soft: #352a10;
  --accent-red: #f2585d;
  --accent-red-soft: #3a1519;
  --text-1: #f4f2ff;
  --text-2: #c3bce6;
  --text-3: #928bb8;
  --border: #322a58;
  --border-strong: #574b85;
}

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--sidebar-bg);
  color: var(--sidebar-fg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 22px 16px;
}
.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--surface-dark-2); border-radius: 8px; }

.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 20px; }
.brand-logo {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-cyan) 100%);
  display: grid; place-items: center; font-weight: 800; color: #fff; font-size: 16px;
  flex: 0 0 34px;
}
.brand-name { font-weight: 800; font-size: 15px; letter-spacing: -.2px; line-height: 1.15; }
.brand-sub { font-size: 11px; color: var(--text-3); font-family: var(--mono); }

.nav-group { margin-top: 18px; }
.nav-group-title {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em;
  color: var(--text-3); font-weight: 700; padding: 0 10px 8px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 10px; border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 550; font-size: 14px;
  cursor: pointer; transition: background .13s, color .13s; margin-bottom: 2px;
}
.nav-item:hover { background: var(--accent-purple-soft); color: var(--accent-purple); }
.nav-item.active { background: var(--accent-purple); color: #fff; box-shadow: var(--shadow-sm); }
.nav-item .ico { width: 18px; height: 18px; flex: 0 0 18px; opacity: .95; }
.nav-item .lbl { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-dot {
  width: 7px; height: 7px; border-radius: 50%; flex: 0 0 7px;
}
.nav-spacer { flex: 1; min-height: 20px; }

.nav-dot.s-poc { background: var(--accent-green); }
.nav-dot.s-nuevo { background: #b9a7f5; }
.nav-dot.s-mock { background: var(--accent-amber); }
.nav-dot.s-spec { background: var(--accent-cyan); }

.nav-legend {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 12px 10px 4px; margin-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 10.5px; color: var(--text-3); font-family: var(--mono);
}
.nav-legend .nav-dot { margin-left: 8px; }
.nav-legend .nav-dot:first-child { margin-left: 0; }

/* ---------- Main ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 64px; flex: 0 0 64px;
  background: rgba(255,255,255,.72); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px;
  padding: 0 28px; position: sticky; top: 0; z-index: 20;
}
.crumb { font-size: 13px; color: var(--text-3); font-family: var(--mono); }
.crumb b { color: var(--text-2); font-weight: 500; }
.topbar-spacer { flex: 1; }
.nav-toggle { background: none; border: none; color: var(--text-2); font-size: 18px; line-height: 1; cursor: pointer; margin-right: 12px; padding: 4px 6px; border-radius: 7px; }
.nav-toggle:hover { background: var(--accent-purple-soft); color: var(--accent-purple); }
html.nav-collapsed .sidebar { width: 66px; flex-basis: 66px; padding: 22px 8px; }
html.nav-collapsed .nav-item .lbl,
html.nav-collapsed .nav-group-title,
html.nav-collapsed .brand-name,
html.nav-collapsed .brand-sub,
html.nav-collapsed .nav-legend,
html.nav-collapsed .nav-dot { display: none; }
html.nav-collapsed .nav-item { justify-content: center; padding: 9px 0; }
html.nav-collapsed .brand { justify-content: center; padding: 4px 0 18px; }
.proj-switch { margin-left: 14px; padding: 5px 10px; border: 0.5px solid var(--border-strong); border-radius: 8px; background: var(--surface-2); color: var(--text-1); font-size: 12.5px; font-family: var(--font); font-weight: 600; cursor: pointer; max-width: 220px; }
.proj-chip { margin-left: 14px; padding: 5px 12px; border-radius: 20px; background: var(--accent-purple-soft); color: var(--accent-purple); font-size: 12.5px; font-weight: 600; }

.profile-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px 6px 12px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.profile-chip .who { text-align: right; line-height: 1.1; }
.profile-chip .who .r { font-size: 13px; font-weight: 700; }
.profile-chip .who .t { font-size: 11px; color: var(--text-3); font-family: var(--mono); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 13px;
}
.avatar.admin { background: var(--accent-purple); }
.avatar.operador { background: var(--accent-cyan); }
.avatar.fabricante { background: var(--accent-green); }
.btn-switch {
  font-size: 12px; color: var(--accent-purple); font-weight: 700;
  padding: 7px 12px; border-radius: 999px; border: 1px solid var(--border-strong);
  background: var(--surface-2); cursor: pointer;
}
.btn-switch:hover { background: var(--accent-purple-soft); }

.content { padding: 28px; max-width: 1180px; width: 100%; }

/* ---------- Page header ---------- */
.page-head { margin-bottom: 22px; }
.page-title { font-size: 27px; font-weight: 800; letter-spacing: -.5px; display: flex; align-items: center; gap: 12px; }
.page-desc { color: var(--text-2); margin-top: 6px; font-size: 15px; max-width: 720px; }

/* ---------- Status badges ---------- */
.badge {
  font-size: 11px; font-weight: 700; font-family: var(--mono);
  padding: 3px 9px; border-radius: 999px; letter-spacing: .02em;
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.poc { color: #2a9553; background: var(--accent-green-soft); }
.badge.nuevo { color: var(--accent-purple); background: var(--accent-purple-soft); }
.badge.mock { color: #b9791a; background: var(--accent-amber-soft); }
.badge.spec { color: #1189bb; background: var(--accent-cyan-soft); }

/* ---------- Cards ---------- */
.card {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm);
}
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card { min-width: 0; }

/* ---------- Placeholder (en construcción) ---------- */
.placeholder {
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius-lg);
  background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 12px, var(--surface-3) 12px, var(--surface-3) 24px);
  padding: 44px 32px; text-align: center; color: var(--text-2);
}
.placeholder .ph-ico {
  width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 14px;
  background: var(--surface-2); border: 1px solid var(--border);
  display: grid; place-items: center; color: var(--accent-purple);
  box-shadow: var(--shadow-sm);
}
.placeholder h3 { font-size: 17px; color: var(--text-1); font-weight: 800; }
.placeholder p { margin-top: 6px; font-size: 14px; }
.placeholder .will {
  margin: 18px auto 0; max-width: 560px; text-align: left; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px;
}
.placeholder .will .lab { font-size: 11px; font-family: var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); margin-bottom: 8px; }
.placeholder .will ul { list-style: none; }
.placeholder .will li { display: flex; gap: 9px; align-items: flex-start; padding: 4px 0; font-size: 14px; color: var(--text-2); }
.placeholder .will li::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-cyan); margin-top: 8px; flex: 0 0 6px; }

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 32px;
  background:
    radial-gradient(60vw 60vw at 85% -10%, rgba(107,75,204,.18), transparent 60%),
    radial-gradient(50vw 50vw at -10% 110%, rgba(29,186,239,.16), transparent 60%),
    var(--surface-1);
}
.login-card {
  width: 100%; max-width: 560px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 38px 38px 30px;
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.login-eyebrow { font-family: var(--mono); font-size: 12px; color: var(--text-3); letter-spacing: .04em; }
.login-title { font-size: 26px; font-weight: 800; letter-spacing: -.6px; margin: 14px 0 4px; }
.login-title .grad {
  background: linear-gradient(90deg, var(--accent-purple), var(--accent-cyan));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.login-sub { color: var(--text-2); font-size: 14px; margin-bottom: 24px; }
.role-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.role-card {
  border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 16px 14px; cursor: pointer; text-align: center;
  transition: border-color .13s, background .13s, transform .1s; background: var(--surface-2);
}
.role-card:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.role-card.sel { border-color: var(--accent-purple); background: var(--accent-purple-soft); }
.role-card .r-ico { width: 40px; height: 40px; margin: 0 auto 10px; border-radius: 11px; display: grid; place-items: center; color: #fff; }
.role-card.r-admin .r-ico { background: var(--accent-purple); }
.role-card.r-operador .r-ico { background: var(--accent-cyan); }
.role-card.r-fabricante .r-ico { background: var(--accent-green); }
.role-card .r-name { font-weight: 700; font-size: 14px; }
.role-card .r-desc { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }

.tenant-row { margin-top: 18px; display: none; }
.tenant-row.show { display: block; }
.field-label { font-size: 12px; font-weight: 700; color: var(--text-2); margin-bottom: 7px; display: block; }
.select {
  width: 100%; padding: 12px 14px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); font-family: var(--font); font-size: 14px; background: var(--surface-2); color: var(--text-1);
}
.btn-primary {
  width: 100%; margin-top: 22px; padding: 13px; border: none; border-radius: var(--radius-sm);
  background: var(--accent-purple); color: #fff; font-weight: 700; font-size: 15px; font-family: var(--font);
  cursor: pointer; transition: background .13s; box-shadow: var(--shadow-md);
}
.btn-primary:hover { background: var(--accent-purple-600); }
.btn-primary:disabled { background: var(--border-strong); cursor: not-allowed; box-shadow: none; }
.login-note { text-align: center; font-size: 12px; color: var(--text-3); margin-top: 16px; font-family: var(--mono); }

/* ---------- Dashboard (Execution Scorecard) ---------- */
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.filters { display: flex; gap: 10px; align-items: flex-end; margin-top: 14px; flex-wrap: wrap; }
.filters .f { display: flex; flex-direction: column; gap: 6px; }
.filters label { font-size: 10.5px; font-family: var(--mono); color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; }
.filters select {
  padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface-2); font-family: var(--font); font-size: 13px; color: var(--text-1); min-width: 168px;
}
.filters select:disabled { color: var(--text-3); background: var(--surface-3); }

.dash-top { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.score-hero { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.hero-num { font-size: 68px; font-weight: 800; line-height: 1; letter-spacing: -2.5px; }
.hero-base { font-family: var(--mono); font-size: 13px; color: var(--text-3); }
.hero-label { font-family: var(--mono); font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 10px; }
.sem-pill { margin-top: 14px; padding: 6px 16px; border-radius: 999px; font-weight: 700; font-size: 13px; }
.hero-meta { font-size: 12.5px; color: var(--text-2); margin-top: 12px; }

.pillars { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.pillar { min-width: 0; }
.ind-top { flex-wrap: wrap; min-width: 0; }
.pillar-top { display: flex; justify-content: space-between; align-items: baseline; }
.pillar-name { font-weight: 700; font-size: 14px; }
.pillar-w { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.pillar-w b { color: var(--text-2); font-weight: 700; }
.pill-top { flex-wrap: nowrap; gap: 6px; }
.pill-top .pillar-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill-top .ind-tools { flex: none; margin-left: 2px; }
.pillar-score { font-size: 34px; font-weight: 800; margin: 8px 0 10px; letter-spacing: -1px; }
.bar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; }

.ktable { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ktable th { text-align: left; font-size: 11px; font-family: var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); padding: 8px 10px; border-bottom: 1px solid var(--border); font-weight: 500; }
.ktable td { padding: 11px 10px; border-bottom: 1px solid var(--border); }
.ktable tr:last-child td { border-bottom: none; }
.ktable td.num { font-family: var(--mono); text-align: right; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.chip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.sug-tag {
  font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .08em;
  color: #1189bb; background: var(--accent-cyan-soft); padding: 3px 9px; border-radius: 999px; margin-left: 10px;
}
.card-title { font-size: 15px; font-weight: 800; margin-bottom: 4px; display: flex; align-items: center; }
.card-note { font-size: 12.5px; color: var(--text-3); margin-bottom: 14px; }
.action-item { display: flex; gap: 11px; align-items: flex-start; padding: 11px 0; border-top: 1px solid var(--border); }
.action-item:first-of-type { border-top: none; }
.action-item .a-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: 0 0 8px; }
.action-item .a-txt { font-size: 14px; }
.action-item .a-txt b { font-weight: 700; }
.action-item .a-sub { font-size: 12px; color: var(--text-3); }
.comp-row { display: flex; align-items: center; gap: 10px; margin: 9px 0; }
.comp-name { width: 92px; font-size: 13px; font-weight: 500; }
.comp-bar { flex: 1; height: 11px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.comp-bar > i { display: block; height: 100%; border-radius: 99px; }
.comp-val { width: 46px; text-align: right; font-family: var(--mono); font-size: 12px; color: var(--text-2); }
.empty { text-align: center; color: var(--text-3); padding: 30px; font-size: 14px; }

/* ---------- Galería / entrenamiento por producto ---------- */
.gal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; margin-top: 12px; }
.gal-item { position: relative; }
.gal-item img { width: 100%; height: 112px; object-fit: contain; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-3); display: block; }
.gal-src { position: absolute; top: 5px; left: 5px; font-size: 9px; font-family: var(--mono); background: rgba(36,27,71,.78); color: #fff; padding: 1px 6px; border-radius: 5px; }
.gal-del { position: absolute; top: 5px; right: 5px; width: 24px; height: 24px; border-radius: 6px; border: none; background: rgba(229,72,77,.92); color: #fff; cursor: pointer; font-size: 15px; line-height: 1; opacity: 0; transition: opacity .12s; }
.gal-item:hover .gal-del { opacity: 1; }
.gal-del:focus-visible { opacity: 1; }

/* miniatura de producto + preview flotante + lightbox */
.sku-thumb { width: 40px; height: 40px; object-fit: contain; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-3); vertical-align: middle; }
.sku-thumb.noimg { visibility: hidden; }
.sku-thumb-lg { width: 128px; height: 128px; object-fit: contain; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-3); }
.sku-thumb-lg.noimg { display: none; }
.sku-pop { position: fixed; z-index: 600; display: none; pointer-events: none; background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: 10px; padding: 5px; box-shadow: var(--shadow-lg); }
.sku-pop img { width: 210px; height: 210px; object-fit: contain; display: block; background: var(--surface-3); border-radius: 6px; }
/* Datos del producto debajo de la miniatura (para elegir entre productos parecidos) */
.sku-pop { max-width: 320px; }
.sku-pop-d { display: none; margin-top: 6px; padding: 2px 4px 3px; }
.spd-row { display: flex; gap: 10px; justify-content: space-between; font-size: 11.5px; line-height: 1.45; padding: 1px 0; }
.spd-row span { color: var(--text-3); white-space: nowrap; }
.spd-row b { color: var(--text-1); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ux-lb { position: fixed; inset: 0; background: rgba(14,11,31,.85); z-index: 700; display: flex; align-items: center; justify-content: center; padding: 24px; }
.ux-lb-img { max-width: 92vw; max-height: 88vh; object-fit: contain; border-radius: 8px; cursor: zoom-in; transition: transform .2s; }
.ux-lb-img.zoom { transform: scale(1.8); cursor: zoom-out; }
.ux-lb-close { position: fixed; top: 16px; right: 24px; background: none; border: none; color: #fff; font-size: 34px; cursor: pointer; z-index: 701; }
.ux-lb-cap { position: fixed; bottom: 20px; color: #fff; font-family: var(--mono); font-size: 12px; }
.zoomable { cursor: zoom-in; }

/* ---------- Alertas accionables ---------- */
.alerts-summary { display: flex; gap: 12px; margin-bottom: 18px; }
.s-box { flex: 1; text-align: left; }
.s-box .s-num { font-size: 32px; font-weight: 800; letter-spacing: -1px; }
.s-box .s-lab { font-size: 12px; color: var(--text-3); font-family: var(--mono); text-transform: uppercase; letter-spacing: .06em; }

.filter-pills { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.fpill { padding: 7px 13px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface-2); font-size: 13px; cursor: pointer; font-weight: 600; color: var(--text-2); }
.fpill:hover { background: var(--surface-3); }
.fpill.on { background: var(--accent-purple); color: #fff; border-color: var(--accent-purple); }

.alert { display: flex; gap: 14px; padding: 15px 16px; border: 1px solid var(--border); border-left-width: 4px; border-radius: var(--radius); background: var(--surface-2); box-shadow: var(--shadow-sm); margin-bottom: 10px; }
.alert .a-body { flex: 1; min-width: 0; }
.alert .a-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; flex-wrap: wrap; }
.alert .a-type { font-weight: 700; font-size: 14px; }
.alert .a-where { font-family: var(--mono); font-size: 12px; color: var(--text-3); }
.alert .a-desc { font-size: 13.5px; color: var(--text-2); }
.alert .a-action { margin-top: 9px; font-size: 13px; background: var(--accent-purple-soft); color: var(--accent-purple); padding: 6px 11px; border-radius: 8px; display: inline-block; font-weight: 600; }
.sev { font-size: 10.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; font-family: var(--mono); text-transform: uppercase; letter-spacing: .04em; }

/* ---------- Drill-down ---------- */
.tabs { display: flex; gap: 5px; margin: 16px 0 18px; background: var(--surface-2); border: 1px solid var(--border); padding: 5px; border-radius: 999px; width: fit-content; box-shadow: var(--shadow-sm); }
.tab { padding: 8px 16px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--text-1); }
.tab.on { background: var(--accent-purple); color: #fff; }

.subkpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 16px; }
.subkpi .sk-name { font-size: 13px; color: var(--text-2); font-weight: 600; }
.subkpi .sk-val { font-size: 28px; font-weight: 800; margin: 6px 0 8px; letter-spacing: -.5px; }
.subkpi .sk-w { font-family: var(--mono); font-size: 11px; color: var(--text-3); }

.ob-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--border); font-size: 14px; }
.ob-item:first-child { border-top: none; }
.ob-item .ob-name { flex: 1; }
.ob-item .ob-sub { font-size: 12px; color: var(--text-3); }
.ob-badge { font-size: 10.5px; font-weight: 700; font-family: var(--mono); padding: 3px 9px; border-radius: 999px; }

/* ---------- Evidencia fotográfica ---------- */
.eviz { display: grid; grid-template-columns: 340px 1fr; gap: 22px; align-items: start; }
.eviz + .eviz { margin-top: 0; }
.eviz-imgwrap { position: relative; }
.eviz-img { width: 100%; border-radius: 10px; border: 1px solid var(--border); display: block; background: var(--surface-3); }
.eviz-toggle { position: absolute; top: 8px; right: 8px; background: rgba(36,27,71,.82); color: #fff; border: none; border-radius: 8px; padding: 6px 10px; font-size: 11px; font-family: var(--mono); cursor: pointer; }
.eviz-toggle:hover { background: var(--accent-purple); }
.eviz-meta { font-family: var(--mono); font-size: 12px; color: var(--text-3); margin-bottom: 2px; }
.eviz-store { font-size: 17px; font-weight: 800; margin-bottom: 12px; }
.mini-scores { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.mini { border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; text-align: center; min-width: 80px; }
.mini .m-lab { font-size: 10px; font-family: var(--mono); color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }
.mini .m-val { font-size: 20px; font-weight: 800; letter-spacing: -.5px; }
.finding { font-size: 13.5px; color: var(--text-2); padding: 6px 0; display: flex; gap: 8px; }
.finding .fi-k { color: var(--text-3); min-width: 118px; flex: 0 0 118px; }
.finding b { color: var(--text-1); }

/* ---------- Test vs Control ---------- */
.metrics-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 14px; margin-bottom: 16px; }
.metric-box { text-align: center; }
.metric-box .m-big { font-size: 36px; font-weight: 800; letter-spacing: -1.5px; }
.metric-box .m-lab { font-size: 11px; color: var(--text-3); font-family: var(--mono); text-transform: uppercase; letter-spacing: .05em; margin-top: 6px; }
.metric-box .m-sub { font-size: 12px; color: var(--text-2); margin-top: 4px; }
.tvc { display: flex; gap: 40px; align-items: flex-end; justify-content: center; height: 210px; padding: 14px 0 0; }
.tvc .col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px; }
.tvc .bar-v { width: 76px; border-radius: 12px 12px 0 0; transition: height .4s; }
.tvc .cval { font-weight: 800; font-size: 20px; }
.tvc .clab { font-family: var(--mono); font-size: 12px; color: var(--text-3); }
.tc-method { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }
.tc-method .side { border-radius: var(--radius); padding: 16px 18px; }
.tc-method .side .s-tag { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.tc-method .side h4 { font-size: 15px; margin: 6px 0 4px; }
.tc-method .side p { font-size: 13px; color: var(--text-2); }

/* ---------- Chat ---------- */
.chat { max-width: 840px; }
.mock-banner { display: flex; gap: 8px; align-items: flex-start; background: var(--accent-amber-soft); color: #8a5a12; border: 1px solid #f2dca6; border-radius: var(--radius-sm); padding: 10px 14px; font-size: 13px; margin-bottom: 16px; }
.msgs { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; min-height: 220px; }
.msg { max-width: 80%; padding: 12px 15px; border-radius: 16px; font-size: 14px; line-height: 1.55; }
.msg.user { align-self: flex-end; background: var(--accent-purple); color: #fff; border-bottom-right-radius: 5px; }
.msg.bot { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--border); border-bottom-left-radius: 5px; box-shadow: var(--shadow-sm); }
.msg.bot b { color: var(--text-1); }
.msg.bot ul { margin: 6px 0 0; padding-left: 18px; }
.msg.bot li { margin: 3px 0; }
.suggest { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.schip { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface-2); font-size: 13px; cursor: pointer; color: var(--text-2); }
.schip:hover { background: var(--accent-purple-soft); color: var(--accent-purple); border-color: var(--accent-purple-soft); }
.chat-input { display: flex; gap: 10px; }
.chat-input input { flex: 1; padding: 13px 18px; border: 1px solid var(--border-strong); border-radius: 999px; font-family: var(--font); font-size: 14px; color: var(--text-1); }
.chat-input input:focus { outline: none; border-color: var(--accent-purple); }
.chat-input button { padding: 0 24px; border: none; border-radius: 999px; background: var(--accent-purple); color: #fff; font-weight: 700; cursor: pointer; font-family: var(--font); font-size: 14px; }
.chat-input button:hover { background: var(--accent-purple-600); }

/* ---------- Forms / Admin-Operador ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.field input, .field select { padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 10px; font-family: var(--font); font-size: 14px; color: var(--text-1); background: var(--surface-2); }
.field input:focus, .field select:focus { outline: none; border-color: var(--accent-purple); }
.btn-save { display: inline-flex; align-items: center; justify-content: center; padding: 10px 20px; border: none; border-radius: 10px; background: var(--accent-green); color: #fff; font-weight: 700; font-family: var(--font); font-size: 14px; line-height: 1; cursor: pointer; }
.btn-save:hover { filter: brightness(.96); }
.btn-ghost { padding: 10px 16px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface-2); font-weight: 600; font-family: var(--font); font-size: 13px; cursor: pointer; color: var(--text-2); }
.saved-note { color: #2a9553; font-weight: 600; font-size: 13px; margin-left: 12px; }
.pill-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-weight: 600; font-family: var(--font); font-size: 13px; line-height: 1; cursor: pointer; text-decoration: none; }
.pill-btn:hover { border-color: var(--accent-purple); color: var(--accent-purple); }
.pill-btn.danger { color: #e5484d; border-color: #e5b0b2; }
.pill-btn.danger:hover { border-color: #e5484d; color: #e5484d; }

.flow { display: flex; align-items: center; gap: 0; flex-wrap: wrap; margin: 8px 0 4px; }
.flow-step { flex: 1; min-width: 120px; background: var(--surface-3); border: 1px solid var(--border); border-radius: 12px; padding: 14px; text-align: center; }
.flow-step .fs-n { font-family: var(--mono); font-size: 11px; color: var(--text-3); }
.flow-step .fs-t { font-weight: 700; font-size: 13.5px; margin-top: 2px; }
.flow-step .fs-v { font-size: 22px; font-weight: 800; margin-top: 6px; color: var(--accent-purple); }
.flow-arrow { color: var(--text-3); padding: 0 8px; font-size: 18px; }

.mock-sec h4 { font-size: 14px; font-weight: 700; margin: 18px 0 6px; }
.mock-sec ul { list-style: none; padding: 0; }
.mock-sec li { display: flex; gap: 9px; padding: 5px 0; font-size: 14px; color: var(--text-2); }
.mock-sec li::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-cyan); margin-top: 8px; flex: 0 0 6px; }
pre.payload { background: var(--surface-dark); color: #d9d3f7; border-radius: 12px; padding: 16px; font-family: var(--mono); font-size: 12.5px; overflow: auto; margin-top: 8px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.stat { text-align: center; }
.stat .st-v { font-size: 30px; font-weight: 800; letter-spacing: -1px; }
.stat .st-l { font-size: 11px; font-family: var(--mono); color: var(--text-3); text-transform: uppercase; margin-top: 4px; }

/* ---------- Cola de QA ---------- */
.qa-card { display: grid; grid-template-columns: 130px 1fr; gap: 18px; align-items: start; }
.qa-crop { width: 130px; height: 168px; object-fit: contain; background: var(--surface-3); border-radius: 10px; border: 1px solid var(--border); }
.qa-meta { font-family: var(--mono); font-size: 12px; color: var(--text-3); }
.qa-assign { font-size: 15px; font-weight: 700; margin: 4px 0 2px; }
.qa-cands { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.qa-cand { border: 1px solid var(--border-strong); border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer; background: var(--surface-2); transition: all .12s; }
.qa-cand:hover { background: var(--accent-purple-soft); border-color: var(--accent-purple); }
.qa-cand.assigned { border-color: var(--accent-green); background: var(--accent-green-soft); font-weight: 600; }
.qa-cand .cscore { font-family: var(--mono); color: var(--text-3); font-size: 11px; margin-left: 5px; }
.qa-actions { display: flex; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.qa-done { opacity: .5; }
.qa-resuelto { color: #2a9553; font-weight: 700; font-size: 13px; }

/* ---------- Kit de listas (toolbar / filtros / paginación / bulk) ---------- */
.lst-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.lst-search input { padding: 9px 14px; border: 1px solid var(--border-strong); border-radius: 999px; font-family: var(--font); font-size: 13.5px; min-width: 240px; color: var(--text-1); }
.lst-search input:focus { outline: none; border-color: var(--accent-purple); }
.lst-filter select, .lst-sort select { padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface-2); font-family: var(--font); font-size: 13px; color: var(--text-1); }
.lst-sort { display: flex; gap: 6px; align-items: center; }
.lst-dir { border: 1px solid var(--border-strong); background: var(--surface-2); border-radius: 10px; width: 34px; height: 34px; cursor: pointer; color: var(--text-2); }
.lst-dir:hover { background: var(--accent-purple-soft); }
/* dropdown buscable */
.lst-filter.dd { position: relative; }
.dd-btn { padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface-2); font-family: var(--font); font-size: 13px; color: var(--text-1); cursor: pointer; }
.dd-btn:hover { border-color: var(--accent-purple); }
.dd-panel { position: absolute; z-index: 30; top: 42px; left: 0; width: 240px; background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 8px; }
.dd-search { width: 100%; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: 8px; font-family: var(--font); font-size: 13px; margin-bottom: 6px; }
.dd-list { max-height: 220px; overflow: auto; }
.dd-opt { padding: 8px 10px; border-radius: 8px; font-size: 13.5px; cursor: pointer; }
.dd-opt:hover { background: var(--accent-purple-soft); color: var(--accent-purple); }
.lst-bulk { display: flex; align-items: center; gap: 10px; background: var(--accent-purple-soft); border: 1px solid var(--accent-purple-mid); border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; }
.lst-bulk-n { font-weight: 700; color: var(--accent-purple); font-size: 13.5px; margin-right: 4px; }
.lst-clr { border: none; background: none; color: var(--text-3); cursor: pointer; font-size: 12.5px; text-decoration: underline; }
.lst-pager { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.lst-info { font-size: 12.5px; color: var(--text-3); font-family: var(--mono); }
.lst-pager .lst-pg { border: 1px solid var(--border-strong); background: var(--surface-2); border-radius: 8px; width: 32px; height: 32px; cursor: pointer; color: var(--text-2); font-size: 16px; }
.lst-pager .lst-pg:disabled { opacity: .4; cursor: default; }
.lst-pgn { font-size: 12.5px; color: var(--text-2); font-family: var(--mono); }
.sel-box { width: 16px; height: 16px; cursor: pointer; }
/* nunca scroll horizontal de página: las tablas anchas scrollean dentro de su contenedor */
.lst-body { overflow-x: auto; }
.table-wrap { width: 100%; overflow-x: auto; }
.main { max-width: 100%; }
.ms-native { padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface-2); font-family: var(--font); font-size: 13px; color: var(--text-1); }
.dd.ms { display: inline-block; }

/* ---------- UX kit: tooltips, modales, indicadores, IA ---------- */
.tip { position: relative; display: inline-flex; color: var(--text-3); cursor: help; vertical-align: middle; }
.tip:hover, .tip:focus { color: var(--accent-purple); }
.tip[data-tip]:hover::after, .tip[data-tip]:focus::after, .tip[data-tip].show::after { content: attr(data-tip); position: absolute; bottom: 150%; left: 50%; transform: translateX(-50%); background: var(--surface-dark); color: #fff; padding: 9px 11px; border-radius: 9px; font-size: 12px; font-weight: 500; width: 230px; z-index: 60; box-shadow: var(--shadow-lg); line-height: 1.45; text-align: left; }
.tip[data-tip]:hover::before, .tip[data-tip]:focus::before, .tip[data-tip].show::before { content: ''; position: absolute; bottom: 150%; left: 50%; transform: translateX(-50%) translateY(7px); border: 6px solid transparent; border-top-color: var(--surface-dark); z-index: 60; }

/* foco de teclado visible + ocultar elementos internos al Fabricante */
:focus-visible { outline: 2px solid var(--accent-purple); outline-offset: 2px; border-radius: 6px; }
.role-fabricante .badge, .role-fabricante .nav-legend, .role-fabricante .nav-item .nav-dot { display: none; }

.ai-btn, .detalle-btn { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font); font-size: 12.5px; font-weight: 600; padding: 6px 11px; border-radius: 999px; cursor: pointer; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text-2); }
.ai-btn { color: var(--accent-purple); border-color: var(--accent-purple-soft); background: var(--accent-purple-soft); }
.ai-btn:hover { background: var(--accent-purple); color: #fff; }
.detalle-btn:hover { border-color: var(--accent-purple); color: var(--accent-purple); }
.ind-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.ind-top { display: flex; align-items: center; gap: 8px; }
.ind-top .ico { color: var(--accent-purple); }

.ux-ov { position: fixed; inset: 0; background: rgba(28,18,64,.45); backdrop-filter: blur(2px); z-index: 500; display: flex; align-items: center; justify-content: center; padding: 24px; }
.ux-modal { background: var(--surface-2); border-radius: var(--radius-lg); box-shadow: var(--shadow-xl); max-width: 560px; width: 100%; max-height: 84vh; overflow: auto; position: relative; padding: 26px 28px; }
.ux-modal.wide { max-width: 820px; }
.ux-close { position: absolute; top: 14px; right: 16px; border: none; background: none; font-size: 26px; line-height: 1; color: var(--text-3); cursor: pointer; }
.ux-close:hover { color: var(--text-1); }
.ux-modal-head { font-size: 17px; font-weight: 800; display: flex; align-items: center; gap: 9px; margin-bottom: 14px; padding-right: 30px; }
.ux-modal-head .ico { color: var(--accent-purple); }
#ux-dlg-ov { z-index: 700; }
.ux-dlg { background: var(--surface-2); border-radius: var(--radius-lg); box-shadow: var(--shadow-xl); max-width: 440px; width: 100%; padding: 24px 26px 20px; position: relative; }
.ux-dlg-title { font-size: 16px; font-weight: 800; margin-bottom: 8px; color: var(--text-1); }
.ux-dlg-body { font-size: 14px; line-height: 1.55; color: var(--text-2); }
.ux-dlg-body p { margin: 0 0 4px; white-space: pre-line; }
.ux-dlg-input { width: 100%; margin-top: 12px; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 10px; font-family: var(--font); font-size: 14px; color: var(--text-1); background: var(--surface-2); }
.ux-dlg-acts { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.btn-danger { padding: 11px 20px; border: none; border-radius: 10px; background: #e5484d; color: #fff; font-weight: 700; font-family: var(--font); font-size: 14px; cursor: pointer; }
.btn-danger:hover { filter: brightness(.96); }
.btn-danger:disabled { opacity: .45; cursor: default; filter: none; }
.ux-loading { color: var(--text-3); font-size: 14px; padding: 20px 0; }
.ux-ai { white-space: pre-wrap; font-size: 14.5px; line-height: 1.6; color: var(--text-1); }
.ux-ai-err { color: var(--accent-amber-text); background: var(--accent-amber-soft); padding: 12px 14px; border-radius: 10px; font-size: 13.5px; }
.mdl-kpi { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.mdl-kpi .v { font-size: 30px; font-weight: 800; letter-spacing: -1px; }
.row-click { cursor: pointer; }
.row-click:hover { background: var(--accent-purple-soft); }
.det-box { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.det-box:hover { border-color: var(--accent-purple-mid); box-shadow: var(--shadow-md); }

/* botones-ícono (sin texto) para las acciones de cada indicador */
.icobtn { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text-2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.icobtn:hover { color: var(--accent-purple); border-color: var(--accent-purple-mid); background: var(--accent-purple-soft); }
.icobtn.ai-btn { color: var(--accent-purple); border-color: var(--accent-purple-soft); }
.icobtn.ai-btn:hover { background: var(--accent-purple); color: #fff; }
.ind-tools { display: inline-flex; align-items: center; gap: 6px; }

/* drawer lateral de interpretación IA (no tapa el contenido) */
.ux-drawer { position: fixed; top: 0; right: 0; height: 100vh; width: 380px; max-width: 92vw; background: var(--surface-2); box-shadow: -8px 0 32px rgba(28,18,64,.18); z-index: 500; display: flex; flex-direction: column; padding: 24px 26px; overflow: auto; animation: drwin .22s var(--ease-out); }
.ux-drawer.left { right: auto; left: 0; box-shadow: 8px 0 32px rgba(28,18,64,.18); }
@keyframes drwinL { from { transform: translateX(-34px); opacity: .5; } to { transform: none; opacity: 1; } }
.ux-drawer.left { animation: drwinL .22s var(--ease-out); }
@keyframes drwin { from { transform: translateX(34px); opacity: .5; } to { transform: none; opacity: 1; } }
.ux-dr-close { position: absolute; top: 14px; right: 16px; border: none; background: none; font-size: 24px; line-height: 1; color: var(--text-3); cursor: pointer; }
.ux-dr-close:hover { color: var(--text-1); }
.ux-dr-head { font-size: 16px; font-weight: 800; display: flex; align-items: center; gap: 8px; padding-right: 26px; }
.ux-dr-head .ico { color: var(--accent-purple); }
.ux-dr-sub { font-size: 12px; font-family: var(--mono); color: var(--text-3); margin: 4px 0 16px; }

@media (max-width: 720px) {
  .role-grid { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .dash-top, .pillars { grid-template-columns: 1fr; }
  .alerts-summary { flex-direction: column; }
  .tabs { width: 100%; overflow-x: auto; }
  .eviz { grid-template-columns: 1fr; }
}

/* --- Base de controles de formulario (consistencia global) ---
   Cualquier input/select/textarea "pelado" queda con el estilo de la app.
   Las clases específicas (.lst-search, .chat-input, etc.) siguen mandando por especificidad. */
input:not([type="file"]):not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]),
select, textarea {
  padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: 10px;
  font-family: var(--font); font-size: 14px; color: var(--text-1); background: var(--surface-2);
  box-sizing: border-box;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent-purple); }
input[type="file"] { font-size: 13px; color: var(--text-2); max-width: 100%; }
input[type="file"]::file-selector-button {
  padding: 8px 13px; margin-right: 12px; border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--surface-2); color: var(--text-1); font-family: var(--font); font-size: 13px; cursor: pointer;
}
input[type="file"]::file-selector-button:hover { background: var(--accent-purple-soft); border-color: var(--accent-purple); }

.clasif-strip { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.clasif-b { flex: 1; min-width: 120px; background: var(--surface-1); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.clasif-b span:last-child { font-size: 12.5px; color: var(--text-2); }
.clasif-n { font-size: 26px; font-weight: 700; line-height: 1; }

/* menú de opciones dentro de un diálogo (uxElegir) */
.ux-dlg-opts { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.ux-opt { display: flex; gap: 9px; align-items: flex-start; padding: 9px 11px; border: 1px solid var(--line, #e6e2ee);
          border-radius: 9px; cursor: pointer; font-size: 13.5px; line-height: 1.35; }
.ux-opt:hover { background: var(--bg-2, #faf9fd); }
.ux-opt input { margin-top: 2px; }
/* área útil de la foto */
.roi-shade { position: absolute; inset: 0; background: rgba(20,16,38,.55); pointer-events: none; }
.roi-box { position: absolute; border: 3px dashed #2a9553; border-radius: 4px; pointer-events: none; }
.roi-tag { position: absolute; top: -20px; left: 0; background: #2a9553; color: #fff; font-size: 10px;
           font-weight: 700; padding: 1px 7px; border-radius: 5px; white-space: nowrap; }

/* editor de foto de referencia (Biblioteca) */
.ed-wrap { display: flex; flex-direction: column; gap: 10px; }
.ed-stage { position: relative; overflow: hidden; background: #14101f; border-radius: 10px;
            display: flex; align-items: center; justify-content: center; min-height: 340px; max-height: 62vh; }
.ed-frame { position: relative; line-height: 0; transform-origin: center center; transition: transform .12s ease; touch-action: none; }
.ed-frame img { max-width: 100%; max-height: 62vh; display: block; cursor: crosshair; user-select: none; -webkit-user-drag: none; }
.ed-sel { position: absolute; border: 2px solid #2a9553; background: rgba(42,149,83,.12);
          box-shadow: 0 0 0 9999px rgba(10,8,20,.45); cursor: move; }
.eh { position: absolute; width: 12px; height: 12px; background: #fff; border: 2px solid #2a9553;
      border-radius: 3px; }
.eh-nw { left: -7px; top: -7px; cursor: nwse-resize; }
.eh-n  { left: 50%; top: -7px; margin-left: -6px; cursor: ns-resize; }
.eh-ne { right: -7px; top: -7px; cursor: nesw-resize; }
.eh-e  { right: -7px; top: 50%; margin-top: -6px; cursor: ew-resize; }
.eh-se { right: -7px; bottom: -7px; cursor: nwse-resize; }
.eh-s  { left: 50%; bottom: -7px; margin-left: -6px; cursor: ns-resize; }
.eh-sw { left: -7px; bottom: -7px; cursor: nesw-resize; }
.eh-w  { left: -7px; top: 50%; margin-top: -6px; cursor: ew-resize; }
.ed-tools { display: flex; flex-direction: column; gap: 8px; }
.ed-hint { font-size: 12.5px; color: var(--text-3, #6b6580); }
.ed-btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ed-btns .btn-save { margin-left: auto; }
.ed-todas { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2, #4a4460); cursor: pointer; }
.gal-item img[data-edit] { cursor: zoom-in; }

/* aviso de proceso terminado */
.ux-aviso { position: fixed; right: 18px; bottom: 18px; z-index: 9999; display: none;
            align-items: center; gap: 10px; max-width: 380px; padding: 12px 14px;
            background: #fff; border: 1px solid var(--line, #e6e2ee); border-left: 4px solid #2a9553;
            border-radius: 10px; box-shadow: 0 10px 30px rgba(20,16,38,.18); font-size: 13.5px; }
.ux-aviso.err { border-left-color: #e5484d; }
.ux-aviso b { display: block; color: var(--text-1, #211d2e); }
.ux-aviso span { display: block; color: var(--text-3, #6b6580); font-size: 12.5px; margin-top: 2px; }
.ux-aviso button { margin-left: auto; background: none; border: none; font-size: 18px; line-height: 1;
                   color: var(--text-3, #6b6580); cursor: pointer; padding: 0 2px; }
