/* =====================================================================
   RA Gestión · Sistema de diseño
   Tipografía Inter · tokens de color (claro / oscuro / automático)
   Escala de espacios de 4 px · radios suaves · movimiento sutil
   ===================================================================== */

/* ---------- Tokens: tema claro (por defecto) ---------- */
:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --card-2: #f8f9fb;
  --card-3: #eef1f6;
  --head: #f9fafb;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e4e8ef;
  --line-2: #d0d7e2;

  --navy: #14213d;
  --navy-2: #22335a;
  --brand: #22406f;
  --brand-2: #2f5596;
  --brand-dark: #14213d;
  --brand-soft: #edf2fa;
  --link: #24508f;
  --gold: #c9a24a;
  --gold-2: #8f6b1c;
  --gold-soft: #faf3e1;

  --primary: #14213d;
  --primary-ink: #ffffff;
  --primary-hover: #24365f;
  --pill: #14213d;
  --pill-ink: #ffffff;

  --ok: #157f3c;   --ok-soft: #e7f6ed;
  --bad: #c0262d;  --bad-soft: #fdecec;
  --warn: #b45309; --warn-soft: #fef4e4;
  --info: #1d6fd1; --info-soft: #e9f2fd;

  --c1: #22406f; --c2: #3b82c4; --c3: #d4508a; --c4: #d98a1c;
  --c5: #1f9d55; --c6: #7c5cc4; --c7: #d14343; --c8: #14988c;

  --hdr-bg: #14213d;
  --sec-bg: #14213d;
  --tip-bg: #0f172a; --tip-ink: #ffffff;
  --overlay: rgba(15, 23, 42, .45);

  --radius: 12px; --r-sm: 8px; --r-lg: 16px;
  --sh-1: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 1px 3px rgba(15, 23, 42, .07), 0 1px 2px rgba(15, 23, 42, .04);
  --sh-pop: 0 20px 44px -12px rgba(15, 23, 42, .30), 0 6px 14px -6px rgba(15, 23, 42, .12);
  --focus: 0 0 0 3px rgba(201, 162, 74, .40);
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}

/* ---------- Tokens: tema oscuro ---------- */
:root[data-theme="dark"] {
  --bg: #0b1120; --card: #111a2e; --card-2: #152039; --card-3: #1b2844; --head: #131d34;
  --ink: #e8edf6; --ink-2: #c5cddd; --muted: #8e9ab4; --line: #22304d; --line-2: #314266;
  --navy: #0a1224; --navy-2: #1c2a49; --brand: #8fb1ec; --brand-2: #a9c4f3; --brand-dark: #0a1224;
  --brand-soft: rgba(143, 177, 236, .12); --link: #9dbcf3;
  --gold: #d4af5a; --gold-2: #e3c47e; --gold-soft: rgba(212, 175, 90, .14);
  --primary: #d4af5a; --primary-ink: #14213d; --primary-hover: #e1c174; --pill: #d4af5a; --pill-ink: #14213d;
  --ok: #4cc38a; --ok-soft: rgba(76, 195, 138, .13); --bad: #f07a7a; --bad-soft: rgba(240, 122, 122, .13);
  --warn: #f0b354; --warn-soft: rgba(240, 179, 84, .13); --info: #6aa8f0; --info-soft: rgba(106, 168, 240, .13);
  --c1: #7aa2e8; --c2: #4fb3e8; --c3: #ec7bae; --c4: #f0a84a; --c5: #4cc38a; --c6: #a58bea; --c7: #f07a7a; --c8: #3cc4b6;
  --hdr-bg: #0a1224; --sec-bg: #1c2a49; --tip-bg: #e8edf6; --tip-ink: #0f172a; --overlay: rgba(2, 6, 16, .66);
  --sh-1: 0 1px 2px rgba(0, 0, 0, .3); --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 0 0 1px rgba(255, 255, 255, .02);
  --sh-pop: 0 24px 50px -12px rgba(0, 0, 0, .65); --focus: 0 0 0 3px rgba(212, 175, 90, .45);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --bg: #0b1120; --card: #111a2e; --card-2: #152039; --card-3: #1b2844; --head: #131d34;
    --ink: #e8edf6; --ink-2: #c5cddd; --muted: #8e9ab4; --line: #22304d; --line-2: #314266;
    --navy: #0a1224; --navy-2: #1c2a49; --brand: #8fb1ec; --brand-2: #a9c4f3; --brand-dark: #0a1224;
    --brand-soft: rgba(143, 177, 236, .12); --link: #9dbcf3;
    --gold: #d4af5a; --gold-2: #e3c47e; --gold-soft: rgba(212, 175, 90, .14);
    --primary: #d4af5a; --primary-ink: #14213d; --primary-hover: #e1c174; --pill: #d4af5a; --pill-ink: #14213d;
    --ok: #4cc38a; --ok-soft: rgba(76, 195, 138, .13); --bad: #f07a7a; --bad-soft: rgba(240, 122, 122, .13);
    --warn: #f0b354; --warn-soft: rgba(240, 179, 84, .13); --info: #6aa8f0; --info-soft: rgba(106, 168, 240, .13);
    --c1: #7aa2e8; --c2: #4fb3e8; --c3: #ec7bae; --c4: #f0a84a; --c5: #4cc38a; --c6: #a58bea; --c7: #f07a7a; --c8: #3cc4b6;
    --hdr-bg: #0a1224; --sec-bg: #1c2a49; --tip-bg: #e8edf6; --tip-ink: #0f172a; --overlay: rgba(2, 6, 16, .66);
    --sh-1: 0 1px 2px rgba(0, 0, 0, .3); --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 0 0 1px rgba(255, 255, 255, .02);
    --sh-pop: 0 24px 50px -12px rgba(0, 0, 0, .65); --focus: 0 0 0 3px rgba(212, 175, 90, .45);
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(116px + env(safe-area-inset-top)); }
/* iPhone/iPad: la zona de la hora siempre azul marino. iOS 26 ignora theme-color y tiñe esa franja
   con el fondo de la página, salvo que haya un elemento FIJO pegado al borde superior. */
body::before { content: ""; position: fixed; top: 0; left: 0; right: 0; height: env(safe-area-inset-top); background: var(--hdr-bg); z-index: 50; pointer-events: none; }
@media (hover: none) and (pointer: coarse) { html { background-color: var(--hdr-bg); } }
body {
  background: var(--bg); color: var(--ink); min-height: 100vh; min-height: 100dvh;
  font: 14px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
@media (min-width: 1800px) { body { font-size: 14.5px; } }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
::selection { background: color-mix(in srgb, var(--gold) 35%, transparent); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
main:focus { outline: none; }
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
.num, .tbl td.right, .kpi .val, .stat .val, .price { font-variant-numeric: tabular-nums; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 300; background: var(--card); color: var(--ink); padding: 8px 14px; border-radius: 8px; box-shadow: var(--sh-pop); }
.skip:focus { left: 12px; }

@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.985); } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(18px); } }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Pantalla de carga inicial ---------- */
.boot { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; align-content: center; gap: 18px; color: var(--muted); text-align: center; padding: 24px; }
.boot img { width: 64px; height: 64px; border-radius: 16px; box-shadow: var(--shadow); }
.spin { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--line-2); border-top-color: var(--gold); animation: spin .8s linear infinite; margin: 0 auto; }

/* ---------- Encabezado ---------- */
.app-hdr { position: fixed; top: 0; left: 0; right: 0; z-index: 40; height: calc(56px + env(safe-area-inset-top)); display: flex; align-items: center; gap: 12px; padding: env(safe-area-inset-top) 16px 0; background: var(--hdr-bg); color: #fff; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; letter-spacing: -.01em; white-space: nowrap; color: #fff; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.brand b { color: var(--gold); font-weight: 700; }
.cmdk-btn { flex: 1; max-width: 560px; margin: 0 auto; height: 36px; display: flex; align-items: center; gap: 10px; padding: 0 6px 0 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.07); color: rgba(255,255,255,.7); cursor: pointer; text-align: left; transition: background .15s, border-color .15s; }
.cmdk-btn:hover { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.26); }
.cmdk-btn > svg { width: 16px; height: 16px; flex: none; }
.cmdk-btn > span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
kbd { display: inline-flex; align-items: center; gap: 2px; font: 600 11px/1 "Inter", system-ui, sans-serif; padding: 4px 6px; border-radius: 6px; border: 1px solid var(--line-2); border-bottom-width: 2px; background: var(--card-2); color: var(--muted); white-space: nowrap; }
.cmdk-btn kbd { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18); color: rgba(255,255,255,.75); }
.hdr-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.hbtn { position: relative; width: 36px; height: 36px; border-radius: 10px; border: 0; background: transparent; color: rgba(255,255,255,.82); display: grid; place-items: center; cursor: pointer; flex: none; transition: background .15s, color .15s; }
.hbtn:hover { background: rgba(255,255,255,.1); color: #fff; }
.hbtn svg { width: 18px; height: 18px; }
.hbtn .badge { position: absolute; top: 2px; right: 1px; border: 2px solid var(--hdr-bg); }
.avatar-me { width: 34px; height: 34px; margin-left: 6px; border-radius: 50%; background: var(--gold); color: #14213d; display: grid; place-items: center; font-weight: 700; font-size: 12.5px; border: 2px solid rgba(255,255,255,.22); cursor: pointer; flex: none; transition: box-shadow .15s; }
.avatar-me:hover { box-shadow: 0 0 0 3px rgba(201,162,74,.35); }

/* ---------- Navegación por pestañas ---------- */
.app-hdr + .app-nav { margin-top: calc(56px + env(safe-area-inset-top)); }
.app-nav { position: sticky; top: calc(56px + env(safe-area-inset-top)); z-index: 39; height: 52px; display: flex; align-items: center; gap: 6px; padding: 0 12px; background: color-mix(in srgb, var(--card) 90%, transparent); -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.launcher { width: 36px; height: 36px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; flex: none; transition: background .15s, color .15s; }
.launcher:hover { background: var(--card-3); color: var(--ink); }
.launcher svg { width: 18px; height: 18px; }
.tabs { display: flex; align-items: center; gap: 2px; height: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabw { position: relative; display: flex; align-items: center; height: 34px; border-radius: 999px; transition: background .15s; flex: none; }
.tabw:hover { background: var(--card-3); }
.tabw.on { background: var(--pill); }
.tab { height: 100%; border: 0; background: none; padding: 0 4px 0 14px; color: var(--ink-2); font-weight: 500; font-size: 13.5px; white-space: nowrap; cursor: pointer; border-radius: 999px 0 0 999px; }
.tab.solo { padding-right: 14px; border-radius: 999px; }
.tabw.on .tab, .tabw.on .tabdd { color: var(--pill-ink); }
.tabw.on .tab { font-weight: 600; }
.tabdd { height: 100%; width: 26px; border: 0; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; border-radius: 0 999px 999px 0; }
.tabdd svg { width: 13px; height: 13px; }
.badge { display: inline-grid; place-items: center; min-width: 17px; height: 17px; padding: 0 5px; border-radius: 99px; background: var(--bad); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 1; }
.tabw .badge { position: absolute; top: -4px; right: -3px; }

/* ---------- Contenido ---------- */
main { width: 100%; padding: 22px 24px 56px; }
main.enter > * { animation: rise .24s var(--ease) both; }
main.enter > *:nth-child(2) { animation-delay: .02s; }
main.enter > *:nth-child(3) { animation-delay: .04s; }
main.enter > *:nth-child(n+4) { animation-delay: .06s; }
.only-m { display: none !important; }
.mnav { display: none; }

/* ---------- Encabezado de página ---------- */
.page-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 2px 0 0; font-size: 22px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
.page-head select.inp { width: auto; min-width: 170px; }
.obj-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: #fff; flex: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,.14), var(--sh-1); }
.obj-icon svg { width: 19px; height: 19px; }
.eyebrow { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); line-height: 1.3; }
.spacer { flex: 1; }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 10px; display: flex; gap: 6px; align-items: center; }

/* ---------- Tarjetas ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.pad { padding: 18px; }
.card-h { display: flex; align-items: center; gap: 10px; margin: -18px -18px 16px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card-h h3 { margin: 0; font-size: 14.5px; font-weight: 600; letter-spacing: -.01em; }
.card-h .ci { width: 28px; height: 28px; border-radius: 8px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; }
.card-h .ci svg { width: 15px; height: 15px; }
.card-h .opt { margin-left: auto; color: var(--muted); font-size: 12.5px; }

/* ---------- Botones ---------- */
.btn { --spin: var(--muted); position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--card); color: var(--ink); font-weight: 500; font-size: 13.5px; white-space: nowrap; cursor: pointer; box-shadow: var(--sh-1); transition: background .15s, border-color .15s, box-shadow .15s, transform .06s; }
.btn:hover { background: var(--card-2); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 15px; height: 15px; flex: none; }
.btn.primary, .btn.gold { --spin: var(--primary-ink); background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.primary:hover, .btn.gold:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.btn.danger-solid { --spin: #fff; background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.danger-solid:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--ink-2); }
.btn.ghost:hover { background: var(--card-3); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.loading { color: transparent !important; pointer-events: none; }
.btn.loading > * { visibility: hidden; }
.btn.loading::after { content: ""; position: absolute; inset: 0; margin: auto; width: 16px; height: 16px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--spin) 30%, transparent); border-top-color: var(--spin); animation: spin .7s linear infinite; }
.btn kbd { margin-left: 2px; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.btn-group .btn:only-child { border-radius: var(--r-sm); }
.btns { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.link { background: none; border: 0; padding: 0; color: var(--link); font-weight: 500; cursor: pointer; }
.link:hover { text-decoration: underline; }
.icon-btn { width: 36px; height: 36px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--card); color: var(--muted); display: grid; place-items: center; cursor: pointer; flex: none; box-shadow: var(--sh-1); transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--card-2); color: var(--ink); }
.icon-btn.on { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.icon-btn svg { width: 16px; height: 16px; }

/* ---------- Formularios ---------- */
.inp, select.inp, textarea.inp { width: 100%; height: 38px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--card); color: var(--ink); font-size: 14px; outline: none; transition: border-color .15s, box-shadow .15s, background .15s; }
.inp::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
.inp:hover { border-color: color-mix(in srgb, var(--line-2) 55%, var(--muted)); }
.inp:focus { border-color: var(--gold); box-shadow: var(--focus); }
.inp[readonly] { background: var(--card-2); color: var(--muted); }
select.inp { appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a0b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; }
select.inp option { background: var(--card); color: var(--ink); }
textarea.inp { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.f label { display: block; margin-bottom: 6px; font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.f .hint { margin-top: 6px; font-size: 12px; color: var(--muted); }
.f.invalid .inp { border-color: var(--bad); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 18%, transparent); }
.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13.5px; color: var(--ink) !important; font-weight: 400 !important; }
.check input { width: 17px; height: 17px; accent-color: var(--primary); margin: 0; }
.search { position: relative; }
.search > svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.search .inp { padding-left: 36px; }
.phone { display: flex; }
.phone > span { display: flex; align-items: center; padding: 0 12px; border: 1px solid var(--line-2); border-right: 0; border-radius: var(--r-sm) 0 0 var(--r-sm); background: var(--card-2); color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.phone .inp { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.pw { position: relative; }
.pw .inp { padding-right: 44px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 34px; height: 32px; border: 0; background: none; color: var(--muted); border-radius: 6px; display: grid; place-items: center; cursor: pointer; }
.pw-eye:hover { color: var(--ink); background: var(--card-3); }
.pw-eye svg { width: 17px; height: 17px; }
.caps { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12px; font-weight: 500; color: var(--warn); }
.caps::before { content: "⇪"; font-size: 13px; }
.num-fmt { font-variant-numeric: tabular-nums; }

.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.filters .grow { flex: 1 1 240px; }
.filters .inp { width: auto; min-width: 160px; }
.filters .grow .inp { width: 100%; }

/* ---------- Chips y estados ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px; background: var(--card-3); color: var(--ink-2); font-size: 12px; font-weight: 500; white-space: nowrap; line-height: 1; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; flex: none; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.info { background: var(--info-soft); color: var(--info); }
.chip.gold, .chip.brand { background: var(--gold-soft); color: var(--gold-2); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.right { text-align: right; }
.pos { color: var(--ok); } .neg { color: var(--bad); }
.notice { display: block; padding: 12px 14px 12px 40px; margin-bottom: 16px; border-radius: var(--radius); background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 25%, transparent); color: var(--ink); font-size: 13.5px; position: relative; }
.notice::before { content: "!"; position: absolute; left: 13px; top: 12px; width: 18px; height: 18px; border-radius: 50%; background: var(--warn); color: #fff; font-weight: 800; font-size: 12px; display: grid; place-items: center; }
.notice b { color: var(--warn); }
.empty { text-align: center; padding: 44px 16px; color: var(--muted); }
.empty::before { content: ""; display: block; width: 48px; height: 48px; margin: 0 auto 14px; border-radius: 14px; background: var(--card-3) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a0b8' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 12h-6l-2 3h-4l-2-3H2'/%3E%3Cpath d='M5.45 5.11L2 12v6a2 2 0 002 2h16a2 2 0 002-2v-6l-3.45-6.89A2 2 0 0016.76 4H7.24a2 2 0 00-1.79 1.11z'/%3E%3C/svg%3E") center / 24px no-repeat; }
.empty b { display: block; margin-bottom: 4px; color: var(--ink); font-size: 15px; font-weight: 600; }
.empty.small { padding: 22px 10px; font-size: 13px; }
.empty.small::before { width: 36px; height: 36px; border-radius: 10px; background-size: 18px; margin-bottom: 8px; }

/* ---------- Avatares ---------- */
.av { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .02em; flex: none; vertical-align: middle; margin-right: 9px; }
.av.sm { width: 22px; height: 22px; font-size: 9.5px; margin-right: 7px; }
.av.lg { width: 40px; height: 40px; font-size: 14px; margin-right: 0; }
.av.sq { border-radius: 8px; width: 32px; height: 32px; }
.who { display: inline-flex; align-items: center; min-width: 0; }

/* ---------- Dashboard ---------- */
.dash-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.dash-hero h1 { margin: 4px 0 0; font-size: 26px; font-weight: 700; letter-spacing: -.025em; line-height: 1.15; }
.dash-hero p { margin: 6px 0 0; color: var(--muted); }
.dash-hero select.inp { width: auto; min-width: 180px; }
.qa { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.qa .btn { height: 38px; border-radius: 10px; }
.qa .btn svg { color: var(--gold-2); }
.qa .btn.ghost svg { color: var(--muted); }
.onb { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 20px; padding: 18px; margin-bottom: 18px; background: linear-gradient(120deg, var(--card) 40%, var(--gold-soft)); }
.onb h3 { margin: 6px 0 4px; font-size: 17px; letter-spacing: -.015em; }
.onb .progress { margin: 12px 0 10px; }
.progress { height: 6px; border-radius: 99px; background: var(--card-3); overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--gold), color-mix(in srgb, var(--gold) 70%, #fff)); transition: width .4s var(--ease); }
.onb-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.onb-step { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); text-align: left; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.onb-step:hover:not(:disabled) { border-color: var(--gold); box-shadow: var(--shadow); transform: translateY(-1px); }
.onb-step:disabled { cursor: default; opacity: .7; }
.onb-step b { display: block; font-size: 13.5px; font-weight: 600; }
.onb-step small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; line-height: 1.4; }
.onb-step .ck { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); flex: none; display: grid; place-items: center; margin-top: 1px; color: #fff; }
.onb-step.done .ck { background: var(--ok); border-color: var(--ok); }
.onb-step.done b { text-decoration: line-through; color: var(--muted); }
.onb-step .ck svg { width: 12px; height: 12px; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat { padding: 16px 18px 14px; display: flex; flex-direction: column; min-width: 0; }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.stat-top > span { display: inline-flex; align-items: center; gap: 6px; }
.stat .val { font-size: 26px; font-weight: 700; letter-spacing: -.03em; line-height: 1.15; margin: 8px 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-sub { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.stat-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 10px; border-top: 1px dashed var(--line); }
.spark { width: 92px; height: 30px; flex: none; }
.delta { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.delta.up { color: var(--ok); background: var(--ok-soft); }
.delta.down { color: var(--bad); background: var(--bad-soft); }
.delta.flat { color: var(--muted); background: var(--card-3); }
.info { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; color: var(--muted); cursor: help; }
.info svg { width: 14px; height: 14px; }
.info:hover { color: var(--ink); }
.kpi { --kc: var(--brand); padding: 16px; display: flex; gap: 14px; align-items: flex-start; min-width: 0; border-left: 3px solid var(--kc); }
.kpi .ki { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--kc) 13%, transparent); color: var(--kc); }
.kpi .ki svg { width: 20px; height: 20px; }
.kpi .lbl { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.kpi .val { font-size: 22px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

.dgrid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; }
.c3 { grid-column: span 3; } .c4 { grid-column: span 4; } .c5 { grid-column: span 5; } .c6 { grid-column: span 6; } .c7 { grid-column: span 7; } .c8 { grid-column: span 8; } .c12 { grid-column: span 12; }
.chart svg { width: 100%; height: auto; display: block; max-height: 380px; overflow: visible; }
.chart text { fill: var(--muted); font-size: 11px; }
.chart .hov { fill: transparent; cursor: crosshair; }
.chart .hov:hover { fill: color-mix(in srgb, var(--brand) 7%, transparent); }
.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 12.5px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.ringwrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.ringwrap .ring { flex: none; }
.ring circle[data-tip] { cursor: pointer; transition: opacity .15s; }
.ring:hover circle[data-tip]:not(:hover) { opacity: .55; }
.statlist { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 170px; }
.statlist li { display: flex; align-items: center; gap: 9px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.statlist li:last-child { border-bottom: 0; }
.statlist li span:last-child { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }
.statlist i { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.big { font-size: 26px; font-weight: 700; letter-spacing: -.025em; }
.hbar { margin-bottom: 13px; }
.hbar .row { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; font-size: 13px; }
.hbar .row span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .track { height: 7px; border-radius: 99px; background: var(--card-3); overflow: hidden; }
.hbar .fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--c1), color-mix(in srgb, var(--c1) 60%, var(--c2))); transition: width .5s var(--ease); }
.pl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.pl td { padding: 7px 0; border-bottom: 1px solid var(--line); }
.pl td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.pl tr.sub td { font-weight: 600; }
.pl tr.total td { border-bottom: 0; border-top: 2px solid var(--ink); padding-top: 9px; font-weight: 700; }
.pl .ind { padding-left: 12px; color: var(--muted); }
.list-row { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.list-row b { font-weight: 600; }
.list-row small { display: block; color: var(--muted); font-size: 12px; }
.list-row > div { min-width: 0; }
.list-row > div > b, .list-row > div > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Tablas ---------- */
.list { overflow: hidden; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.tbl th { text-align: left; padding: 10px 14px; background: var(--head); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.tbl th.sort { cursor: pointer; user-select: none; transition: color .15s; }
.tbl th.sort:hover { color: var(--ink); }
.tbl th .ar { margin-left: 4px; font-size: 10px; color: var(--gold-2); }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover td { background: var(--card-2); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; }
.tbl td.rn { width: 42px; color: var(--muted); font-size: 12px; text-align: right; }
.tbl td.act { width: 44px; text-align: right; }
.tbl .lnk { background: none; border: 0; padding: 0; color: var(--ink); font-weight: 600; text-align: left; cursor: pointer; }
.tbl tr:hover .lnk { color: var(--link); }
.tbl tr.anul td { opacity: .5; text-decoration: line-through; }
.tbl tr.anul td:last-child { opacity: 1; text-decoration: none; }
.tbl tr.off td { color: var(--muted); }
.tbl .detail td { background: var(--card-2) !important; }
.tbl th.right, .tbl td.right { text-align: right; }
.rowdd { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--card); color: var(--muted); display: inline-grid; place-items: center; cursor: pointer; transition: color .15s, background .15s; }
.rowdd:hover { color: var(--ink); background: var(--card-3); }
.rowdd svg { width: 13px; height: 13px; }
.lines { width: 100%; border-collapse: collapse; font-size: 13px; }
.lines td { padding: 5px 0; border: 0; background: none !important; }
.scroll-x { overflow-x: auto; }
.psku { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 11.5px; color: var(--muted); }
.thumb { width: 32px; height: 32px; border-radius: 8px; object-fit: cover; vertical-align: middle; margin-right: 9px; border: 1px solid var(--line); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; }

/* ---------- Vistas de lista (CRM) ---------- */
.lv { overflow: hidden; }
.lv-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 16px 18px 8px; }
.lv-title select { max-width: 100%; border: 0; outline: none; background-color: transparent; color: var(--ink); font-size: 18px; font-weight: 700; letter-spacing: -.015em; padding: 0 24px 0 0; cursor: pointer; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a0b8' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 2px center; background-size: 16px; }
.lv-title select option { font-size: 14px; font-weight: 400; background: var(--card); }
.lv-meta { font-size: 12.5px; color: var(--muted); }
.lv-tools { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; padding: 4px 18px 12px; }
.lv-tools .search { width: 300px; max-width: 100%; }
.lv-body { display: flex; border-top: 1px solid var(--line); }
.lv-body > .scroll-x { flex: 1; min-width: 0; }
.lv-filters { width: 280px; flex: none; padding: 14px; border-left: 1px solid var(--line); background: var(--card-2); }
.lv-filters h4 { margin: 0 0 12px; font-size: 14.5px; display: flex; justify-content: space-between; align-items: center; }
.lv-filters .f { margin-bottom: 10px; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); }
.crm-nav { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.crm-title { display: flex; align-items: center; gap: 12px; }
.crm-title b { display: block; font-size: 22px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; margin-left: auto; padding: 4px; border-radius: 999px; background: var(--card-3); border: 1px solid var(--line); }
.seg button { display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border: 0; border-radius: 999px; background: none; color: var(--ink-2); font-weight: 500; cursor: pointer; transition: background .15s, color .15s; }
.seg button svg { width: 16px; height: 16px; }
.seg button em { font-style: normal; font-size: 11.5px; font-weight: 600; padding: 0 7px; line-height: 18px; border-radius: 99px; background: var(--card); color: var(--ink); }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--pill); color: var(--pill-ink); box-shadow: var(--sh-1); }
.seg button.on em { background: var(--gold); color: #14213d; }

/* ---------- Ficha de registro ---------- */
.rec-head { padding: 16px 18px; margin-bottom: 14px; }
.rec-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.rec-top h1 { margin: 2px 0 0; font-size: 21px; font-weight: 700; letter-spacing: -.02em; }
.rec-fields { display: flex; flex-wrap: wrap; gap: 10px 44px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.rec-fields small { display: block; color: var(--muted); font-size: 12px; margin-bottom: 2px; }
.path { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 16px; margin-bottom: 14px; }
.path ol { list-style: none; margin: 0; padding: 0; display: flex; flex: 1; min-width: 300px; overflow-x: auto; counter-reset: paso; }
.path li { flex: 1; min-width: 92px; position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 2px 6px; color: var(--muted); font-size: 12.5px; text-align: center; cursor: pointer; white-space: nowrap; }
.path li::before { counter-increment: paso; content: counter(paso); position: relative; z-index: 1; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--card); border: 2px solid var(--line-2); color: var(--muted); font-weight: 700; font-size: 13px; transition: transform .15s; }
.path li::after { content: ""; position: absolute; top: 17px; left: calc(-50% + 15px); right: calc(50% + 15px); height: 2px; background: var(--line-2); }
.path li:first-child::after { display: none; }
.path li:hover { color: var(--ink); }
.path li:hover::before { transform: scale(1.06); }
.path li.done { color: var(--ok); }
.path li.done::before { content: "\2713"; background: var(--ok); border-color: var(--ok); color: #fff; }
.path li.done::after, .path li.cur::after, .path li.won::after, .path li.lost::after { background: var(--ok); }
.path li.cur { color: var(--ink); font-weight: 600; }
.path li.cur::before { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); box-shadow: 0 0 0 5px color-mix(in srgb, var(--primary) 14%, transparent); }
.path li.won { color: var(--ok); font-weight: 600; }
.path li.won::before { content: "\2605"; background: var(--gold); border-color: var(--gold); color: #14213d; }
.path li.lost { color: var(--bad); font-weight: 600; }
.path li.lost::before { content: "\2715"; background: var(--bad); border-color: var(--bad); color: #fff; }
.rec-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 30%); gap: 14px; align-items: start; }
.rtabs { display: flex; gap: 4px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.rtabs { overflow-x: auto; scrollbar-width: none; }
.rtabs::-webkit-scrollbar { display: none; }
.rtabs button { flex: none; white-space: nowrap; padding: 12px 10px 10px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font-weight: 500; cursor: pointer; margin-bottom: -1px; }
.rtabs button:hover { color: var(--ink); }
.rtabs button.on { color: var(--ink); font-weight: 600; border-bottom-color: var(--gold); }
.rtab-body { padding: 16px 18px; }
.act-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.act-bar .btn svg { color: var(--muted); }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.tl-item { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.tl-item:last-child { border-bottom: 0; }
.tl-ico { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; flex: none; box-shadow: 0 0 0 4px var(--card); }
.tl-ico svg { width: 15px; height: 15px; }
.tl-body { flex: 1; min-width: 0; }
.tl-body b { font-weight: 600; }
.tl-body p { margin: 4px 0 0; white-space: pre-wrap; color: var(--ink-2); }
.tl-item.done .tl-body b { text-decoration: line-through; color: var(--muted); }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
.fields > div { padding: 10px 0; border-bottom: 1px solid var(--line); }
.fields small { display: block; color: var(--muted); font-size: 12px; margin-bottom: 2px; }
.related { display: flex; flex-direction: column; gap: 14px; }
.rel { overflow: hidden; }
.rel-h { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.rel-h h3 { margin: 0; flex: 1; font-size: 14px; font-weight: 600; }
.rel-h .obj-icon { width: 26px; height: 26px; border-radius: 8px; }
.rel-h .obj-icon svg { width: 14px; height: 14px; }
.rel-b { padding: 8px 16px 10px; }
.rel-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.rel-row:last-child { border-bottom: 0; }
.rel-empty { padding: 8px 0; color: var(--muted); }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kv div { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--card-2); }
.kv small { display: block; color: var(--muted); font-size: 11.5px; }
.kv b { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }

/* ---------- Ficha 360° del cliente ---------- */
.cli-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.cli-kpis > div { min-width: 0; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card-2); }
.cli-kpis small { display: block; color: var(--muted); font-size: 11.5px; font-weight: 500; }
.cli-kpis b { display: block; margin-top: 2px; font-size: 18px; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cli-kpis span { display: block; margin-top: 1px; color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cli-kpis > div:first-child { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 18%, transparent); }
.buys { display: flex; flex-direction: column; gap: 10px; }
.buy { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.buy-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 10px 14px; background: var(--card-2); }
.buy-h > b { font-size: 15px; }
.buy-m { margin-top: 2px; color: var(--muted); font-size: 12px; }
.buy-l > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 14px; border-top: 1px solid var(--line); font-size: 13.5px; }
.buy-l > div > span:last-child { flex: none; color: var(--ink-2); }
.buy-tot { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; padding: 10px 14px; border-radius: 10px; background: var(--brand-soft); color: var(--muted); }
.buy-tot b { color: var(--ink); font-size: 16px; }
.rel-row .btns { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 1400px) { .cli-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) { .cli-kpis { grid-template-columns: 1fr 1fr; gap: 8px; } .cli-kpis b { font-size: 16px; } .rec-top .btn-group { width: 100%; flex-wrap: wrap; gap: 6px; } .rec-top .btn-group .btn { flex: 1 1 auto; margin-left: 0; border-radius: var(--r-sm); } .rec-top .btn-group .btn.primary { flex: 1 1 100%; } .buy-l > div { flex-direction: column; gap: 2px; } }

/* ---------- Menús desplegables ---------- */
.dd { position: absolute; z-index: 70; min-width: 240px; max-width: 340px; padding: 6px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); box-shadow: var(--sh-pop); animation: pop .14s var(--ease); }
.dd > button, .dd .dd-list > button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--ink); text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.dd > button:hover { background: var(--card-3); }
.dd > button svg { width: 15px; height: 15px; color: var(--muted); flex: none; }
.dd > button kbd { margin-left: auto; }
.dd .dd-h { margin: 6px 4px 2px; padding: 8px 6px 4px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.dd .dd-h:empty { padding: 0; margin: 6px 4px; }
.dd .dd-user { display: flex; gap: 12px; align-items: center; padding: 10px; margin-bottom: 4px; }
.dd .dd-user b { display: block; font-weight: 600; }
.dd .dd-user small { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.dd .danger, .dd .danger svg { color: var(--bad) !important; }
.dd-theme { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 2px 4px 4px; }
.dd-theme button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink-2); font-size: 12px; cursor: pointer; }
.dd-theme button svg { width: 16px; height: 16px; }
.dd-theme button:hover { background: var(--card-3); }
.dd-theme button.on { border-color: var(--gold); background: var(--gold-soft); color: var(--ink); font-weight: 600; }
.dd.alerts { width: 380px; max-width: calc(100vw - 16px); padding: 0; overflow: hidden; }
.al-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.al-list { max-height: min(62vh, 480px); overflow-y: auto; padding: 6px; }
.al-item { display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 10px; border: 0; border-radius: 10px; background: none; color: var(--ink); text-align: left; cursor: pointer; white-space: normal; }
.al-item:hover { background: var(--card-3); }
.al-item b { display: block; font-weight: 600; font-size: 13.5px; line-height: 1.35; }
.al-item small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.al-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.al-ico svg { width: 16px; height: 16px; }
.al-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 28px 16px; text-align: center; color: var(--muted); }
.al-empty svg { width: 36px; height: 36px; color: var(--ok); margin-bottom: 6px; }
.al-empty b { color: var(--ink); }

/* ---------- Paleta de comandos (Ctrl K) ---------- */
.pal-wrap { position: fixed; inset: 0; z-index: 90; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; background: var(--overlay); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); animation: fade .12s; }
.pal { width: 100%; max-width: 660px; overflow: hidden; border-radius: 16px; border: 1px solid var(--line); background: var(--card); box-shadow: var(--sh-pop); animation: pop .16s var(--ease); }
.pal-in { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.pal-in > svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.pal-in input { flex: 1; height: 56px; border: 0; outline: none; background: transparent; color: var(--ink); font-size: 16px; }
.pal-in input::placeholder { color: var(--muted); }
.pal-list { max-height: min(60vh, 470px); overflow-y: auto; padding: 6px; }
.pal-g { padding: 10px 10px 4px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.pal-it { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 10px; border: 0; border-radius: 10px; background: none; color: var(--ink); text-align: left; cursor: pointer; }
.pal-it.sel { background: var(--brand-soft); }
.pal-it .obj-icon { width: 30px; height: 30px; border-radius: 8px; }
.pal-it .obj-icon svg { width: 15px; height: 15px; }
.pal-it > span:nth-child(2) { flex: 1; min-width: 0; }
.pal-it small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-it kbd { visibility: hidden; }
.pal-it.sel kbd { visibility: visible; }
.pal-empty { padding: 34px 16px; text-align: center; color: var(--muted); }
.pal-foot { display: flex; gap: 16px; flex-wrap: wrap; padding: 10px 16px; border-top: 1px solid var(--line); background: var(--card-2); color: var(--muted); font-size: 12px; }
.pal-foot span { display: inline-flex; align-items: center; gap: 4px; }

/* ---------- Tooltip ---------- */
.tip { position: fixed; z-index: 120; max-width: 280px; padding: 8px 10px; border-radius: 8px; background: var(--tip-bg); color: var(--tip-ink); font-size: 12px; line-height: 1.45; white-space: pre-line; box-shadow: var(--sh-pop); pointer-events: none; opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s; }
.tip.show { opacity: 1; transform: none; }

/* ---------- Modal (formularios) ---------- */
.modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 24px; overflow-y: auto; background: var(--overlay); animation: fade .15s; }
.sheet { position: relative; width: 100%; max-width: 600px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--card); box-shadow: var(--sh-pop); animation: pop .2s var(--ease); }
.sheet.wide { max-width: 880px; }
.mhead { display: flex; align-items: center; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.mhead h3 { margin: 0; flex: 1; font-size: 17px; font-weight: 650; letter-spacing: -.015em; }
.x { width: 32px; height: 32px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); font-size: 22px; line-height: 1; display: grid; place-items: center; cursor: pointer; flex: none; }
.x:hover { background: var(--card-3); color: var(--ink); }
.mbody { padding: 18px 20px 8px; }
.mfoot { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--card-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.mfoot .grow { flex: 1; }
.merr { flex-basis: 100%; color: var(--bad); font-size: 13px; font-weight: 500; }
.merr:empty { display: none; }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.fgrid .full { grid-column: 1 / -1; }
.sect { display: flex; align-items: center; gap: 10px; margin: 22px 0 10px; color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.sect::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.sect.first { margin-top: 0; }
.f .lbl { display: block; margin-bottom: 6px; font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.warn-t { color: var(--warn); }
.lrow { display: grid; grid-template-columns: minmax(0, 1fr) 172px 64px 112px 100px 38px; gap: 8px; margin-bottom: 8px; align-items: start; }
.lrow.c { grid-template-columns: minmax(0, 1fr) 172px 76px 130px 38px; }
.lrow .del { height: 38px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--card); color: var(--muted); font-size: 18px; cursor: pointer; }
.lrow .del:hover { color: var(--bad); background: var(--bad-soft); }
.lrow .hint { grid-column: 1 / -1; margin: -2px 0 4px; font-size: 12px; color: var(--muted); }
.lrow .hint:empty { display: none; }
.lhead { display: grid; grid-template-columns: minmax(0, 1fr) 172px 64px 112px 100px 38px; gap: 8px; margin-bottom: 6px; color: var(--muted); font-size: 12px; font-weight: 500; }
.lhead.c { grid-template-columns: minmax(0, 1fr) 172px 76px 130px 38px; }
.totalbox { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding: 12px 14px; border-radius: 10px; background: var(--brand-soft); border: 1px solid color-mix(in srgb, var(--brand) 18%, transparent); }
.totalbox b { font-size: 19px; font-weight: 700; letter-spacing: -.02em; }
.totalbox small { display: block; margin-top: 1px; font-size: 11.5px; }
.totalbox small:empty { display: none; }

/* ---------- Selector por nombre (productos y clientes) ---------- */
.pp { position: relative; min-width: 0; }
.pp-box { position: relative; }
.pp-box > svg { position: absolute; left: 11px; top: 50%; width: 15px; height: 15px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.pp .pp-q { padding-left: 34px; text-overflow: ellipsis; }
.pp.ok .pp-q { border-color: color-mix(in srgb, var(--ok) 45%, var(--line-2)); background: color-mix(in srgb, var(--ok-soft) 35%, var(--card)); font-weight: 500; }
.pp.ok .pp-box > svg { color: var(--ok); }
.pp-sku { padding: 0 9px; font: 500 11.5px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: -.02em; text-overflow: ellipsis; cursor: default; }
.pp-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20; min-width: min(300px, 86vw); max-height: 300px; overflow-y: auto; overscroll-behavior: contain; padding: 4px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); box-shadow: var(--sh-pop); animation: pop .12s var(--ease); }
.pp-opt { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; cursor: pointer; }
.pp-opt.on { background: var(--card-3); }
@media (hover: hover) { .pp-opt:hover { background: var(--card-3); } }
.pp-opt .av { margin: 0; width: 34px; height: 34px; font-size: 12px; }
.pp-img { width: 34px; height: 34px; flex: none; display: grid; place-items: center; overflow: hidden; border-radius: 8px; color: #fff; font-size: 11px; font-weight: 700; }
.pp-img img { width: 100%; height: 100%; object-fit: cover; }
.pp-img.add { background: var(--brand-soft); color: var(--brand); }
.pp-img.add svg { width: 16px; height: 16px; }
.pp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.pp-main b { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-main b mark { background: color-mix(in srgb, var(--gold) 32%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.pp-main small, .pp-side small { color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; text-align: right; line-height: 1.3; font-variant-numeric: tabular-nums; }
.pp-side b { font-size: 13px; font-weight: 600; }
.pp-side small.pos { color: var(--ok); } .pp-side small.neg { color: var(--bad); }
.pp-new .pp-main b { color: var(--link); }
.pp-empty { padding: 14px 10px; color: var(--muted); font-size: 13px; text-align: center; }

/* ---------- Cliente en la venta ---------- */
.cb-row { display: flex; gap: 8px; align-items: flex-start; }
.cb-row .pp { flex: 1; }
.cb-row .btn { flex: none; height: 38px; }
.cb-row + .hint { margin-top: 6px; font-size: 12px; color: var(--muted); }
.cb-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--ok) 28%, var(--line)); background: color-mix(in srgb, var(--ok-soft) 60%, var(--card)); animation: rise .18s var(--ease); }
.cb-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; line-height: 1.35; }
.cb-info b { font-weight: 600; }
.cb-info small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.cb-new { padding: 14px; border-radius: 12px; border: 1px dashed var(--line-2); background: var(--card-2); animation: rise .18s var(--ease); }
.cb-new-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.cb-new-h b { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.cb-new-h b svg { width: 16px; height: 16px; color: var(--brand); }

/* ---------- Botones de opción (canal, medio de pago) ---------- */
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.f .pill-r { position: relative; display: inline-flex; margin: 0; cursor: pointer; }
.pill-r input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.pill-r span { display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--card); color: var(--ink-2); font-size: 13px; font-weight: 500; white-space: nowrap; transition: background .15s, border-color .15s, color .15s; }
.pill-r:hover span { border-color: color-mix(in srgb, var(--line-2) 50%, var(--muted)); color: var(--ink); }
.pill-r input:checked + span { background: var(--pill); border-color: var(--pill); color: var(--pill-ink); font-weight: 600; }
.pill-r input:focus-visible + span { box-shadow: var(--focus); }

/* ---------- Más detalles (plegable) ---------- */
details.more { margin-top: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--card-2); }
details.more > summary { display: flex; align-items: center; gap: 8px; padding: 11px 14px; list-style: none; cursor: pointer; color: var(--ink-2); font-weight: 500; border-radius: 12px; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary svg { width: 14px; height: 14px; flex: none; color: var(--muted); transform: rotate(-90deg); transition: transform .15s; }
details.more[open] > summary svg { transform: none; }
details.more > summary small { margin-left: auto; color: var(--muted); font-weight: 400; font-size: 12px; text-align: right; }
details.more > .fgrid { padding: 4px 14px 14px; }

/* ---------- Diálogo de confirmación ---------- */
.dlg-wrap { position: fixed; inset: 0; z-index: 85; display: grid; place-items: center; padding: 16px; background: var(--overlay); animation: fade .12s; }
.dlg { width: 100%; max-width: 440px; padding: 22px 22px 18px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--card); box-shadow: var(--sh-pop); animation: pop .16s var(--ease); }
.dlg-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 14px; background: var(--brand-soft); color: var(--brand); }
.dlg-ico svg { width: 22px; height: 22px; }
.dlg.danger .dlg-ico { background: var(--bad-soft); color: var(--bad); }
.dlg h3 { margin: 0 0 6px; font-size: 17px; font-weight: 650; letter-spacing: -.015em; line-height: 1.35; }
.dlg p { margin: 0; color: var(--ink-2); white-space: pre-line; line-height: 1.55; }
.dlg .inp { margin-top: 14px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }

/* ---------- Lanzador de secciones ---------- */
.menu-sheet { max-width: 720px; }
.menu-list { list-style: none; margin: 0; padding: 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; }
.menu-list button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px; border: 1px solid transparent; border-radius: 10px; background: none; color: var(--ink); font-size: 14px; font-weight: 500; text-align: left; cursor: pointer; transition: background .15s, border-color .15s; }
.menu-list button:hover { background: var(--card-2); border-color: var(--line); }
.menu-list .obj-icon { width: 32px; height: 32px; border-radius: 9px; }
.menu-list .obj-icon svg { width: 16px; height: 16px; }
.menu-list .chev { display: none; }

/* ---------- Fotos e IA ---------- */
.fotobox { display: flex; align-items: flex-start; gap: 14px; padding: 12px; margin-bottom: 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card-2); }
.foto { width: 96px; height: 96px; flex: none; display: grid; place-items: center; overflow: hidden; border-radius: 10px; border: 1.5px dashed var(--line-2); background: var(--card); color: var(--muted); font-size: 12px; text-align: center; cursor: pointer; transition: border-color .15s, color .15s; }
.foto:hover { border-color: var(--gold); color: var(--ink); }
.foto span { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.foto svg { width: 24px; height: 24px; }
.foto img { width: 100%; height: 100%; object-fit: cover; }
.fotoinfo b { font-weight: 600; }
.fotoinfo p { margin: 2px 0 8px; }
.iabox { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 14px; margin-bottom: 12px; border-radius: var(--radius); background: var(--gold-soft); border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent); }
.iabox p { margin: 2px 0 0; }

/* ---------- Flujo de caja (tabla tipo planilla) ---------- */
.fcwrap { overflow: auto; max-height: 74vh; }
.fc { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; white-space: nowrap; }
.fc th, .fc td { padding: 7px 12px; border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; }
.fc th { position: sticky; top: 0; z-index: 2; background: var(--head); color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.fc td:first-child, .fc th:first-child { position: sticky; left: 0; z-index: 1; min-width: 270px; white-space: normal; text-align: left; background: var(--card); border-right: 1px solid var(--line); }
.fc th:first-child { z-index: 3; background: var(--head); }
.fc td:last-child, .fc th:last-child { background: var(--card-2); font-weight: 600; }
.fc tr.sec td, .fc tr.sec td:first-child { background: var(--sec-bg); color: #fff; font-weight: 700; font-size: 12px; letter-spacing: .02em; }
.fc tr.ind td:first-child { padding-left: 26px; color: var(--muted); }
.fc tr.sub td, .fc tr.sub td:first-child { font-weight: 600; background: var(--card-2); }
.fc tr.total td, .fc tr.total td:first-child { font-weight: 700; border-top: 2px solid var(--ink); background: var(--brand-soft); }
.fc tbody tr:hover td { background: color-mix(in srgb, var(--brand) 5%, var(--card)); }
.fc .z { color: var(--line-2); }
.fc .ng { color: var(--bad); }

/* ---------- Ingreso / registro ---------- */
.login { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(380px, 1fr) 1.15fr; }
.login-left { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 20px; background: var(--bg); }
.login-logo { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 24px; }
.login-logo img { width: 72px; height: 72px; border-radius: 18px; box-shadow: 0 8px 24px -8px rgba(20, 33, 61, .45); }
.login-logo h1 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.login-logo h1 b { color: var(--gold-2); }
.login-card { width: 100%; max-width: 400px; padding: 26px 24px 20px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow); animation: pop .25s var(--ease); }
.login-card .f { margin-bottom: 16px; }
.login-card .inp { height: 42px; }
.login-card > .btn, .login-card form > .btn { width: 100%; height: 42px; font-size: 14.5px; }
.login-card .fgrid { gap: 0 12px; }
.login-title { margin: 0 0 6px; font-size: 19px; font-weight: 700; letter-spacing: -.015em; }
.remember { margin-top: 14px; }
.login-card .err { margin-top: 12px; color: var(--bad); font-size: 13px; font-weight: 500; }
.login-card .err:empty { display: none; }
.login-links { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13.5px; }
.login-foot { margin-top: 24px; color: var(--muted); font-size: 12px; }
.login-right { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 36px; padding: 64px 56px; color: #fff;
  background: radial-gradient(800px 460px at 85% 5%, rgba(201, 162, 74, .35), transparent 60%), radial-gradient(600px 400px at 0% 100%, rgba(59, 130, 196, .25), transparent 60%), linear-gradient(160deg, #1d3557 0%, #14213d 100%); }
.lr-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #e8cf94; }
.lr-eyebrow svg { width: 20px; height: 20px; }
.lr-text h2 { margin: 14px 0 12px; max-width: 560px; font-size: 34px; font-weight: 600; line-height: 1.2; letter-spacing: -.025em; }
.lr-text p { margin: 0; max-width: 500px; font-size: 16px; color: rgba(255, 255, 255, .78); line-height: 1.55; }
.lr-mock { position: relative; z-index: 1; max-width: 560px; padding-bottom: 18px; border-radius: 14px; background: #fff; color: #0f172a; box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .55); transform: perspective(1200px) rotateY(-6deg) rotateX(3deg); }
.lr-bar { display: flex; gap: 6px; padding: 12px 14px; border-bottom: 1px solid #e4e8ef; }
.lr-bar span { width: 9px; height: 9px; border-radius: 50%; background: #d0d7e2; }
.lr-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 14px 16px 6px; }
.lr-kpis div { padding: 9px 11px; border-radius: 10px; border: 1px solid #e4e8ef; border-left: 3px solid #c9a24a; }
.lr-kpis small { display: block; color: #64748b; font-size: 11px; }
.lr-kpis b { font-size: 16px; }
.lr-chart { display: flex; align-items: flex-end; gap: 12px; height: 110px; margin: 0 16px; padding: 10px 18px 0; border-bottom: 1px solid #e4e8ef; }
.lr-chart i { flex: 1; border-radius: 6px 6px 0 0; background: linear-gradient(#3d5f94, #14213d); }
.bye { text-align: center; padding: 6px 0 4px; }
.bye-ico { width: 68px; height: 68px; border-radius: 50%; margin: 0 auto 14px; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); }
.bye-ico svg { width: 36px; height: 36px; }
.bye h3 { margin: 0 0 6px; font-size: 20px; font-weight: 700; }
.bye p { margin: 0 0 18px; color: var(--muted); }
.auth { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.auth .box { width: 100%; max-width: 400px; padding: 26px 22px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow); }
.auth .btn { width: 100%; margin-top: 8px; }
.auth .err { color: var(--bad); }

/* ---------- Avisos (toasts) ---------- */
.toasts { position: fixed; z-index: 110; right: 20px; bottom: 20px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; }
.toast-i { pointer-events: auto; display: flex; align-items: flex-start; gap: 10px; min-width: 260px; max-width: 420px; padding: 12px 10px 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); box-shadow: var(--sh-pop); font-size: 13.5px; animation: toastIn .22s var(--ease); }
.toast-i.out { animation: toastOut .18s ease forwards; }
.toast-i .ti { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--ok-soft); color: var(--ok); }
.toast-i.bad .ti { background: var(--bad-soft); color: var(--bad); }
.toast-i .ti svg { width: 14px; height: 14px; }
.toast-i > span:nth-child(2) { flex: 1; padding-top: 1px; line-height: 1.45; }
.toast-i button { border: 0; background: none; color: var(--muted); font-size: 18px; line-height: 1; padding: 0 4px; border-radius: 6px; cursor: pointer; }
.toast-i button:hover { color: var(--ink); background: var(--card-3); }

/* ---------- Esqueleto de carga ---------- */
.sk { border-radius: 8px; background: linear-gradient(90deg, var(--card-3) 25%, color-mix(in srgb, var(--card-3) 45%, var(--card)) 37%, var(--card-3) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; }
.sk-hdr { height: calc(56px + env(safe-area-inset-top)); background: var(--hdr-bg); }
.sk-nav { height: 52px; background: var(--card); border-bottom: 1px solid var(--line); }
.sk-main { padding: 22px 24px; }
.sk-title { height: 30px; width: 280px; margin-bottom: 20px; }
.sk-card { padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.sk-l { height: 12px; width: 45%; } .sk-v { height: 26px; width: 70%; } .sk-s { height: 10px; width: 55%; }

/* ---------- Sin conexión ---------- */
.offline { position: fixed; left: 50%; top: calc(64px + env(safe-area-inset-top)); transform: translateX(-50%); z-index: 115; padding: 8px 16px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 13px; font-weight: 500; box-shadow: var(--sh-pop); }

/* ---------- Solo lectura ---------- */
body.ro [data-act^="new"], body.ro [data-act^="del"], body.ro [data-act="ajuste"], body.ro [data-act="anular"], body.ro [data-act="editRec"],
body.ro [data-act="cancelRes"], body.ro [data-act="venderRes"], body.ro [data-act="convertLead"], body.ro [data-act="pathNext"], body.ro [data-act="pathSel"],
body.ro [data-act="addOppLine"], body.ro [data-act="oppToVenta"], body.ro #msubmit, body.ro [data-act="abonar"], body.ro [data-act="delPago"], body.ro [data-act="metaEdit"], body.ro [data-act="provCompra"], body.ro [data-act="cliVenta"], body.ro [data-act="cliRes"] { display: none !important; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .c3 { grid-column: span 6; } .c4, .c5, .c6, .c7, .c8 { grid-column: span 12; }
  .dgrid.dash > .c4 { grid-column: span 6; }
}
@media (max-width: 1000px) { .rec-grid { grid-template-columns: 1fr; } .onb { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .cmdk-btn, .hide-m, .app-nav { display: none !important; }
  .only-m { display: grid !important; }
  .app-hdr { gap: 6px; padding: env(safe-area-inset-top) 8px 0; }
  html { scroll-padding-top: calc(64px + env(safe-area-inset-top)); }
  main { padding: 16px 12px calc(88px + env(safe-area-inset-bottom)); }
  .app-hdr ~ main { margin-top: calc(56px + env(safe-area-inset-top)); }
  .page-head .spacer { flex-basis: 100%; height: 0; }
  .page-head select.inp, .dash-hero select.inp { flex: 1; }
  .dash-hero h1 { font-size: 22px; }
  .dgrid.dash > .c4 { grid-column: span 12; }
  .qa { flex-wrap: nowrap; overflow-x: auto; margin: 0 -12px 16px; padding: 0 12px 4px; scrollbar-width: none; }
  .qa::-webkit-scrollbar { display: none; }
  .qa .btn { flex: none; }
  .filters .inp { flex: 1 1 45%; min-width: 0; }
  .mnav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; padding-bottom: env(safe-area-inset-bottom); background: color-mix(in srgb, var(--card) 92%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
  .mnav button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 2px 7px; border: 0; background: none; color: var(--muted); font-size: 10.5px; font-weight: 500; cursor: pointer; position: relative; }
  .mnav button svg { width: 22px; height: 22px; }
  .mnav button.on { color: var(--ink); }
  .mnav button.on::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--gold); }
  .tbl.stack thead { display: none; }
  .tbl.stack, .tbl.stack tbody, .tbl.stack tr, .tbl.stack td { display: block; width: 100%; }
  .tbl.stack tr { position: relative; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .tbl.stack td { padding: 2px 0; border: 0; text-align: left !important; }
  .tbl.stack td.rn { display: none; }
  .tbl.stack td[data-l]::before { content: attr(data-l) ": "; color: var(--muted); font-size: 12px; }
  .tbl.stack td.first { font-size: 14.5px; font-weight: 600; padding-right: 40px; margin-bottom: 2px; }
  .tbl.stack td.act { position: absolute; top: 10px; right: 12px; width: auto; }
  .tbl.stack .btns { justify-content: flex-start; margin-top: 8px; }
  .lv-body { flex-direction: column; }
  .lv-filters { width: auto; border-left: 0; border-top: 1px solid var(--line); }
  .lv-tools .search { flex: 1; width: auto; }
  .seg { margin-left: 0; width: 100%; }
  .seg button { flex: 1; justify-content: center; padding: 7px 8px; }
  .toasts { left: 12px; right: 12px; bottom: calc(80px + env(safe-area-inset-bottom)); align-items: stretch; }
  .toast-i { max-width: none; min-width: 0; }
  .login { grid-template-columns: 1fr; }
  .login-right { display: none; }
  .login-left { background: radial-gradient(600px 320px at 50% 0, var(--gold-soft), transparent 70%), var(--bg); }
  .pal-wrap { padding-top: 8vh; }
}
@media (max-width: 600px) {
  .fields { grid-template-columns: 1fr; }
  .seg button > svg { display: none; }   /* ux1 */
  .stat .val { font-size: 22px; }
  .spark { width: 70px; }
}
@media (max-width: 560px) {
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .modal { padding: 0; align-items: flex-end; }
  .sheet { max-height: 94vh; max-height: calc(100dvh - env(safe-area-inset-top) - 12px); overflow-y: auto; border-radius: 18px 18px 0 0; animation: rise .22s var(--ease); }
  .mfoot { position: sticky; bottom: 0; border-radius: 0; }
  .fgrid { grid-template-columns: 1fr; }
  .login-card .fgrid { grid-template-columns: 1fr 1fr; }
  .lhead { display: none; }
  .lrow, .lrow.c { grid-template-columns: minmax(0, 1fr) 58px 104px 38px; grid-template-areas: "p p p p" "s c r x" "h h h h"; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--card-2); }
  .lrow > .pp { grid-area: p; } .lrow > .pp-sku { grid-area: s; } .lrow > [name=l_cant] { grid-area: c; }
  .lrow > [name=l_precio] { grid-area: r; } .lrow > .del { grid-area: x; } .lrow > .hint { grid-area: h; margin: 0; }
  .lrow .desc { display: none; }
  .pp-list { max-height: 240px; }
  .mfoot .btn { flex: 1 1 auto; }
  .mfoot .grow { display: none; }
  .cb-row .btn span { display: none; }
  .cb-row .btn { width: 42px; padding: 0; justify-content: center; }
  details.more > summary small { display: none; }
  .dlg-actions { flex-direction: column-reverse; }
  .dlg-actions .btn { width: 100%; height: 42px; }
}
@media (max-width: 400px) { .kpis { grid-template-columns: 1fr; } }

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Impresión ---------- */
@media print {
  .app-hdr, .app-nav, .mnav, .btn, .icon-btn, .rowdd, .toasts, .lv-tools, .filters, .seg, .qa, .onb, .act-bar, .launcher, .tip { display: none !important; }
  body { background: #fff; color: #000; }
  main { padding: 0; }
  .card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
  .fcwrap { max-height: none; overflow: visible; }
}

/* ---------- Cuentas, metas y cotización (Fase 4) ---------- */
.tbl tr.late td { background: color-mix(in srgb, var(--bad-soft) 55%, transparent); }
.tscroll { overflow-x: auto; margin: 0 -4px; }
.tbl.mini { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl.mini th { padding: 6px 8px; color: var(--muted); font-size: 11.5px; font-weight: 600; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl.mini td { padding: 7px 8px; border-bottom: 1px solid var(--line); }
.tbl.mini tr:last-child td { border-bottom: 0; }
.tbl.mini th.right, .tbl.mini td.right { text-align: right; }
.tbl.mini tr.click { cursor: pointer; } .tbl.mini tr.click:hover td { background: var(--card-2); }
.tbl.mini tr.cur td { background: var(--brand-soft); font-weight: 600; }
.meta-strip { display: grid; grid-template-columns: minmax(160px, auto) 1fr 1fr; gap: 10px 24px; align-items: center; padding: 14px 18px; margin-bottom: 14px; }
.meta-t { display: flex; flex-direction: column; gap: 2px; }
.meta-t b { font-size: 14px; }
.meta-strip.empty-meta { display: flex; justify-content: space-between; gap: 12px; }
.meta-strip.empty-meta > span { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.meta-strip.empty-meta svg { width: 18px; height: 18px; color: var(--gold); }
.goal-h { display: flex; align-items: baseline; gap: 8px; font-size: 13px; margin-bottom: 6px; flex-wrap: wrap; }
.goal-h > span:first-child { color: var(--muted); font-weight: 500; }
.goal-h > b:last-child { margin-left: auto; }
.goal .track { height: 8px; border-radius: 99px; background: var(--card-3); overflow: hidden; }
.goal .fill { height: 100%; border-radius: 99px; transition: width .4s var(--ease); }
.pdf-ok { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card-2); margin-bottom: 14px; }
.pdf-ok b { display: block; word-break: break-all; } .pdf-ok small { color: var(--muted); }
.pdf-ico { width: 44px; height: 52px; flex: none; display: grid; place-items: center; border-radius: 8px; background: #c0262d; color: #fff; font-weight: 800; font-size: 12px; letter-spacing: .04em; }
.pdf-acts { display: flex; flex-direction: column; gap: 8px; }
.pdf-acts .btn { height: 42px; justify-content: flex-start; }
@media (max-width: 900px) { .meta-strip { grid-template-columns: 1fr; } .meta-strip.empty-meta { flex-direction: column; align-items: flex-start; } }

/* ---------- Lector de código de barras y etiquetas ---------- */
.pp.has-scan .pp-q { padding-right: 40px; }
.pp-scan { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 32px; height: 30px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.pp-scan:hover { background: var(--card-3); color: var(--ink); }
.pp-scan svg { width: 18px; height: 18px; }
.lacts { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 2px; }
.inline-inp { display: flex; gap: 6px; } .inline-inp .inp { flex: 1; min-width: 0; } .inline-inp .btn { height: 38px; width: 42px; padding: 0; flex: none; }
.scan-wrap { position: fixed; inset: 0; z-index: 130; display: grid; place-items: center; padding: 16px; background: rgba(2, 6, 16, .78); animation: fade .12s; }
.scan { width: 100%; max-width: 520px; overflow: hidden; border-radius: 18px; background: var(--card); box-shadow: var(--sh-pop); animation: pop .16s var(--ease); }
.scan-h { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 10px 18px; }
.scan-v { position: relative; aspect-ratio: 4 / 3; background: #000; overflow: hidden; }
.scan-v video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-frame { position: absolute; left: 8%; right: 8%; top: 28%; bottom: 28%; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .38); border: 2px solid rgba(255, 255, 255, .85); }
.scan-frame i { position: absolute; left: 6%; right: 6%; top: 50%; height: 2px; background: #ff3b30; box-shadow: 0 0 10px #ff3b30; animation: scanline 1.6s ease-in-out infinite; }
.scan-frame.hit { border-color: #34c759; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .38), 0 0 0 4px rgba(52, 199, 89, .5); }
@keyframes scanline { 0%, 100% { transform: translateY(-18px); } 50% { transform: translateY(18px); } }
.scan-msg { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; color: #fff; text-align: center; font-size: 14px; pointer-events: none; }
.scan-msg:empty { display: none; }
.scan-msg small { display: block; margin-top: 6px; opacity: .8; font-size: 12.5px; }
.scan-f { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px 14px; }
.scan-last { min-height: 20px; font-size: 13.5px; color: var(--muted); }
.scan-man { display: flex; gap: 8px; } .scan-man .inp { flex: 1; }
.scan-ok { height: 42px; }
.et-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.et-tools .search { min-width: 200px; }
.et-list { max-height: 46vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; }
.et-row { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.et-row:last-child { border-bottom: 0; }
.et-row:hover { background: var(--card-2); }
.et-row input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--primary); flex: none; }
.et-n { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.et-n b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.et-n small { color: var(--muted); font-family: ui-monospace, Consolas, monospace; font-size: 11.5px; }
.et-q { width: 76px !important; flex: none; text-align: right; }
@media (max-width: 560px) { .scan-wrap { padding: 0; align-items: end; } .scan { border-radius: 18px 18px 0 0; max-width: none; padding-bottom: env(safe-area-inset-bottom); } }

/* ---------- Mensajes (bandeja) ---------- */
.ch-ico { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: #fff; flex: none; vertical-align: middle; }
.ch-ico svg { width: 13px; height: 13px; }
.ch-ico.sm { width: 16px; height: 16px; } .ch-ico.sm svg { width: 10px; height: 10px; stroke-width: 2.4; }
.inbox { display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); height: calc(100vh - 230px); height: calc(100dvh - 230px); min-height: 460px; overflow: hidden; padding: 0; }
.ib-list { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); }
.ib-tools { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-bottom: 1px solid var(--line); }
.ib-seg { margin: 0; flex-wrap: wrap; row-gap: 4px; } .ib-seg::-webkit-scrollbar { display: none; }
.ib-seg button { padding: 6px 10px; font-size: 12.5px; white-space: nowrap; }
.ib-items { flex: 1; overflow-y: auto; min-height: 0; }
.ib-it { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 12px; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ink); text-align: left; cursor: pointer; }
.ib-it:hover { background: var(--card-2); } .ib-it.on { background: var(--brand-soft); }
.ib-av { position: relative; flex: none; } .ib-av .av { margin: 0; width: 38px; height: 38px; font-size: 13px; } .ib-av .av.lg { width: 42px; height: 42px; }
.ib-av .ch-ico { position: absolute; right: -3px; bottom: -3px; box-shadow: 0 0 0 2px var(--card); }
.ib-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ib-top { display: flex; justify-content: space-between; gap: 8px; } .ib-top b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .ib-top small { color: var(--muted); font-size: 11.5px; flex: none; }
.ib-prev { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ib-it.unread .ib-top b, .ib-it.unread .ib-prev { color: var(--ink); font-weight: 600; }
.ib-thread { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--card-2); }
.ib-empty { flex: 1; display: grid; place-items: center; align-content: center; gap: 6px; padding: 24px; color: var(--muted); text-align: center; }
.ib-empty svg { width: 34px; height: 34px; color: var(--line-2); } .ib-empty b { color: var(--ink); } .ib-empty.small { flex: none; padding: 30px; }
.ib-h { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--card); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.ib-back { display: none; color: var(--ink); } .ib-back svg { transform: rotate(90deg); }
.ib-who { flex: 1; min-width: 160px; display: flex; flex-direction: column; line-height: 1.35; } .ib-who b { font-weight: 600; } .ib-who small { color: var(--muted); font-size: 12px; }
.ib-acts { display: flex; gap: 6px; flex-wrap: wrap; } .ib-acts .btn svg { width: 14px; height: 14px; }
.ib-msgs { flex: 1; overflow-y: auto; min-height: 0; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.ib-day { text-align: center; margin: 8px 0 4px; } .ib-day span { display: inline-block; padding: 3px 10px; border-radius: 99px; background: var(--card-3); color: var(--muted); font-size: 11.5px; font-weight: 500; }
.bub { max-width: min(78%, 520px); padding: 8px 11px 6px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); align-self: flex-start; box-shadow: var(--sh-1); }
.bub.out { align-self: flex-end; background: color-mix(in srgb, #25d366 16%, var(--card)); border-color: color-mix(in srgb, #25d366 30%, var(--line)); }
.bub.err { border-color: var(--bad); }
.bub-t { white-space: pre-wrap; word-wrap: break-word; line-height: 1.45; }
.bub-media { font-size: 12.5px; color: var(--muted); margin-bottom: 2px; }
.bub-m { margin-top: 2px; text-align: right; color: var(--muted); font-size: 11px; } .bub-m .leido { color: #34b7f1; }
.bub-e { margin-top: 4px; color: var(--bad); font-size: 12px; }
.ib-comp { padding: 10px 12px; background: var(--card); border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.ib-modo { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--ink-2); } .ib-modo label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; } .ib-modo input { accent-color: var(--primary); }
.ib-row { display: flex; gap: 8px; align-items: flex-end; } .ib-row textarea { min-height: 40px; max-height: 140px; resize: none; padding: 9px 12px; line-height: 1.4; }
.ib-row .btn { height: 40px; }
.ib-warn { padding: 8px 10px; border-radius: 8px; background: var(--warn-soft); color: var(--warn); font-size: 12.5px; }
.badge.mb { position: absolute; top: 3px; left: calc(50% + 6px); }
@media (max-width: 900px) {
  .inbox { grid-template-columns: 1fr; height: calc(100dvh - 56px - env(safe-area-inset-top) - 150px - env(safe-area-inset-bottom)); min-height: 420px; }
  .inbox .ib-thread { display: none; } .inbox.has-sel .ib-list { display: none; } .inbox.has-sel .ib-thread { display: flex; }
  .ib-back { display: grid; } .ib-acts .btn span { display: none; } .ib-acts .btn { padding: 0 9px; }
  .bub { max-width: 86%; }
}
@media (max-width: 900px) { #view.msg-open .page-head { display: none; } #view.msg-open .inbox { height: calc(100dvh - 164px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); min-height: 380px; } }

/* ---------- Módulos CRM / ERP ---------- */
.modsw { display: inline-flex; flex: none; padding: 3px; gap: 2px; border-radius: 999px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); }
.modsw button { height: 28px; padding: 0 13px; border: 0; border-radius: 999px; background: none; color: rgba(255,255,255,.72); font-weight: 600; font-size: 12.5px; letter-spacing: .02em; cursor: pointer; }
.modsw button:hover { color: #fff; }
.modsw button.on { background: var(--gold); color: #14213d; }
.nav-mod { display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 0 12px 0 4px; margin-right: 4px; border-right: 1px solid var(--line); color: var(--ink); font-weight: 700; font-size: 13px; letter-spacing: .03em; }
.nav-mod svg { width: 16px; height: 16px; color: var(--mc); }
.menu-g { padding: 10px 22px 0; color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.menu-list button.on { background: var(--brand-soft); }
.mod-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px 22px 4px; }
.mod-card { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); color: var(--ink); text-align: left; cursor: pointer; transition: border-color .15s, background .15s; }
.mod-card:hover { border-color: var(--line-2); background: var(--card-2); }
.mod-card.on { border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 20%, transparent); }
.mod-card b { display: block; font-size: 16px; } .mod-card small { display: block; color: var(--muted); font-size: 12px; line-height: 1.35; }
@media (max-width: 900px) { .nav-mod { display: none; } }
@media (max-width: 440px) { .app-hdr .brand span { display: none; } .modsw button { padding: 0 10px; } }
@media (max-width: 560px) { .mod-cards { grid-template-columns: 1fr; } }
/* ---------- Categorías y líneas ---------- */
.cat-list { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.cat-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 80px 38px; gap: 8px; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.cat-row:last-child { border-bottom: 0; } .cat-h { color: var(--muted); font-size: 12px; font-weight: 600; background: var(--card-2); } .cat-new { background: var(--card-2); }
@media (max-width: 560px) { .cat-row { grid-template-columns: 1fr 1fr 34px; } .cat-row > :nth-child(3) { display: none; } }
/* ---------- Chatbot ---------- */
.bot-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.bot-grid .f { margin-bottom: 12px; }
.bot-sw { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; margin-bottom: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card-2); cursor: pointer; }
.bot-sw input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--primary); flex: none; } .bot-sw b { display: block; } .bot-sw small { display: block; color: var(--muted); font-size: 12px; line-height: 1.4; }
.dias .pill-r span { padding: 0 11px; height: 30px; }
.faq-row { display: grid; grid-template-columns: minmax(0, 1fr) 34px; gap: 6px; padding: 10px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--card-2); }
.faq-row textarea { grid-column: 1; min-height: 56px; } .faq-row .rowdd { grid-row: 1; grid-column: 2; }
.bot-test { position: sticky; top: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; background: var(--card-2); overflow: hidden; }
.bot-test-h { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--card); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.bot-test-h svg { width: 16px; height: 16px; color: #1faa59; } .bot-test-h small { color: var(--muted); font-size: 12px; }
.bot-msgs { height: 340px; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.bot-sug { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 8px; } .bot-sug .chip { cursor: pointer; border: 0; } .bot-sug .chip::before { display: none; }
.bot-test .ib-row { padding: 10px 12px; background: var(--card); border-top: 1px solid var(--line); }
@media (max-width: 860px) { .bot-grid { grid-template-columns: 1fr; } .bot-test { position: static; } .bot-msgs { height: 300px; } }

/* ---------- Agenda ---------- */
.ag-wrap { padding: 0; overflow: hidden; }
.ag-bar { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.ag-nav { color: var(--ink); } .ag-nav svg { transform: rotate(90deg); } .ag-nav.sig svg { transform: rotate(-90deg); }
.ag-tit { margin: 0 6px; font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
select.inp.ag-sel { width: auto; min-width: 120px; height: 34px; }
.ag-seg { margin: 0; } .ag-seg button { padding: 6px 12px; }
.ag-vchk { font-size: 13px !important; }
.ag-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; padding: 8px 14px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.ag-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; } .ag-legend i.vi { background: transparent; border: 2px dashed var(--muted); }
.ag-dow { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--line); } .ag-dow span { padding: 6px 8px; color: var(--muted); font-size: 11.5px; font-weight: 600; text-transform: uppercase; }
.ag-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-auto-rows: minmax(108px, auto); }
.ag-cel { position: relative; padding: 4px 4px 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); cursor: pointer; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ag-cel:nth-child(7n) { border-right: 0; } .ag-cel:hover { background: var(--card-2); } .ag-cel.fuera { background: color-mix(in srgb, var(--card-2) 60%, transparent); } .ag-cel.fuera .ag-n { color: var(--muted); opacity: .6; }
.ag-n { align-self: flex-start; display: grid; place-items: center; min-width: 24px; height: 24px; padding: 0 4px; border-radius: 99px; font-size: 12.5px; font-weight: 600; }
.ag-cel.hoy .ag-n, .ag-sd.hoy b { background: var(--brand-2, #2f5596); color: #fff; }
.ag-ev { display: block; width: 100%; padding: 2px 6px; border: 0; border-radius: 5px; background: color-mix(in srgb, var(--ec) 18%, var(--card)); border-left: 3px solid var(--ec); color: var(--ink); font-size: 12px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.ag-ev:hover { background: color-mix(in srgb, var(--ec) 28%, var(--card)); } .ag-ev b { font-weight: 600; }
.ag-ev.done, .ag-blk.done { opacity: .55; text-decoration: line-through; } .ag-ev.venc { background: transparent; border: 1px dashed var(--ec); border-left-width: 3px; border-left-style: solid; }
.ag-mas { border: 0; background: none; color: var(--muted); font-size: 11.5px; text-align: left; padding: 0 6px; cursor: pointer; } .ag-mas:hover { color: var(--ink); }
.arrastrando { opacity: .4; } .sobre { background: var(--brand-soft) !important; outline: 2px dashed var(--brand); outline-offset: -2px; }
.ag-sem { --n: 7; } .ag-shead, .ag-allday { display: grid; grid-template-columns: 56px repeat(var(--n), minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.ag-sd { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; border: 0; border-left: 1px solid var(--line); background: none; color: var(--ink); cursor: pointer; }
.ag-sd small { color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; } .ag-sd b { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; font-size: 15px; }
.ag-hl { padding: 6px 4px; color: var(--muted); font-size: 10.5px; text-align: right; }
.ag-ad { border-left: 1px solid var(--line); padding: 3px; display: flex; flex-direction: column; gap: 2px; min-height: 30px; cursor: pointer; min-width: 0; }
.ag-body { display: grid; grid-template-columns: 56px repeat(var(--n), minmax(0, 1fr)); max-height: 620px; overflow-y: auto; }
.ag-hours span { display: block; padding-right: 6px; color: var(--muted); font-size: 11px; text-align: right; transform: translateY(-7px); }
.ag-col { position: relative; border-left: 1px solid var(--line); } .ag-slot { border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); cursor: pointer; } .ag-slot:hover { background: var(--card-2); }
.ag-blk { position: absolute; display: flex; flex-direction: column; gap: 1px; padding: 3px 6px; border: 0; border-radius: 6px; background: color-mix(in srgb, var(--ec) 22%, var(--card)); border-left: 3px solid var(--ec); color: var(--ink); font-size: 11.5px; text-align: left; overflow: hidden; cursor: pointer; box-shadow: var(--sh-1); }
.ag-blk b { font-weight: 600; } .ag-blk span { overflow: hidden; text-overflow: ellipsis; }
.ag-now { position: absolute; left: 0; right: 0; height: 2px; background: #ea4335; z-index: 2; } .ag-now::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: #ea4335; }
.ag-lista { padding: 6px 14px 14px; }
.ag-ld { margin: 14px 0 4px; padding-bottom: 4px; border-bottom: 1px solid var(--line); font-weight: 600; } .ag-ld.hoy { color: var(--brand-2, #2f5596); }
.ag-li { display: grid; grid-template-columns: 82px 10px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 5px 0; }
.ag-li-h { color: var(--muted); font-size: 12.5px; } .ag-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ec); } .ag-li .ag-ev { font-size: 13.5px; padding: 5px 8px; }
@media (max-width: 760px) {
  .ag-tit { font-size: 16px; flex-basis: 100%; order: 9; margin: 4px 0 0; } .ag-vchk { display: none !important; }
  .ag-grid { grid-auto-rows: minmax(64px, auto); } .ag-cel { padding: 2px; } .ag-ev { font-size: 10.5px; padding: 1px 4px; } .ag-ev b { display: none; }
  .ag-shead, .ag-allday, .ag-body { grid-template-columns: 40px repeat(var(--n), minmax(0, 1fr)); } .ag-blk { font-size: 10px; padding: 2px 3px; }
  .ag-li { grid-template-columns: 64px 10px minmax(0, 1fr); } .ag-li small { display: none; }
}
/* ---------- Asistente de aprendizaje ---------- */
.hq { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; border: 2px solid currentColor; font-weight: 800; font-size: 12px; line-height: 1; }
.ay-top { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.ay-prog b { font-size: 13px; } .ay-prog .track { height: 8px; margin-top: 6px; border-radius: 99px; background: var(--card-3); overflow: hidden; } .ay-prog .fill { height: 100%; background: var(--ok); border-radius: 99px; }
.ay-list { display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow-y: auto; }
.ay-it { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.ay-it.ok { background: color-mix(in srgb, var(--ok-soft) 50%, var(--card)); }
.ay-h { display: flex; align-items: flex-start; gap: 10px; } .ay-h > div { flex: 1; } .ay-h b { display: block; } .ay-h small { color: var(--muted); font-size: 12.5px; }
.ay-ck { display: grid; place-items: center; width: 22px; height: 22px; flex: none; border-radius: 50%; border: 2px solid var(--line-2); color: #fff; font-size: 12px; font-weight: 800; }
.ay-it.ok .ay-ck { background: var(--ok); border-color: var(--ok); }
.ay-it details { margin: 8px 0 0 32px; } .ay-it summary { cursor: pointer; color: var(--link); font-size: 13px; } .ay-it ol { margin: 6px 0 0; padding-left: 18px; color: var(--ink-2); font-size: 13px; line-height: 1.55; }
.ay-acts { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 0 32px; }
.tour { position: fixed; inset: 0; z-index: 125; }
.tour-spot { position: fixed; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(2, 6, 16, .62); outline: 3px solid var(--gold); transition: all .25s var(--ease); pointer-events: none; }
.tour-pop { position: fixed; width: min(360px, calc(100vw - 24px)); padding: 14px 16px; border-radius: 14px; background: var(--card); color: var(--ink); box-shadow: var(--sh-pop); animation: pop .16s var(--ease); }
.tour-pop small { color: var(--muted); font-size: 11.5px; } .tour-pop b { display: block; margin: 2px 0 4px; font-size: 16px; } .tour-pop p { margin: 0 0 8px; color: var(--ink-2); line-height: 1.5; }
.tour-pop.abajo { left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); width: auto; }
.tour-acts { display: flex; align-items: center; gap: 8px; } .tour-acts .grow { flex: 1; }
.tour-hello { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 105; width: min(340px, calc(100vw - 32px)); padding: 14px 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--sh-pop); animation: rise .25s var(--ease); }
.tour-hello p { margin: 6px 0 10px; color: var(--ink-2); font-size: 13.5px; line-height: 1.5; }
@media (max-width: 900px) { .tour-hello { bottom: calc(84px + env(safe-area-inset-bottom)); } }

/* ---------- Caja (varios clientes seguidos) ---------- */
.cj { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); gap: 14px; align-items: start; }
.cj-cat { padding: 12px; }
.cj-busca { display: flex; gap: 8px; margin-bottom: 10px; } .cj-busca .btn { height: 38px; flex: none; }
.cj-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-bottom: 10px; } .cj-chips::-webkit-scrollbar { display: none; }
.cj-chips .chip { cursor: pointer; border: 1px solid var(--line); background: var(--card); height: 28px; padding: 0 12px; flex: none; } .cj-chips .chip::before { display: none; }
.cj-chips .chip.on { background: var(--pill); color: var(--pill-ink); border-color: var(--pill); }
.cj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
.cj-prod { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); text-align: left; cursor: pointer; transition: border-color .12s, transform .08s; }
.cj-prod:active { transform: scale(.97); } .cj-prod:hover { border-color: var(--line-2); }
.cj-prod.en { border-color: var(--ok); box-shadow: 0 0 0 2px color-mix(in srgb, var(--ok) 30%, transparent); } .cj-prod.ago { opacity: .7; }
.cj-img { width: 100%; aspect-ratio: 1.3; border-radius: 9px; display: grid; place-items: center; overflow: hidden; color: #fff; font-weight: 800; font-size: 18px; margin-bottom: 4px; }
.cj-img img { width: 100%; height: 100%; object-fit: cover; }
.cj-q { position: absolute; top: 4px; right: 4px; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 99px; background: var(--ok); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; box-shadow: var(--sh-1); }
.cj-prod b { font-size: 12.5px; font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cj-pr { font-weight: 700; font-size: 14px; } .cj-prod small { color: var(--muted); font-size: 11px; }
.cj-carro { position: sticky; top: calc(124px + env(safe-area-inset-top)); padding: 12px; max-height: calc(100vh - 150px); overflow-y: auto; }
.cj-ch { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; } .cj-ch b { font-size: 16px; } .cj-cerrar { display: none; color: var(--ink); font-size: 22px; }
.cj-vacio { display: grid; place-items: center; gap: 4px; padding: 28px 10px; text-align: center; color: var(--muted); } .cj-vacio svg { width: 30px; height: 30px; color: var(--line-2); } .cj-vacio b { color: var(--ink); }
.cj-l { display: grid; grid-template-columns: minmax(0, 1fr) auto 84px; grid-template-areas: "n q p" "n s x"; gap: 4px 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.cj-ln { grid-area: n; min-width: 0; } .cj-ln b { display: block; font-size: 13px; font-weight: 600; } .cj-ln small { font-size: 11.5px; }
.cj-qty { grid-area: q; display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: 99px; overflow: hidden; }
.cj-qty button { width: 32px; height: 30px; border: 0; background: var(--card-2); color: var(--ink); font-size: 18px; font-weight: 700; cursor: pointer; } .cj-qty span { min-width: 28px; text-align: center; font-weight: 700; }
.cj-precio { grid-area: p; height: 32px; padding: 0 8px; text-align: right; font-size: 13px; }
.cj-sub { grid-area: s; justify-self: end; font-size: 13px; } .cj-l .rowdd { grid-area: x; justify-self: end; }
.cj-tot { display: flex; justify-content: space-between; align-items: center; margin: 10px 0; padding: 10px 12px; border-radius: 10px; background: var(--brand-soft); } .cj-tot b { font-size: 20px; }
.cj-pago { display: flex; flex-direction: column; gap: 8px; } .cj-modo { display: flex; gap: 6px; flex-wrap: wrap; }
.cj-modo .pill-r span { height: 38px; padding: 0 14px; font-size: 13.5px; }
.cj-cli { border: 1px solid var(--line); border-radius: 10px; background: var(--card-2); } .cj-cli > summary { padding: 9px 12px; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.cj-cli > div { padding: 0 10px 10px; }
.cj-ok { width: 100%; height: 46px; margin-top: 10px; font-size: 15px; }
.cj-barra { display: none; }
.cj-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.cj-kpis > div { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card-2); } .cj-kpis small { display: block; color: var(--muted); font-size: 11.5px; } .cj-kpis b { font-size: 17px; }
.cj-res { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cj-v { padding: 10px 12px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 10px; } .cj-v.err { border-color: var(--bad); background: var(--bad-soft); }
.cj-vh { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; } .cj-vl { margin-top: 4px; color: var(--ink-2); font-size: 13px; } .cj-va { display: flex; gap: 14px; margin-top: 6px; font-size: 13px; }
@media (max-width: 900px) {
  .cj { grid-template-columns: 1fr; }
  .cj-cat { padding: 10px; } .cj-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; } .cj-busca .btn span { display: none; }
  .cj-carro { position: fixed; inset: 0; top: calc(56px + env(safe-area-inset-top)); z-index: 46; max-height: none; border-radius: 0; padding: 12px 12px calc(96px + env(safe-area-inset-bottom)); transform: translateY(105%); transition: transform .22s var(--ease); }
  .cj-carro.abierto { transform: none; } .cj-cerrar { display: grid; }
  .cj-barra { display: flex; position: fixed; left: 10px; right: 10px; bottom: calc(68px + env(safe-area-inset-bottom)); z-index: 47; align-items: center; gap: 10px; height: 52px; padding: 0 16px; border: 0; border-radius: 14px; background: var(--primary); color: var(--primary-ink); font-size: 14px; box-shadow: var(--sh-pop); cursor: pointer; }
  .cj-barra b { font-size: 17px; } .cj-barra .cj-ir { margin-left: auto; font-weight: 600; }
  .cj-barra[hidden] { display: none; }
  .cj-kpis { grid-template-columns: 1fr 1fr; } .cj-res { grid-template-columns: 1fr; }
}

/* ================================================================ módulo Mercado */
/* colores por tienda: paleta validada (daltonismo y contraste) para fondo claro y oscuro */
:root { --mk1: #2a78d6; --mk2: #eb6834; --mk3: #1baf7a; --mk4: #eda100; --mk5: #e87ba4; --mk6: #008300; --mk7: #6250d6; --mk-otro: #8a94a6; }
:root[data-theme="dark"] { --mk1: #3987e5; --mk2: #d95926; --mk3: #199e70; --mk4: #c98500; --mk5: #d55181; --mk6: #0ca30c; --mk7: #9085e9; --mk-otro: #6b7690; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] { --mk1: #3987e5; --mk2: #d95926; --mk3: #199e70; --mk4: #c98500; --mk5: #d55181; --mk6: #0ca30c; --mk7: #9085e9; --mk-otro: #6b7690; }
}
.mk-filtros { margin-bottom: 16px; }
.mk-filtros .filters { border-bottom: 0; }
.chart .mk-lbl { fill: var(--ink); font-size: 12px; font-weight: 600; }
.chart .mk-val { fill: var(--ink-2); font-size: 11.5px; font-weight: 600; }
.mk-ley { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.mk-ley span { display: inline-flex; align-items: center; gap: 6px; }
.mk-ley i { display: inline-block; flex: none; }
.mk-k-l { width: 18px; height: 0; border-top: 1.5px solid var(--muted); }
.mk-k-b { width: 18px; height: 8px; border-radius: 4px; background: var(--muted); }
.mk-k-d { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 2px var(--card); }
.mk-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: -4px 0 10px; font-size: 12.5px; color: var(--ink-2); }
.mk-legend span { display: inline-flex; align-items: center; gap: 7px; }
.mk-legend i { width: 14px; height: 3px; border-radius: 2px; }
.mk-tchip { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; font-weight: 500; }
.mk-tchip i { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.mk-bars { display: grid; gap: 2px; }
.mk-bar { display: grid; grid-template-columns: minmax(90px, 1.2fr) 2fr 44px 78px; align-items: center; gap: 10px; padding: 5px 4px; border-radius: 8px; font-size: 13px; }
.mk-bar:not(.hd):hover, .mk-bar:focus-visible { background: var(--card-2); outline: none; }
.mk-bar.hd { color: var(--muted); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding-bottom: 6px; }
.mk-bar .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-bar .tr { height: 10px; }
.mk-bar .tr i { display: block; height: 100%; min-width: 3px; border-radius: 0 4px 4px 0; background: var(--mk1); }
.mk-bar.otra .tr i { background: var(--mk-otro); }
.mk-bar .v, .mk-bar .p { text-align: right; font-variant-numeric: tabular-nums; }
.mk-bar .v { font-weight: 600; }
.mk-bar .p { color: var(--muted); }
.mk-cxt th.mk-th { text-transform: none; letter-spacing: 0; font-size: 12px; }
.mk-seg { margin-left: 0; padding: 2px; }
.mk-seg button { padding: 4px 11px; font-size: 12px; }
.mk-cxt td small { display: block; color: var(--muted); font-size: 11px; font-weight: 400; }
.mk-nota { margin: 14px 2px 0; }
.mk-prod td { vertical-align: middle; }
.mk-noimg { display: inline-block; background: var(--card-3); }
.mk-pt a { color: var(--ink); text-decoration: none; font-weight: 500; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mk-pt a:hover { color: var(--brand); text-decoration: underline; }
.mk-tach { text-decoration: line-through; }
.mk-fo { width: 72px; padding-right: 4px !important; }
.mk-fo img, .mk-fo .mk-noimg { width: 60px; height: 60px; border-radius: 10px; object-fit: cover; background: #fff; border: 1px solid var(--line); display: block; }
.mk-fo a:hover img { box-shadow: 0 0 0 2px var(--brand); }
.mk-pt { min-width: 220px; max-width: 380px; }
.mk-bm { cursor: grab; }
.mk-mllinks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.mk-mllinks a { padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: 12.5px; }
.mk-mllinks a:hover { border-color: var(--brand); color: var(--brand); }
.mk-del svg, .mk-barra .btn svg { width: 14px; height: 14px; }
.mk-del { padding-left: 7px; padding-right: 7px; }
.mk-barra { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; margin: -6px 0 12px; }
.mk-det { margin-top: 12px; font-size: 13px; }
.mk-det summary { cursor: pointer; color: var(--muted); }
.mk-imp { display: grid; gap: 6px; margin-top: 12px; }
.mk-imp > div { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.mk-imp img, .mk-imp .mk-noimg { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); background: #fff; }
.mk-imp span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
tr.mk-ex td { opacity: .55; }
tr.mk-grp td { background: var(--card-2); color: var(--muted); font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding-top: 7px; padding-bottom: 7px; }
.mk-res { max-width: 360px; }
.mk-res .chip { margin: 2px 0; }
.nowrap { white-space: nowrap; }
.mk-pasos { margin: 0; padding-left: 20px; font-size: 13px; color: var(--ink-2); }
.mk-pasos li { margin-bottom: 7px; }
.mk-checks { display: flex; flex-wrap: wrap; gap: 8px 18px; padding-top: 4px; }
.mk-spin { display: inline-block; width: 12px; height: 12px; border: 2px solid var(--line-2); border-top-color: var(--brand); border-radius: 50%; animation: mkgira .8s linear infinite; vertical-align: -2px; margin-right: 4px; }
@keyframes mkgira { to { transform: rotate(360deg); } }
@media (max-width: 760px) {
  .mk-bar { grid-template-columns: minmax(80px, 1fr) 1.2fr 36px 70px; gap: 8px; font-size: 12.5px; }
  .mk-pt { min-width: 200px; }
}
@media (max-width: 520px) { .modsw button { padding: 0 8px; font-size: 12px; letter-spacing: 0; } }

/* Mercado v21: secciones, participación, mejor evaluados, tendencias */
.mk-sec { margin: 22px 2px 10px; }
.mk-sec h2 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.mk-sec p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.mk-donut { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: center; }
.mk-donut svg { flex: none; }
.mk-donut circle:hover { opacity: .85; }
.mk-dc { fill: var(--ink); font-size: 20px; font-weight: 700; }
.mk-ds { fill: var(--muted); font-size: 11px; }
.mk-dl { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 160px; }
.mk-dl li { display: grid; grid-template-columns: 10px 1fr auto auto; gap: 8px; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.mk-dl li:last-child { border-bottom: 0; }
.mk-dl i { width: 10px; height: 10px; border-radius: 3px; }
.mk-dl span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-dl b { font-variant-numeric: tabular-nums; }
.mk-dl small { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 42px; text-align: right; }
.mk-best { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 14px; }
.mk-bcol { border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: var(--card); }
.mk-bh { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 2px 4px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.mk-bh small { color: var(--muted); font-size: 12px; }
.mk-bit { display: grid; grid-template-columns: 18px 44px 1fr; gap: 10px; align-items: center; padding: 7px 4px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.mk-bit:hover { background: var(--card-2); }
.mk-bn { color: var(--muted); font-weight: 700; font-size: 12px; text-align: center; }
.mk-bit img, .mk-bit .mk-noimg { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); background: #fff; }
.mk-bt { min-width: 0; }
.mk-bt b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 12.5px; font-weight: 600; line-height: 1.3; }
.mk-bt small { color: var(--muted); font-size: 11.5px; }
.mk-star { color: #b7791f; font-weight: 700; white-space: nowrap; }
.mk-cta { display: flex; align-items: center; gap: 14px; width: 100%; margin-top: 16px; padding: 14px 16px; text-align: left; cursor: pointer; font: inherit; color: var(--ink); }
.mk-cta:hover { border-color: #0f766e; }
.mk-cta b { display: block; font-size: 14.5px; }
.mk-cta small { color: var(--muted); }
.mk-cta .chev { margin-left: auto; font-size: 22px; color: var(--muted); }
.mk-granbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: -6px 0 16px; }
.mk-gran { margin-left: 0; }
.mk-u { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.mk-hall ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.mk-hall li { display: grid; grid-template-columns: 26px 1fr; gap: 8px; align-items: start; padding: 8px 6px; border-radius: 8px; font-size: 13.5px; line-height: 1.45; }
.mk-hall li.dest { background: color-mix(in srgb, var(--gold) 9%, transparent); }
.mk-hall li.suave { color: var(--muted); }
.mk-hi { font-size: 16px; line-height: 1.3; text-align: center; }
.mk-hall { margin-bottom: 14px; }
.mk-prog { padding: 26px 8px; text-align: center; }
.mk-pbar { height: 8px; border-radius: 99px; background: var(--card-3); overflow: hidden; max-width: 340px; margin: 0 auto 10px; }
.mk-pbar i { display: block; height: 100%; border-radius: 99px; background: #0f766e; }
@media (max-width: 760px) { .mk-donut { justify-content: flex-start; } .mk-best { grid-template-columns: 1fr; } }
/* ================================================================ factura con IA: todos los productos de una vez */
.sheet.fac-xl { max-width: min(1220px, 96vw); }
.fac-res { padding: 10px 12px; margin-bottom: 12px; border-radius: 10px; background: color-mix(in srgb, var(--gold) 10%, transparent); font-size: 13.5px; line-height: 1.45; }
.fac-bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 10px; padding: 10px; border: 1px dashed var(--line-2); border-radius: 10px; }
.fac-bulk .inp { width: auto; min-width: 150px; flex: 1 1 150px; }
.fac-mk { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.fac-mk .inp { width: 70px; min-width: 70px; flex: none; }
.fac-wrap { border: 1px solid var(--line); border-radius: 10px; }
.fac-tbl td { vertical-align: top; }
.fac-tbl .inp { min-width: 110px; }
.fac-tbl td:nth-child(2) .inp { min-width: 220px; }
.fac-tbl .fac-n { width: 96px; min-width: 80px; text-align: right; }
.fac-desc { margin-top: 3px; max-width: 320px; }
.fac-tbl tr.fac-ex td { background: var(--card-2); }
@media (max-width: 760px) {
  .fac-wrap { border: 0; }
  .fac-tbl thead { display: none; }
  .fac-tbl, .fac-tbl tbody { display: block; }
  .fac-tbl tr { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; padding: 12px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
  .fac-tbl tr.fac-ex td { background: none; }
  .fac-tbl td { display: block; padding: 0 !important; border: 0 !important; text-align: left !important; }
  .fac-tbl td:first-child { grid-column: 1 / -1; }
  .fac-tbl td:nth-child(2) { grid-column: 1 / -1; }
  .fac-tbl td[data-l]::before { content: attr(data-l); display: block; margin-bottom: 4px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
  .fac-tbl .inp, .fac-tbl td:nth-child(2) .inp, .fac-tbl .fac-n { width: 100%; min-width: 0; text-align: left; font-size: 16px; }
  .fac-desc { max-width: none; }
  .fac-bulk .inp { min-width: 0; flex-basis: 100%; }
}
/* ================================================================ insumos */
.pins-r { display: grid; grid-template-columns: minmax(0, 1fr) 90px auto 34px; gap: 8px; align-items: center; margin-bottom: 8px; }
.pins-r .inp { min-width: 0; }
.vins { margin: 6px 0 4px; }
.vins-a { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.vins-a:last-child { border-bottom: 0; }
.vins #vinsAuto { margin: 6px 0 10px; }
.cj-ins { margin: 2px 0 8px; color: var(--ink-2); line-height: 1.45; }
@media (max-width: 760px) { .pins-r { grid-template-columns: minmax(0, 1fr) 76px 34px; } .pins-r > span { display: none; } }
/* ================================================================ factura: código del proveedor y "¿es este?" */
.fac-inc { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; cursor: pointer; }
.fac-dec { margin-bottom: 6px; }
.fac-sv { margin: 0 0 6px; color: var(--ink-2); }
.fac-du:not([data-dec="nuevo"]) :is([name^="cat_"], [name^="mat_"], [name^="precio_"], .fac-nom) { display: none; }
.fac-du[data-dec="nuevo"] :is(.fac-xv, .fac-sv) { display: none; }
.fac-du:not([data-dec="otro"]) .fac-otro { display: none; }
.fac-du[data-dec="otro"] .fac-sv { display: none; }
.fac-tbl tr.fac-du[data-dec=""] td { background: color-mix(in srgb, var(--warn) 7%, var(--card)); }
.fac-desc b { color: var(--ink-2); white-space: nowrap; }
#facProvH .btn { margin-left: 6px; }
.pcod-r { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.pcod-c { font-family: ui-monospace, Consolas, monospace; font-size: 13px; letter-spacing: .02em; }
.pcod-add { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; margin-top: 8px; }
@media (max-width: 560px) { .pcod-add { grid-template-columns: 1fr; } .pcod-add .btn { width: 100%; } }
@media (max-width: 760px) { .fac-tbl tr.fac-du[data-dec=""] { background: color-mix(in srgb, var(--warn) 7%, var(--card)); border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); } .fac-tbl tr.fac-du[data-dec=""] td { background: none; } }
/* ================================================================ estado de la compra y mercadería en camino */
.cest { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cest-o, .f .cest-o { display: flex; margin: 0; font-size: 13px; font-weight: 400; color: var(--ink); gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); cursor: pointer; transition: border-color .15s, background .15s; }
.cest-o:hover { border-color: var(--line-2); }
.cest-o input { margin-top: 3px; accent-color: var(--brand); }
.cest-o b { display: block; font-size: 13.5px; }
.cest-o small { display: block; color: var(--muted); font-size: 12px; line-height: 1.35; }
.cest-o:has(input:checked) { border-color: var(--gold); background: var(--gold-soft); }
.cam { margin-bottom: 14px; border-left: 3px solid var(--warn); }
.cam-p { margin: -4px 0 10px; }
.cam-r { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--line); }
.cam-r.atr .cam-t b { color: var(--bad); }
.cam-i { min-width: 0; flex: 1 1 260px; }
.cam-t { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 2px; }
.cam-i small { display: block; line-height: 1.45; }
.cam-b { display: flex; gap: 8px; flex-wrap: wrap; }
.rcv { display: grid; gap: 6px; }
.rcv-r { display: grid; grid-template-columns: minmax(0, 1fr) auto 150px; gap: 12px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.rcv-r.falta { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); background: var(--bad-soft); }
.rcv-n { min-width: 0; } .rcv-n b { display: block; font-size: 13.5px; } .rcv-n small { font-size: 12px; }
.rcv-l, .f .rcv-l { display: flex; margin: 0; align-items: center; gap: 8px; color: var(--muted); }
.rcv-q { text-align: right; }
.rcv-todo { justify-content: end; }
.rcv-todo .btn { margin-top: auto; }
.rcv-res { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--card-2); font-size: 13.5px; }
.chip.encam { background: var(--info-soft); color: var(--info); }
.chip.info { display: inline-flex; width: auto; height: 22px; cursor: inherit; }   /* .info (ícono de ayuda) achicaba las etiquetas azules */
.fac-chi { background: color-mix(in srgb, #8a6d3b 16%, transparent); color: #8a6d3b; }
.fac-du:not([data-dec="ins"]) :is(.fac-ins, .fac-insh) { display: none; }
.fac-insh { margin: 4px 0 2px; color: var(--ink-2); }
.fac-tot { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 10px; margin-top: 12px; }
.fac-tot > div { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-radius: 10px; background: var(--card-2); }
.fac-tot b { font-size: 16px; } .fac-tot .fac-tt { background: var(--brand-soft); } .fac-tot .fac-tt b { font-size: 19px; }
@media (max-width: 760px) {
  .cest { grid-template-columns: 1fr; }
  .rcv-r { grid-template-columns: minmax(0, 1fr) 110px; } .rcv-p { grid-column: 1; grid-row: 2; }
  .rcv-l { grid-column: 2; grid-row: 1 / span 2; flex-direction: column; align-items: stretch; gap: 2px; font-size: 11.5px; }
  .rcv-q { font-size: 16px; }
  .cam-b { width: 100%; } .cam-b .btn { flex: 1 1 auto; justify-content: center; }
  .fac-tot { grid-template-columns: 1fr 1fr; } .fac-tot .fac-tt { grid-column: 1 / -1; }
  .fac-bulk .fac-mk { width: 100%; } .fac-bulk .fac-mk .inp { flex: 0 0 84px; min-width: 84px; width: 84px; }
}
/* ================================================================ fotos de producto en la revisión de compra + resumen */
.fac-tbl td:has(> .fac-ph) { position: relative; padding-left: 74px !important; }
.fac-ph { position: absolute; left: 14px; top: 10px; cursor: pointer; line-height: 0; }
.fac-du[data-dec="ins"] td:has(> .fac-ph) { padding-left: 14px !important; }
.fac-ph img { width: 48px; height: 48px; object-fit: cover; border-radius: 9px; border: 1px solid var(--line); background: #fff; }
.fac-ph input { position: absolute; opacity: 0; pointer-events: none; }
.fac-ph:has(input:not(:checked)) img { opacity: .25; filter: grayscale(1); }
.fac-ph:has(input:not(:checked))::after { content: "sin foto"; position: absolute; left: 0; right: 0; top: 18px; text-align: center; font-size: 10px; line-height: 1; font-weight: 700; color: var(--bad); }
.fac-du[data-dec="ins"] .fac-ph { display: none; }
.fac-tcx { border-color: var(--bad) !important; background: var(--bad-soft); }
.rs-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-bottom: 12px; font-size: 14px; }
.rs-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.rs-kpis > div { padding: 10px 12px; border-radius: 10px; background: var(--card-2); border: 1px solid var(--line); }
.rs-kpis small { display: block; color: var(--muted); font-size: 12px; } .rs-kpis b { font-size: 18px; }
.rs-kpis .rs-tot { background: var(--brand-soft); }
.rs-l { list-style: none; margin: 0 0 12px; padding: 0; }
.rs-l li { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.rs-l li:last-child { border-bottom: 0; }
.rs-l img, .rs-l .rs-nf { width: 38px; height: 38px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); background: var(--card-2); }
.rs-l .rs-nf { display: grid; place-items: center; color: var(--muted); font-size: 16px; }
.rs-l small { color: var(--muted); }
.rs-nota { margin: 4px 0; padding: 9px 12px; border-radius: 10px; background: var(--card-2); font-size: 13px; line-height: 1.45; }
@media (max-width: 760px) { .rs-kpis { grid-template-columns: 1fr 1fr; } .rs-kpis .rs-tot { grid-column: 1 / -1; } .fac-tbl td:has(> .fac-ph) { padding-left: 60px !important; min-height: 50px; } .fac-ph { left: 0; top: 0; } .fac-du[data-dec="ins"] td:has(> .fac-ph) { padding-left: 0 !important; } }
/* ================================================================ detalle de compra con fotos, avance y miniaturas */
.ph0 { display: inline-grid; place-items: center; background: var(--card-3); color: var(--muted); font-weight: 700; }
.cthumbs { display: inline-flex; align-items: center; flex: none; }
.cth { width: 30px; height: 30px; margin-left: -8px; border-radius: 8px; object-fit: cover; border: 2px solid var(--card); box-shadow: 0 0 0 1px var(--line); background: var(--card-3); font-size: 10.5px; }
.cth:first-child { margin-left: 0; }
.cth.mas { display: inline-grid; place-items: center; background: var(--card-2); color: var(--ink-2); font-weight: 700; }
.cprod { display: inline-flex; align-items: center; gap: 10px; }
.cam-r .cthumbs { margin-right: 2px; }
.cd { padding: 4px 2px 2px; }
.cd-top { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 12px; }
.cd-pasos { display: flex; list-style: none; margin: 0; padding: 0; flex: 1 1 340px; max-width: 540px; }
.cd-pasos li { flex: 1; position: relative; min-width: 0; padding-top: 22px; text-align: center; font-size: 12.5px; }
.cd-pasos li i { position: absolute; top: 3px; left: 50%; z-index: 1; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--card); border: 2px solid var(--line-2); }
.cd-pasos li::before { content: ""; position: absolute; top: 9px; left: -50%; right: 50%; height: 2px; background: var(--line-2); }
.cd-pasos li:first-child::before { display: none; }
.cd-pasos li.ok i { background: var(--ok); border-color: var(--ok); }
.cd-pasos li.ok::before, .cd-pasos li.hoy::before { background: var(--ok); }
.cd-pasos li.hoy i { background: var(--gold); border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); }
.cd-pasos li.hoy.atr i { background: var(--bad); border-color: var(--bad); box-shadow: 0 0 0 4px var(--bad-soft); }
.cd-pasos b { display: block; font-weight: 600; }
.cd-pasos small { display: block; padding: 0 4px; color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cd-btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.cd-kpis { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.cd-kpis > div { min-width: 110px; padding: 8px 12px; border-radius: 10px; background: var(--card-2); border: 1px solid var(--line); }
.cd-kpis small { display: block; color: var(--muted); font-size: 11.5px; }
.cd-kpis b { font-size: 15px; font-variant-numeric: tabular-nums; }
.cd-kpis .cd-tot { margin-left: auto; background: var(--brand-soft); } .cd-kpis .cd-tot b { font-size: 17px; }
.cd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.cd-it { display: flex; gap: 10px; align-items: flex-start; min-width: 0; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.cd-it:hover { border-color: var(--line-2); box-shadow: 0 2px 10px rgba(15, 23, 42, .07); }
.cd-it.ins { cursor: default; }
.cd-ph { flex: none; width: 56px; height: 56px; border-radius: 10px; object-fit: cover; border: 1px solid var(--line); background: #fff; font-size: 15px; }
.cd-tx { flex: 1; min-width: 0; font-size: 13px; line-height: 1.35; }
.cd-tx > b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-weight: 600; }
.cd-tx > small { display: block; color: var(--muted); font-size: 11px; }
.cd-n { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 2px 8px; margin-top: 3px; color: var(--ink-2); font-size: 12px; font-variant-numeric: tabular-nums; }
.cd-cred { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--card-2); font-size: 13px; }
.cd-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.rcv-n { display: flex; gap: 10px; align-items: center; }
.rcv-ph { flex: none; width: 40px; height: 40px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); background: #fff; font-size: 12px; }
@media (max-width: 760px) {
  .cd-grid { grid-template-columns: 1fr; }
  .cd-btns { width: 100%; justify-content: stretch; } .cd-btns .btn { flex: 1 1 auto; justify-content: center; }
  .cd-kpis > div { flex: 1 1 40%; min-width: 0; } .cd-kpis .cd-tot { flex-basis: 100%; margin-left: 0; }
  .cam-r .cthumbs { display: none; }
}
/* ================================================================ tienda online (Shopify) */
.tw-con { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; border-left: 3px solid var(--line-2); }
.tw-con.ok { border-left-color: #5e8e3e; }
.tw-ci { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 12px; background: color-mix(in srgb, #5e8e3e 14%, transparent); font-size: 20px; }
.tw-ct { flex: 1 1 260px; min-width: 0; } .tw-ct > b { display: block; font-size: 14.5px; } .tw-ct > small { display: block; line-height: 1.45; }
.tw-pasos { margin: 6px 0 0; padding-left: 18px; color: var(--ink-2); } .tw-pasos li { margin: 2px 0; }
.tw-kpis { margin-bottom: 14px; }
.tw-k.bad .val { color: var(--bad); }
.tw-seg { margin: 0 0 12px; }
.pw-tbl td { vertical-align: middle; }
.pw-tbl td.first b { font-size: 14.5px; }
.pw-tbl td.act .btn { white-space: nowrap; }
.pw-alerta { cursor: help; }
.pw-ok { margin-left: 4px; font-size: 11.5px; font-weight: 600; color: var(--ok); white-space: nowrap; }
.pw-path li small { font-size: 11px; font-weight: 400; color: var(--muted); }
.pw-warn { margin: 8px 0 0; padding: 7px 10px; border-radius: 9px; background: var(--warn-soft); color: var(--ink-2); font-size: 12.5px; line-height: 1.4; }
.pw-warn.pw-warn-f { margin: 0 0 14px; padding: 10px 12px; font-size: 13px; }
.pw-main { display: flex; flex-direction: column; gap: 14px; }
.pw-lineas, .pw-ed { display: grid; gap: 6px; }
.pw-l { display: flex; gap: 10px; align-items: flex-start; padding: 8px; border: 1px solid var(--line); border-radius: 12px; }
.pw-l .cd-tx { flex: 1 1 auto; min-width: 0; }
.pw-l .cd-tx small { display: block; }
.pw-lv { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; flex: none; font-size: 12.5px; }
.pw-lv b { font-size: 14px; }
.pw-asig { margin-top: 6px; } .pw-asig .inp { height: 34px; font-size: 13px; }
.pw-tots { display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: flex-end; margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--card-2); font-size: 13.5px; }
.pw-tots .pw-tt b { font-size: 17px; }
.pw-nota { padding: 4px 0; font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.pw-btns { padding-top: 10px; justify-content: flex-start !important; }
.pw-chks { display: grid; gap: 10px; }
.pw-chk { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.4; cursor: pointer; }
.pw-chk input { flex: none; margin-top: 2px; accent-color: var(--primary); }
.pw-chk small { display: block; margin-top: 2px; }
.pw-q { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: none; }
.pw-q .inp { width: 84px; height: 36px; text-align: right; }
.pw-nuevo { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.pw-nuevo [data-nsku] { flex: 1 1 auto; min-width: 0; }
.pw-nuevo [data-nq] { flex: none; width: 76px; text-align: right; }
.sheet.tw-sheet { max-width: min(900px, 96vw); }
.tw-pub-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; } .tw-pub-bar .inp { flex: 1 1 220px; }
.tw-pub { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; max-height: 52vh; overflow: auto; padding: 2px; }
.tw-pi { display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.tw-pi[hidden] { display: none; }
.tw-pi:has(input:checked) { border-color: #5e8e3e; background: color-mix(in srgb, #5e8e3e 7%, var(--card)); }
.tw-pi input { flex: none; accent-color: #5e8e3e; }
.tw-pi .cd-tx small { display: block; }
.tw-pub-res { margin-top: 10px; color: var(--ink-2); }
@media (max-width: 760px) {
  .tw-pub { grid-template-columns: 1fr; max-height: none; }
  .pw-tbl.stack td.act { position: static; margin-top: 8px; text-align: left !important; }
  .pw-tbl.stack td.act:empty { display: none; }
  .pw-tbl.stack td[data-l="Productos"] { display: flex; align-items: center; gap: 6px; }
  .pw-l { flex-wrap: wrap; }
  .pw-l .cd-tx { flex: 1 1 0; }
  .pw-lv { flex-direction: row; align-items: baseline; gap: 8px; width: 100%; justify-content: flex-end; }
  .pw-path ol { flex: 1 1 100%; min-width: 0; }
  .pw-path li { min-width: 0; padding: 2px 1px; font-size: 11.5px; white-space: normal; }
}

/* ================================================================ celular: tablas → tarjetas, agenda, flujo y textos legibles */
.mk-dl small { font-size: 12px; }
.rec-grid > * { min-width: 0; }
@media (max-width: 1000px) { .rec-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .tscroll:has(> table.tcard) { overflow: visible; margin: 0; }
  table.tcard thead { display: none; }
  table.tcard, table.tcard > tbody { display: block; width: 100%; }
  table.tcard > tbody > tr { display: grid; grid-template-columns: minmax(0, 1fr); padding: 12px 14px; border-bottom: 1px solid var(--line); }
  table.tcard > tbody > tr:last-child { border-bottom: 0; }
  table.tcard > tbody > tr:hover td { background: none; }
  table.tcard > tbody > tr > td { display: flow-root; min-width: 0; padding: 4px 0 !important; border: 0 !important; text-align: right !important; font-size: 14px; line-height: 1.4; white-space: normal; }
  table.tcard > tbody > tr > td::before { content: attr(data-l); float: left; max-width: 52%; margin-right: 12px; color: var(--muted); font-size: 13px; font-weight: 500; text-align: left; }
  table.tcard > tbody > tr > td[data-l=""]::before, table.tcard td.kv-t::before, table.tcard td.kv-full::before, table.tcard td.kv-img::before, table.tcard td.kv-act::before { content: none; }
  table.tcard td.kv-t { text-align: left !important; font-size: 15px; font-weight: 600; padding-bottom: 6px !important; }
  table.tcard td.kv-t .small, table.tcard td.kv-t small { font-weight: 400; }
  table.tcard td.kv-full { text-align: left !important; }
  table.tcard td.kv-act { text-align: left !important; padding-top: 8px !important; }
  table.tcard td.rn { display: none; }
  table.tcard .nowrap { white-space: normal; }
  table.tcard .mk-pt { min-width: 0; max-width: none; }
  table.tcard .mk-res { max-width: none; }
  table.tcard tr.mk-grp { padding: 0; }
  table.tcard tr.mk-grp td { padding: 8px 14px !important; }
  table.tcard.tcard-foto > tbody > tr { grid-template-columns: 60px minmax(0, 1fr); column-gap: 12px; }
  table.tcard.tcard-foto > tbody > tr > td { grid-column: 1 / -1; }
  table.tcard.tcard-foto td.kv-img { grid-column: 1; grid-row: 1 / span 2; text-align: left !important; }
  table.tcard.tcard-foto td.kv-img img, table.tcard.tcard-foto td.kv-img .mk-noimg { width: 60px; height: 60px; }
  table.tcard.tcard-foto td.kv-t { grid-column: 2; padding-top: 0 !important; }
  table.tcard.tcard-foto td.kv-t + td { grid-column: 2; text-align: left !important; }
  table.tcard.tcard-foto td.kv-t + td::before { content: none; }

  /* Agenda (mes): cada actividad es una barra de color; tocar el día lo abre */
  .ag-grid { grid-auto-rows: minmax(56px, auto); }
  .ag-cel .ag-ev, .ag-cel .ag-ev.venc { height: 6px; margin: 4px 1px 0; padding: 0; font-size: 0; line-height: 0; border: 0; border-radius: 3px; background: var(--ec); pointer-events: none; }
  .ag-cel .ag-ev.venc { background: repeating-linear-gradient(90deg, var(--ec) 0 5px, transparent 5px 8px); }
  .ag-cel .ag-mas { font-size: 11px; padding: 2px 1px 0; pointer-events: none; }
  .ag-n { font-size: 13px; }

  /* Flujo de caja: columna de conceptos más angosta para ver más meses */
  .fc { font-size: 12.5px; }
  .fc th, .fc td { padding: 7px 10px 7px 8px; }
  .fc td:first-child, .fc th:first-child { min-width: 150px; width: 150px; max-width: 150px; padding-left: 10px; }
  .fc tr.ind td:first-child { padding-left: 16px; }

  .cj-prod small { font-size: 12px; }
  .mk-bar .nm { white-space: normal; overflow-wrap: anywhere; line-height: 1.25; }
  .mk-dl { flex-basis: 100%; }
}
@media (max-width: 560px) {
  .qa { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; overflow: visible; margin: 0 0 16px; padding: 0; }
  .qa .btn { width: 100%; min-width: 0; justify-content: center; padding: 0 8px; }
  .qa .btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
/* ================================================================ barra lateral (Fase 3) */
.app-side { display: none; }
.menu-sg { padding: 8px 22px 2px; color: var(--muted); font-size: 11px; font-weight: 500; letter-spacing: .04em; }
.dd .dd-h { padding: 6px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
@media (min-width: 901px) {
  .app-nav { display: none; }
  .app-hdr ~ main { margin-top: calc(56px + env(safe-area-inset-top)); }
  .app-side { display: flex; flex-direction: column; gap: 8px; position: fixed; z-index: 38; top: calc(56px + env(safe-area-inset-top)); left: 0; bottom: 0; width: 232px; padding: 14px 10px 10px; overflow-y: auto; background: var(--card); border-right: 1px solid var(--line); scrollbar-width: thin; }
  main { width: auto; margin-left: 232px; }
  .side-nav { display: flex; flex-direction: column; gap: 12px; }
  .side-g { display: flex; flex-direction: column; gap: 2px; }
  .side-gt { padding: 0 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
  .side-i { display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 8px; border: 0; border-radius: 10px; background: none; color: var(--ink-2); font: inherit; font-size: 13.5px; font-weight: 500; text-align: left; cursor: pointer; transition: background .15s, color .15s; }
  .side-i:hover { background: var(--card-3); color: var(--ink); }
  .side-i.on { background: var(--pill); color: var(--pill-ink); font-weight: 600; }
  .side-ic { flex: none; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; color: var(--ic, var(--muted)); }
  .side-i.on .side-ic { color: inherit; }
  .side-ic svg { width: 17px; height: 17px; }
  .side-l { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .side-col { margin-top: auto; align-self: flex-end; flex: none; width: 32px; height: 32px; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
  .side-col:hover { background: var(--card-3); color: var(--ink); }
  .side-col svg { width: 16px; height: 16px; transform: rotate(90deg); transition: transform .2s; }
  body.side-mini .app-side { width: 64px; padding-inline: 8px; }
  body.side-mini main { margin-left: 64px; }
  body.side-mini .side-gt, body.side-mini .side-l { display: none; }
  body.side-mini .side-g + .side-g { border-top: 1px solid var(--line); padding-top: 10px; }
  body.side-mini .side-nav { gap: 10px; }
  body.side-mini .side-i { justify-content: center; padding: 0; }
  body.side-mini .side-col { align-self: center; }
  body.side-mini .side-col svg { transform: rotate(-90deg); }
  body .med-btn { left: calc(232px + 14px); }
  body.side-mini .med-btn { left: calc(64px + 14px); }
}
@media (max-width: 900px) {
  .mnav button span { white-space: normal; text-align: center; line-height: 1.15; }
}
@media (max-width: 400px) {   /* celulares angostos: que quepan módulo, buscar, +, ayuda, avisos y tu cuenta */
  .app-hdr .brand { display: none; }
  .app-hdr .hbtn, .app-hdr .avatar-me { width: 34px; height: 34px; }
  .app-hdr .hdr-actions { gap: 2px; }
}
/* ================================================================ diseño (Fase 3) */
/* Borde de foco (al moverse con Tab): dorado oscuro en modo claro = contraste 4,9:1 (antes 2,4:1).
   En el encabezado azul y en modo oscuro se mantiene el dorado claro (6,7:1 y 8,3:1). */
:root { --focus-c: var(--gold-2); }
:root[data-theme="dark"] { --focus-c: var(--gold); }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] { --focus-c: var(--gold); } }
:focus-visible { outline-color: var(--focus-c); }
.app-hdr :focus-visible { outline-color: var(--gold); }
.inp:focus { border-color: var(--focus-c); }
/* Animaciones de máximo 0,3 s */
.progress i, .hbar .fill, .goal .fill { transition-duration: .3s; }
/* Gráfico sin datos */
.chart text.chart-vacio { font-size: 13px; fill: var(--muted); }
/* ================================================================ teclado (Fase 3) */
tr[tabindex]:focus-visible { outline: 2px solid var(--focus-c); outline-offset: -2px; }
tr[tabindex]:focus-visible td { background: var(--card-2); }
th[tabindex]:focus-visible, .ag-cel[tabindex]:focus-visible { outline-offset: -2px; }
.dd :focus-visible { outline-offset: -2px; }
/* ================================================================ configuración (Fase 3) */
.cfg-s { margin-top: 20px; }
.cfg-s h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 0 0 10px; font-weight: 700; }
.cfg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 14px; }
.cfg-c { display: flex; flex-direction: column; gap: 8px; }
.cfg-h { display: flex; align-items: center; gap: 10px; }
.cfg-h h3 { margin: 0; font-size: 15px; flex: 1; min-width: 0; }
.cfg-c p { margin: 0; color: var(--ink-2); font-size: 13px; line-height: 1.45; }
.cfg-a { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 4px; }
.cfg-c small { color: var(--muted); font-size: 12px; }
.cfg-tema { display: flex; flex-wrap: wrap; gap: 6px; }
.cfg-tema .btn.on { background: var(--gold-soft); border-color: var(--gold); color: var(--ink); font-weight: 600; }
.cfg-nota { margin: 20px 0 0; }
/* ================================================================ Mercado: evolución de un producto */
.mkh-cab { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.mkh-cab img { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; flex: none; background: var(--card-2); }
.mkh-cab b { display: block; font-size: 15px; line-height: 1.3; }
.mkh-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
.mkh-k { background: var(--card-2); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.mkh-k span { display: block; font-size: 12px; color: var(--muted); }
.mkh-k b { display: block; font-size: 18px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.mkh-k small { display: block; font-size: 12px; color: var(--ink-2); margin-top: 2px; }
/* ================================================================ asistente con IA (Fase 6) */
.ia-in { display: flex; gap: 8px; }
.ia-in .inp { flex: 1; min-width: 0; }
.ia-priv { font-size: 12.5px; color: var(--muted); margin: 8px 0 14px; line-height: 1.45; }
.ia-r { border-top: 1px solid var(--line); padding: 14px 0; }
.ia-r:first-child { border-top: 0; padding-top: 4px; }
.ia-q { display: flex; gap: 8px; align-items: center; font-weight: 600; margin-bottom: 10px; }
.ia-q svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.ia-a { background: var(--card-2); border-radius: 12px; padding: 12px 14px; }
.ia-a .mkh-k { background: var(--card); }
.ia-t { font-weight: 700; margin-bottom: 10px; }
.ia-pie { font-size: 11.5px; color: var(--muted); margin: 10px 0 0; }
/* =====================================================================
   Diseño Sobrio · para cambiar colores: solo estos bloques
   ===================================================================== */
:root {
  --bg: #ffffff; --card: #ffffff; --card-2: #f8fafc; --card-3: #f1f5f9; --head: #f8fafc;
  --ink: #0f172a; --ink-2: #334155; --muted: #64748b; --line: #e5e7eb; --line-2: #d1d5db;
  --navy: #111827; --navy-2: #1f2937; --brand: #1d4ed8; --brand-2: #2563eb; --brand-dark: #1e3a8a; --brand-soft: #eef3fe; --link: #1d4ed8;
  --gold: #1d4ed8; --gold-2: #1d4ed8; --gold-soft: #e8eefc; --gold-claro: #bfd0f8;   /* = color de acento */
  --primary: #1d4ed8; --primary-ink: #ffffff; --primary-hover: #1e40af; --pill: #1d4ed8; --pill-ink: #ffffff;
  --c1: #2563eb; --c2: #0d9488; --c3: #db2777; --c4: #d97706; --c5: #16a34a; --c6: #7c3aed; --c7: #dc2626; --c8: #0891b2;
  --hdr-bg: #ffffff; --hdr-ink: #475569;
  --seg-bg: #f1f5f9; --seg-on: #ffffff; --seg-on-ink: #0f172a;   /* selector CRM · ERP · Mercado */
  /* barra lateral */
  --lat-bg: #f7f8fa; --lat-borde: #e5e7eb; --lat-ink: #0f172a; --lat-ink-2: #475569; --lat-icono: #94a3b8; --lat-muted: #94a3b8;
  --lat-hover: #eef0f3; --lat-linea: #e9ebef; --lat-activo: #e8eefc; --lat-activo-ink: #1d4ed8;
  /* botón IA */
  --ia-ink: #0f172a; --ia-icono: #1d4ed8; --ia-borde: #d1d5db; --ia-hover: #f8fafc;
  --radius: 10px; --r-sm: 6px; --r-lg: 12px;
  --sh-1: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow: 0 1px 2px rgba(16, 24, 40, .04);
  --sh-pop: 0 16px 40px -12px rgba(16, 24, 40, .22), 0 4px 10px -4px rgba(16, 24, 40, .08);
  --f-titulo: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --f-texto: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
:root[data-theme="dark"] {
  --bg: #070d1a; --card: #0d1628; --card-2: #111c32; --card-3: #17233c; --head: #0f192d;
  --ink: #e6edf8; --ink-2: #b8c5db; --muted: #8394b2; --line: #1a2741; --line-2: #263655;
  --brand: #3b82f6; --brand-2: #60a5fa; --brand-dark: #1e3a8a; --brand-soft: rgba(59, 130, 246, .16); --link: #7fb0ff;
  --gold: #3b82f6; --gold-2: #8ab4ff; --gold-soft: rgba(59, 130, 246, .16); --gold-claro: #9cc0ff;
  --primary: #2563eb; --primary-ink: #ffffff; --primary-hover: #3b82f6; --pill: #2563eb; --pill-ink: #ffffff;
  --c1: #22d3ee; --c2: #f472b6; --c3: #a78bfa; --c4: #fbbf24; --c5: #34d399; --c6: #60a5fa; --c7: #fb7185; --c8: #2dd4bf;
  --hdr-bg: #070d1a; --hdr-ink: #b8c5db;
  --seg-bg: #0d1628; --seg-on: #1c2b49; --seg-on-ink: #ffffff;
  --lat-bg: #091122; --lat-borde: #16223a; --lat-ink: #eef3fb; --lat-ink-2: #b8c5db; --lat-icono: #6f82a4; --lat-muted: #5f7193;
  --lat-hover: #101b31; --lat-linea: #16223a; --lat-activo: rgba(59, 130, 246, .18); --lat-activo-ink: #dbe7ff;
  --ia-ink: #e6edf8; --ia-icono: #8ab4ff; --ia-borde: #263655; --ia-hover: #111c32;
  --tip-bg: #0b1424; --tip-ink: #e6edf8;
  --ok: #34d399; --ok-soft: rgba(52, 211, 153, .14); --bad: #fb7185; --bad-soft: rgba(251, 113, 133, .14);
  --sh-1: 0 1px 2px rgba(0, 0, 0, .35); --shadow: 0 1px 2px rgba(0, 0, 0, .35);
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
  --bg: #070d1a; --card: #0d1628; --card-2: #111c32; --card-3: #17233c; --head: #0f192d;
  --ink: #e6edf8; --ink-2: #b8c5db; --muted: #8394b2; --line: #1a2741; --line-2: #263655;
  --brand: #3b82f6; --brand-2: #60a5fa; --brand-dark: #1e3a8a; --brand-soft: rgba(59, 130, 246, .16); --link: #7fb0ff;
  --gold: #3b82f6; --gold-2: #8ab4ff; --gold-soft: rgba(59, 130, 246, .16); --gold-claro: #9cc0ff;
  --primary: #2563eb; --primary-ink: #ffffff; --primary-hover: #3b82f6; --pill: #2563eb; --pill-ink: #ffffff;
  --c1: #22d3ee; --c2: #f472b6; --c3: #a78bfa; --c4: #fbbf24; --c5: #34d399; --c6: #60a5fa; --c7: #fb7185; --c8: #2dd4bf;
  --hdr-bg: #070d1a; --hdr-ink: #b8c5db;
  --seg-bg: #0d1628; --seg-on: #1c2b49; --seg-on-ink: #ffffff;
  --lat-bg: #091122; --lat-borde: #16223a; --lat-ink: #eef3fb; --lat-ink-2: #b8c5db; --lat-icono: #6f82a4; --lat-muted: #5f7193;
  --lat-hover: #101b31; --lat-linea: #16223a; --lat-activo: rgba(59, 130, 246, .18); --lat-activo-ink: #dbe7ff;
  --ia-ink: #e6edf8; --ia-icono: #8ab4ff; --ia-borde: #263655; --ia-hover: #111c32;
  --tip-bg: #0b1424; --tip-ink: #e6edf8;
  --ok: #34d399; --ok-soft: rgba(52, 211, 153, .14); --bad: #fb7185; --bad-soft: rgba(251, 113, 133, .14);
  --sh-1: 0 1px 2px rgba(0, 0, 0, .35); --shadow: 0 1px 2px rgba(0, 0, 0, .35);
  }
}

/* ---------- base y tipografía ---------- */
body { font-family: var(--f-texto); font-feature-settings: normal; letter-spacing: 0; background: var(--bg); }
.page-head .eyebrow { color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: .06em; }
.page-head h1 { font-family: var(--f-titulo); font-size: 24px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.obj-icon { background: var(--card-3) !important; color: var(--ink-2) !important; box-shadow: inset 0 0 0 1px var(--line); border-radius: 8px; }
.page-head > .obj-icon { width: 40px; height: 40px; }
.page-head > .obj-icon svg { width: 20px; height: 20px; }
.stat .val, .kpi .val, .mkh-k b { font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .val { font-size: 26px; }
.num, .right, .tbl td { font-variant-numeric: tabular-nums; }
.dash-hero h1 { font-weight: 700; letter-spacing: -.02em; }
.mhead h3, .dlg h3 { font-weight: 700; letter-spacing: -.01em; }
.onb { background: var(--card); }
.progress i { background: var(--gold); }
.hbar .fill { background: var(--c1); }

/* ---------- tarjetas ---------- */
.card { border-color: var(--line); box-shadow: var(--shadow); }
.card-h h3 { font-size: 14px; font-weight: 600; letter-spacing: 0; }
.card-h .ci { width: 28px; height: 28px; border-radius: 7px; background: var(--card-3); color: var(--ink-2); }
.kpi { border-left: 1px solid var(--line); }
.kpi .ki { width: 36px; height: 36px; border-radius: 8px; background: var(--card-3); color: var(--ink-2); }
.kpi .ki svg { width: 18px; height: 18px; }

/* ---------- botones y campos ---------- */
.btn { border-radius: var(--r-sm); font-weight: 500; box-shadow: none; transition: background .15s, border-color .15s, color .15s; }
.btn:hover { box-shadow: none; }
.btn.primary, .btn.gold { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); box-shadow: none; }
.btn.primary:hover, .btn.gold:hover { background: var(--primary-hover); border-color: var(--primary-hover); transform: none; }
.seg { border-radius: 8px; padding: 3px; background: var(--seg-bg); }
.seg button { border-radius: 6px; padding: 6px 12px; color: var(--muted); }
.seg button.on { background: var(--seg-on); color: var(--seg-on-ink); font-weight: 600; box-shadow: 0 1px 2px rgba(16, 24, 40, .1), inset 0 0 0 1px var(--line); }
.seg button.on em { background: var(--gold-soft); color: var(--gold-2); }
.inp { border-radius: var(--r-sm); border-color: var(--line-2); }
.chip { font-weight: 500; border-radius: 6px; }

/* ---------- tablas ---------- */
.tbl th { background: var(--card-2); color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: .04em; border-bottom-color: var(--line); }
.tbl td { border-bottom-color: var(--line); }
.tbl tr.click:hover td, .tbl tbody tr:hover td { background: var(--card-2); }
.fc tr.sec td, .fc tr.sec td:first-child { background: var(--card-3); color: var(--ink); font-weight: 700; letter-spacing: .03em; }

/* ---------- encabezado ---------- */
body::before { background: var(--hdr-bg); }
.app-hdr { color: var(--ink); background: var(--hdr-bg); -webkit-backdrop-filter: none; backdrop-filter: none; border-bottom: 1px solid var(--line); box-shadow: none; }
.app-hdr .brand { color: var(--ink); }
.app-hdr .brand b { color: var(--ink); }
.app-hdr :focus-visible { outline-color: var(--gold); }
.app-hdr .hbtn { color: var(--hdr-ink); border-radius: 8px; }
.app-hdr .hbtn:hover { background: var(--card-3); color: var(--ink); }
.app-hdr .hbtn .badge { border-color: var(--hdr-bg); }
.app-hdr .modsw { background: var(--seg-bg); border: 1px solid var(--line); border-radius: 8px; padding: 3px; }
.app-hdr .modsw button { color: var(--muted); border-radius: 6px; font-weight: 500; }
.app-hdr .modsw button:hover { color: var(--ink); }
.app-hdr .modsw button.on { background: var(--seg-on); color: var(--seg-on-ink); font-weight: 600; box-shadow: 0 1px 2px rgba(16, 24, 40, .1), inset 0 0 0 1px var(--line); }
.app-hdr .cmdk-btn { background: var(--card); border: 1px solid var(--line-2); border-radius: 8px; color: var(--muted); }
.app-hdr .cmdk-btn:hover { border-color: var(--muted); color: var(--ink-2); background: var(--card); }
.app-hdr .cmdk-btn kbd { background: var(--card-2); border-color: var(--line); color: var(--muted); }
.app-hdr .avatar-me { background: var(--gold-soft); color: var(--gold-2); border-color: transparent; font-weight: 600; }
.app-hdr .avatar-me:hover { box-shadow: 0 0 0 3px var(--gold-soft); }

/* ---------- botón IA: quieto, borde fino ---------- */
.ia-btn { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px 0 10px; border: 1px solid var(--ia-borde); border-radius: 8px;
  background: var(--card); color: var(--ia-ink); font: inherit; font-weight: 600; font-size: 13px; cursor: pointer; transition: background .15s, border-color .15s; }
.ia-btn:hover { background: var(--ia-hover); border-color: var(--muted); }
.ia-chispa { display: grid; place-items: center; color: var(--ia-icono); }
.ia-chispa svg { width: 16px; height: 16px; transition: transform .2s; }
.ia-btn:hover .ia-chispa svg { transform: rotate(18deg); }
.ia-txt { color: inherit; }
.ia-a { background: var(--card-2); border: 1px solid var(--line); }
.ia-t { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }

/* ---------- pasos como tarjetas conectadas (oportunidad, interesado, pedido web) ---------- */
.path ol { gap: 22px; padding: 2px 2px 4px; }
.path li { min-width: 100px; padding: 10px 10px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); gap: 6px; font-weight: 500; transition: border-color .15s, background .15s; }
.path li:hover { border-color: var(--line-2); background: var(--card-2); }
.path li:hover::before { transform: none; }
.path li::before { width: 26px; height: 26px; border-width: 0; background: var(--card-3); color: var(--muted); font-weight: 600; font-size: 12px; }
.path li::after { top: 50%; left: -23px; right: auto; width: 23px; height: 2px; margin-top: -1px; background: var(--line-2); }
.path li.done::after, .path li.cur::after, .path li.won::after, .path li.lost::after { background: var(--ok); }
.path li.cur { border-color: var(--gold); background: var(--gold-soft); color: var(--ink); }
.path li.cur::before { background: var(--gold); color: #fff; box-shadow: none; }
.path li.won { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }
.path li.won::before { background: var(--ok); color: #fff; }
.path li.lost { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
/* compras: Pedida -> En tránsito -> En bodega */
.cd-pasos { gap: 20px; }
.cd-pasos li { padding: 28px 8px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); font-weight: 500; }
.cd-pasos li i { top: 9px; width: 14px; height: 14px; margin-left: -7px; }
.cd-pasos li::before { top: 50%; left: -21px; right: auto; width: 21px; height: 2px; margin-top: -1px; background: var(--line-2); }
.cd-pasos li:first-child::before { display: none; }
.cd-pasos li.ok::before, .cd-pasos li.hoy::before { background: var(--ok); }
.cd-pasos li.hoy { border-color: var(--gold); background: var(--gold-soft); }

/* ---------- pantalla de ingreso ---------- */
.login-right { background: #111318; }
.lr-eyebrow { color: #9cc0ff; }
.lr-kpis div { border-left-color: #2563eb; }
.lr-chart i { background: #3b82f6; }

/* ---------- celular ---------- */
.mnav { background: var(--hdr-bg); border-top: 1px solid var(--line); }
.mnav button.on { color: var(--gold-2); font-weight: 600; }
.mnav button.on::before { background: var(--gold); box-shadow: none; }
@media (max-width: 900px) {
  .ia-btn { height: 34px; padding: 0 10px 0 8px; font-size: 12.5px; }
  .page-head h1 { font-size: 22px; }
}
@media (max-width: 480px) {
  .app-hdr .hbtn[data-act="ayuda"] { display: none; }   /* la ayuda sigue en Configuración -> Ayuda y atajos */
  .app-hdr { gap: 8px; padding-inline: 10px; }
  .app-hdr .modsw button { padding: 0 9px; }
  .ia-btn { gap: 4px; padding: 0 8px 0 7px; }
}
@media (max-width: 400px) {   /* celulares angostos: módulos, IA, buscar, +, avisos y tu cuenta en una línea */
  .app-hdr { gap: 6px; padding-inline: 8px; }
  .app-hdr .modsw button { padding: 0 7px; font-size: 12px; }
  .app-hdr .hbtn { width: 32px; height: 32px; }
  .app-hdr .avatar-me { width: 32px; height: 32px; margin-left: 2px; }
  .ia-btn { padding: 0 7px 0 6px; }
}

/* ---------- computador: barra lateral gris claro de arriba a abajo con el logo ---------- */
.side-brand { display: none; }
@media (min-width: 901px) {
  .app-side { top: 0; z-index: 41; width: 240px; padding: 14px 10px 12px; background: var(--lat-bg); border-right: 1px solid var(--lat-borde); scrollbar-width: thin; scrollbar-color: var(--lat-linea) transparent; }
  main { margin-left: 240px; padding: 24px 32px 60px; }
  .app-hdr { left: 240px; height: 60px; padding: 0 24px; }
  .app-hdr ~ main { margin-top: 60px; }
  .app-hdr .brand { display: none; }
  .app-hdr .cmdk-btn { height: 38px; }
  .side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; margin-bottom: 4px; color: var(--lat-ink); font-weight: 700; font-size: 15px; letter-spacing: -.01em; white-space: nowrap; }
  .side-brand img { width: 28px; height: 28px; border-radius: 7px; }
  .side-brand b { color: var(--lat-ink); font-weight: 700; }
  .side-nav { gap: 12px; }
  .side-gt { color: var(--lat-muted); font-size: 11px; font-weight: 600; letter-spacing: .06em; padding: 0 10px 4px; }
  .side-i { height: 34px; color: var(--lat-ink-2); border-radius: 6px; font-weight: 500; font-size: 13.5px; }
  .side-i .side-ic { color: var(--lat-icono); }
  .side-i:hover { background: var(--lat-hover); color: var(--lat-ink); }
  .side-i:hover .side-ic { color: var(--lat-ink-2); }
  .side-i.on { background: var(--lat-activo); color: var(--lat-activo-ink); font-weight: 600; }
  .side-i.on .side-ic { color: var(--lat-activo-ink); }
  .side-i:focus-visible { outline-color: var(--gold); }
  .side-col { color: var(--lat-muted); }
  .side-col:hover { background: var(--lat-hover); color: var(--lat-ink); }
  body.side-mini .app-side { width: 64px; }
  body.side-mini main { margin-left: 64px; }
  body.side-mini .app-hdr { left: 64px; }
  body.side-mini .side-brand { justify-content: center; padding: 4px 0 14px; }
  body.side-mini .side-brand span { display: none; }
  body.side-mini .side-g + .side-g { border-top-color: var(--lat-linea); }
  body .med-btn { left: calc(240px + 14px); }
  body.side-mini .med-btn { left: calc(64px + 14px); }
}
/* ================================================================ tableros kanban */
.kb-vista { margin: 0 0 14px; }
.kb { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 14px; overflow-x: auto; padding: 2px 2px 10px; scroll-snap-type: x proximity; }
.kb-col { --kb-c: var(--gold); display: flex; flex-direction: column; min-height: 340px; background: var(--card-2); border: 1px solid var(--line); border-radius: 10px; scroll-snap-align: start; transition: border-color .15s, background .15s, box-shadow .15s; }
.kb-col.encima { border-color: var(--kb-c); background: color-mix(in srgb, var(--kb-c) 7%, var(--card-2)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--kb-c) 22%, transparent); }
.kb-h { padding: 12px 14px 10px; border-top: 3px solid var(--kb-c); border-radius: 10px 10px 0 0; border-bottom: 1px solid var(--line); }
.kb-t { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13.5px; }
.kb-t em { margin-left: auto; font-style: normal; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 6px; background: var(--card-3); color: var(--ink-2); }
.kb-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--kb-c); }
.kb-m { font-size: 19px; font-weight: 700; letter-spacing: -.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kb-h small { color: var(--muted); font-size: 11.5px; }
.kb-cards { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 10px; }
.kb-card { display: flex; flex-direction: column; gap: 4px; padding: 11px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--sh-1); cursor: pointer; transition: box-shadow .15s, border-color .15s; }
.kb-card[draggable="true"] { cursor: grab; }
.kb-card:hover { border-color: var(--line-2); box-shadow: 0 4px 12px -6px rgba(16, 24, 40, .18); }
.kb-card.arrastrando { opacity: .45; transform: rotate(1.5deg); }
.kb-card b { font-size: 13.5px; line-height: 1.3; }
.kb-sub { color: var(--muted); font-size: 12px; }
.kb-pie { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.kb-monto { font-weight: 700; font-size: 13.5px; font-variant-numeric: tabular-nums; margin-right: auto; }
.kb-av { margin-left: auto; flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 10.5px; font-weight: 600; color: var(--gold-2); background: var(--gold-soft); }
.kb-vacio { flex: 1; display: grid; place-items: center; min-height: 80px; border: 1.5px dashed var(--line-2); border-radius: 8px; color: var(--muted); font-size: 12.5px; }
.kb-ayuda { margin: 8px 0 0; }
.kb-tactil { display: none; }
@media (hover: none) { .kb-raton { display: none; } .kb-tactil { display: inline; } }
@media (max-width: 900px) { .kb { grid-auto-columns: 82%; } }
/* ventas: cuántas tienen los datos del cliente */
.cli-cob { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 12px; font-size: 13.5px; }
.cli-cob > div { display: flex; align-items: center; gap: 10px; }
.cli-cob svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.cli-cob b.num { font-size: 15px; }
.cli-cob.ok { color: var(--muted); }
/* flujo de caja: período */
.fc-periodo { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 14px; }
.fc-periodo .seg { margin: 0; }
.fc-m { width: auto; min-width: 150px; }
.fc-rango { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
/* % de ganancia */
.gan-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm, 6px); background: var(--card-2); }
.gan-bar label { font-weight: 600; font-size: 13px; }
.gan-bar .inp { width: 90px; }
.lrow .gan-sug { grid-column: 1 / -1; font-size: 12.5px; margin: -2px 0 4px; }
.lrow .gan-sug label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.gan-tools { display: flex; gap: 8px; margin: 0 0 8px; }
.gan-tbl td { vertical-align: middle; }
/* campañas de marketing */
.camp-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.camp-c { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.camp-c.terminada { opacity: .78; }
.camp-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.camp-h b { font-size: 15px; }
.camp-k { display: grid; grid-template-columns: repeat(auto-fit, minmax(105px, 1fr)); gap: 8px 12px; }
.camp-k small { display: block; color: var(--muted); font-size: 11.5px; }
.camp-k b { font-variant-numeric: tabular-nums; font-size: 14px; }
.camp-k b small { display: inline; font-weight: 400; }
.camp-b { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.camp-b .grow { flex: 1; }
.camp-pbar { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; }
.camp-pbar .inp { max-width: 320px; }
.camp-ps { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; max-height: 380px; overflow: auto; padding: 2px; }
.camp-pi { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; }
.camp-pi.on { border-color: var(--gold); background: var(--gold-soft); }
.camp-pl { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; cursor: pointer; }
.camp-pl .cd-tx { min-width: 0; }
.camp-fijo { width: 104px; flex: none; }
.chip.promo { background: color-mix(in srgb, var(--c3) 14%, transparent); color: var(--c3); }
.cj-pr.promo { color: var(--c3); }
.cj-pr.promo s { color: var(--muted); font-weight: 400; font-size: 11px; margin-left: 4px; }
/* ================================================================ gráficos: una sola paleta, el mismo orden en toda la app
   Paleta "Elegante" (elegida por el usuario): 1 azul · 2 plata · 3 dorado suave · 4 gris azulado · 5 celeste · 6 bronce · 7 lavanda
   (las tiendas de Mercado usan el mismo orden). Verde y rojo quedan solo para subir/bajar (bien/mal).
   Modo oscuro: azul noche con líneas que brillan (referencia del usuario). Modo claro: los mismos colores, más oscuros para leerse sobre blanco. */
:root {
  --g1: #2563eb; --g2: #64748b; --g3: #b08a2e; --g4: #94a3b8; --g5: #0284c7; --g6: #9a6b4b;
  --c1: #2563eb; --c2: #64748b; --c3: #b08a2e; --c4: #b08a2e; --c5: #059669; --c6: #94a3b8; --c7: #e11d48; --c8: #0284c7;
  --mk1: #2563eb; --mk2: #64748b; --mk3: #b08a2e; --mk4: #94a3b8; --mk5: #0284c7; --mk6: #9a6b4b; --mk7: #4f46e5; --mk-otro: #cbd5e1;
  --brillo-l: 30%; --brillo-r: 3px; --tip-borde: rgba(148, 163, 184, .25);
}
:root[data-theme="dark"] {
  --g1: #60a5fa; --g2: #e2e8f0; --g3: #d4b062; --g4: #94a3b8; --g5: #7dd3fc; --g6: #b08968;
  --c1: #60a5fa; --c2: #e2e8f0; --c3: #d4b062; --c4: #d4b062; --c5: #34d399; --c6: #94a3b8; --c7: #fb7185; --c8: #7dd3fc;
  --mk1: #60a5fa; --mk2: #e2e8f0; --mk3: #d4b062; --mk4: #94a3b8; --mk5: #7dd3fc; --mk6: #b08968; --mk7: #a5b4fc; --mk-otro: #475569;
  --brillo-l: 70%; --brillo-r: 6px; --tip-borde: #263655;
}
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] {
  --g1: #60a5fa; --g2: #e2e8f0; --g3: #d4b062; --g4: #94a3b8; --g5: #7dd3fc; --g6: #b08968;
  --c1: #60a5fa; --c2: #e2e8f0; --c3: #d4b062; --c4: #d4b062; --c5: #34d399; --c6: #94a3b8; --c7: #fb7185; --c8: #7dd3fc;
  --mk1: #60a5fa; --mk2: #e2e8f0; --mk3: #d4b062; --mk4: #94a3b8; --mk5: #7dd3fc; --mk6: #b08968; --mk7: #a5b4fc; --mk-otro: #475569;
  --brillo-l: 70%; --brillo-r: 6px; --tip-borde: #263655;
} }
/* profesional: sin brillos ni sombras de color en los gráficos */
.chart :is(.ln, .ln-fin, .ln-p), .spark .ln, .ring .rg-arc { filter: none !important; }
/* grilla punteada y guía al pasar el mouse */
.chart line[stroke="var(--line)"] { stroke-dasharray: 3 5; }
.chart .hov:hover { fill: transparent; }
.chart .hv-l { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0; pointer-events: none; transition: opacity .12s; }
.chart .hv-d { opacity: 0; pointer-events: none; transition: opacity .12s; }
.chart .hv:hover .hv-l { opacity: .8; }
.chart .hv:hover .hv-d { opacity: 1; }
.spark { width: 96px; height: 32px; }
/* rankings: TODAS las barras del mismo color (el largo es el dato; el color no agrega nada) */
.hbar .track, .mk-bar .tr { height: 8px; border-radius: 99px; background: var(--card-3); overflow: visible; }
.hbar .fill, .mk-bar .tr i { display: block; height: 100%; min-width: 4px; border-radius: 99px;
  background: var(--g1);
  box-shadow: none; }
.mk-bar.otra .tr { background: none; }
.mk-bar.hd .tr { background: none; }
/* cuadro de ayuda de los gráficos */
.tip { border: 1px solid var(--tip-borde); box-shadow: 0 14px 34px -12px rgba(2, 6, 23, .55); padding: 9px 12px; font-weight: 500; }
.tip::first-line { font-weight: 700; }
/* donas: el mismo dibujo y la misma leyenda en Dashboard y Mercado */
.ringwrap:has(.dona) { justify-content: center; gap: 18px; }
.dona-c { fill: var(--ink); font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.dona-s { fill: var(--muted); font-size: 11.5px; }
.ring.dona .dn-arc { cursor: pointer; }
.ring.dona { overflow: visible; }
/* íconos de los indicadores con color (uno distinto por tarjeta, de la misma paleta) */
.kpis > .kpi:nth-child(4n+1) { --ki: var(--g1); }
.kpis > .kpi:nth-child(4n+2) { --ki: var(--g3); }
.kpis > .kpi:nth-child(4n+3) { --ki: var(--g5); }
.kpis > .kpi:nth-child(4n+4) { --ki: var(--g6); }
.kpi .ki { background: color-mix(in srgb, var(--ki, var(--g1)) 15%, transparent); color: var(--ki, var(--g1)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ki, var(--g1)) 30%, transparent); }
.statlist i { width: 9px; height: 9px; border-radius: 50%; }
.statlist.dona-l li { display: grid; grid-template-columns: 9px minmax(0, 1fr) auto auto; gap: 9px; padding: 7px 0; font-size: 13px; }
.dona-l li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dona-l li b { font-weight: 600; font-variant-numeric: tabular-nums; }
.dona-l li small { min-width: 44px; text-align: right; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
/* ================================================================ asistente de precio */
.pz { display: grid; gap: 12px; }
.pz-fila { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.pz-fijo { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r-sm, 6px); background: var(--card-2); }
.pz-fijo b { font-size: 16px; font-variant-numeric: tabular-nums; }
.pz-fijo small { color: var(--muted); font-size: 12px; }
.pz-ganw { display: flex; gap: 8px; align-items: center; }
.pz-ganw .seg { flex: none; width: auto; margin: 0; display: inline-flex; flex-wrap: nowrap; }
.pz-ganw .seg button { flex: none; padding: 6px 14px; font-weight: 600; }
.pz-ganw .inp { flex: 1; min-width: 0; }
.pz-res { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm, 6px); background: var(--card-2); font-size: 13.5px; }
.pz-mk { display: grid; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.pz-mk-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pz-mk-h b { font-size: 14px; }
.pz-mk-h .pz-buscar { margin-left: auto; width: 230px; max-width: 100%; }
.pz-nota { color: var(--muted); font-size: 13px; }
.pz-crit { flex: 1 1 100%; color: var(--muted); font-size: 12px; }
.pz-crit b { color: var(--ink-2); font-weight: 600; }
.pz-cl { padding: 1px 6px; border-radius: 4px; background: var(--card-3); color: var(--ink-2); font-size: 10.5px; }
.pz-bar { position: relative; height: 40px; margin: 0 10px; }
.pz-bar::before { content: ""; position: absolute; left: 0; right: 0; top: 24px; height: 4px; border-radius: 99px; background: var(--card-3); }
.pz-dot { position: absolute; top: 21px; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: var(--g4); border: 2px solid var(--card); cursor: default; }
.pz-med { position: absolute; top: 17px; width: 2px; height: 18px; margin-left: -1px; border-radius: 2px; background: var(--muted); }
.pz-tu { position: absolute; top: 0; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; pointer-events: none; }
.pz-tu b { font-size: 11px; font-weight: 700; color: var(--g1); white-space: nowrap; line-height: 14px; }
.pz-tu i { width: 14px; height: 14px; margin-top: 4px; border-radius: 50%; background: var(--g1); border: 3px solid var(--card); box-shadow: 0 0 0 1px var(--g1); }
.pz-tu.izq { transform: translateX(-7px); align-items: flex-start; }
.pz-tu.der { transform: translateX(calc(-100% + 7px)); align-items: flex-end; }
.pz-ejes { display: flex; justify-content: space-between; margin-top: 2px; color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.pz-recs { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 8px; }
.pz-rec { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); font: inherit; text-align: left; cursor: pointer; transition: border-color .15s, background .15s; }
.pz-rec:hover { border-color: var(--g1); }
.pz-rec.on { border-color: var(--g1); background: var(--gold-soft); }
.pz-rec small { color: var(--muted); font-size: 11.5px; }
.pz-rec b { font-size: 15px; font-variant-numeric: tabular-nums; }
.pz-rec span { font-size: 12px; }
.pz-lista { display: grid; gap: 2px; max-height: 300px; overflow: auto; margin: 0 -4px; }
.pz-it { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 6px 4px; border-radius: 8px; }
.pz-it:hover { background: var(--card-2); }
.pz-it img, .pz-it .pz-sin { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; background: var(--card-3); }
.pz-tx { display: grid; gap: 3px; min-width: 0; }
.pz-tx a, .pz-tx .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-size: 13px; text-decoration: none; }
.pz-tx a:hover { text-decoration: underline; }
.pz-tx small { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11.5px; }
.pz-pr { display: grid; gap: 1px; text-align: right; }
.pz-pr b { font-variant-numeric: tabular-nums; }
.pz-pr s { color: var(--muted); font-size: 11.5px; }
.pz-pr small { font-size: 11.5px; }
.pz-pin { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--muted); font-size: 16px; line-height: 1; cursor: pointer; }
.pz-pin:hover { border-color: var(--g3); color: var(--g3); }
.pz-pin.on { border-color: color-mix(in srgb, var(--g3) 50%, var(--line)); color: var(--g3); background: color-mix(in srgb, var(--g3) 10%, transparent); }
.chip.pz-man { height: 18px; padding: 0 6px; font-size: 10.5px; vertical-align: middle; }
.pv-seg { margin: 0 0 14px; }
.pv-nota { margin: 10px 14px 12px; }
@media (max-width: 640px) {
  .pz-fila { grid-template-columns: 1fr; }
  .pz-mk-h .pz-buscar { width: 100%; margin-left: 0; }
  .pz-it { grid-template-columns: 36px minmax(0, 1fr) auto; }
  .pz-it .pz-pin { grid-column: 3; }
}
/* ================================================================ íconos con color (tinte suave de la paleta) */
:root { --ico-lav: #6366f1; }
:root[data-theme="dark"] { --ico-lav: #a5b4fc; }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] { --ico-lav: #a5b4fc; } }
.obj-icon { background: color-mix(in srgb, var(--oc, var(--g1)) 15%, transparent) !important; color: var(--oc, var(--g1)) !important;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--oc, var(--g1)) 30%, transparent) !important; }
.card-h .ci { background: color-mix(in srgb, var(--g1) 14%, transparent); color: var(--g1); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--g1) 26%, transparent); }
/* ================================================================ eliminar compra con sus productos */
.cel-res { margin: 0 0 6px; font-size: 14px; color: var(--ink); }
.cel-txt { margin: 0 0 10px; }
.cel-todos { display: flex; gap: 14px; margin: 0 0 8px; font-size: 13px; }
.cel-lista { display: grid; gap: 6px; margin-bottom: 10px; }
.cel-it { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); cursor: pointer; }
.cel-it:has(input:checked) { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); background: color-mix(in srgb, var(--bad) 6%, var(--card)); }
.cel-it input { width: 18px; height: 18px; flex: none; accent-color: var(--bad); margin: 0; }
.cel-ph { width: 38px; height: 38px; flex: none; border-radius: 8px; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; background: var(--card-3); color: var(--ink-2); }
.cel-tx { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.cel-tx b { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cel-nota { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; color: var(--muted); }
.cel-nota .chip { height: auto; min-height: 20px; padding: 2px 8px; white-space: normal; }
.cel-keep { cursor: default; background: var(--card-2); }
.cel-keep .cel-ph { opacity: .7; }
.cel-aviso { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: var(--warn-soft); color: var(--ink); font-size: 13px; }
.cel-aviso svg { width: 16px; height: 16px; flex: none; color: var(--warn); margin-top: 1px; }
.cel-sol { display: flex; flex-direction: column; gap: 4px; margin: 0 0 12px; padding: 10px 12px; border-left: 3px solid var(--warn); border-radius: 0 10px 10px 0; background: var(--card-2); }
.cel-sol small { color: var(--muted); font-size: 12px; }
.cel-sol b { font-weight: 600; font-size: 14px; color: var(--ink); }
.cel-rech { margin: 0 0 10px; color: var(--bad); }
.cel-mot { margin-bottom: 12px; }
.cel-hist { margin-top: 14px; padding: 0; }
.cel-hist > summary { display: flex; align-items: center; gap: 8px; padding: 14px 16px; cursor: pointer; list-style: none; }
.cel-hist > summary::-webkit-details-marker { display: none; }
.cel-hist > summary::before { content: "›"; display: inline-block; color: var(--muted); transition: transform .15s; }
.cel-hist[open] > summary::before { transform: rotate(90deg); }
.cel-hist[open] > summary { border-bottom: 1px solid var(--line); }
/* ================================================================ análisis de proveedores */
.pa-k-l { width: 18px; height: 2px; border-radius: 2px; background: var(--g1); opacity: .5; }
.pa-k-d { width: 10px; height: 10px; border-radius: 50%; background: var(--g1); }
.pa-k-p { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.chart text.pa-eje { font-size: 11px; fill: var(--muted); }
.pa-esc { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; font-size: 13px; color: var(--ink-2); }
.pa-esc li { display: flex; gap: 8px; align-items: baseline; }
.pa-esc li .pa-k-p { transform: translateY(1px); }
.pa-esc b { color: var(--ink); font-weight: 600; }
.pa-prov { display: inline-flex; align-items: center; gap: 8px; }
.pa-prov i { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.pa-nota { margin: -4px 0 12px; }
.pa-res .pa-nota { margin: 10px 0 0; }
.pa-c { margin-bottom: 16px; }
.pa-kpis .val { font-size: 17px; white-space: normal; overflow-wrap: anywhere; line-height: 1.25; }
.pa-tipos tr.pa-g td { border-top: 1px solid var(--line); }
.pa-solo { margin-top: 12px; }
.pa-solo > summary { cursor: pointer; color: var(--muted); font-size: 13px; padding: 6px 0; }
.pa-kv { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important; margin-bottom: 12px; }
.pa-kv > div { display: flex; flex-direction: column; gap: 2px; }
/* ================================================================ productos: selección masiva */
.psel { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 28px; margin: 0; cursor: pointer; }
.psel input { width: 17px; height: 17px; margin: 0; accent-color: var(--g1); cursor: pointer; }
.tbl th.psel-th, .tbl td.psel-td { width: 44px; padding-left: 10px; padding-right: 4px; text-align: center; }
.tbl tr.psel-on td { background: color-mix(in srgb, var(--g1) 7%, transparent); }
.pbulk { position: sticky; top: calc(56px + env(safe-area-inset-top)); z-index: 3; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 10px 16px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--g1) 8%, var(--card)); }
.pbulk[hidden] { display: none; }
.pbulk b { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.pbulk [hidden] { display: none !important; }
.pm-g { display: flex; flex-direction: column; gap: 4px; margin: 0 0 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; }
.pm-del { border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); background: color-mix(in srgb, var(--bad) 5%, var(--card)); }
.pm-keep { background: var(--card-2); }
.pm-g > b { font-size: 14px; font-weight: 600; color: var(--ink); }
.pm-op { display: flex; gap: 8px; align-items: flex-start; margin-top: 6px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.pm-op input { margin-top: 2px; accent-color: var(--g1); }
.pm-lista summary { margin-top: 4px; font-size: 12.5px; color: var(--g1); cursor: pointer; }
.pm-lista ul { max-height: 180px; overflow: auto; margin: 6px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--ink-2); }
.pm-conf { margin-top: 4px; }
.pm-mot { margin-left: 4px; padding: 1px 7px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font-size: 11.5px; white-space: nowrap; }
@media (max-width: 900px) {
  .tbl.stack td.rn.psel-td { display: block; position: absolute; top: 10px; right: 12px; width: auto; padding: 0; }
  .tbl.stack td.rn.psel-td .psel { min-height: 0; padding: 4px; }
  .pbulk { padding: 10px 12px; }
  .tbl.stack tr.psel-on { background: color-mix(in srgb, var(--g1) 7%, transparent); }
  .tbl.stack tr.psel-on td { background: transparent; }
}
/* ================================================================ inventario: movimientos */
.tbl tr.inv-cam td { color: var(--muted); }
.tbl tr.inv-cam .chip { background: transparent; box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); }
.inv-mas { margin: 10px 16px 14px; }
.aj-prev { margin: 4px 0 0; color: var(--ink-2); }
.aj-prev.neg { color: var(--bad); }
/* ================================================================ inventario: análisis */
.ia-c { margin-bottom: 16px; }
.ia-nota { margin: -4px 0 12px; }
.ia-cats { display: grid; gap: 10px; }
.ia-cat { display: grid; grid-template-columns: minmax(140px, 220px) 1fr minmax(120px, 190px); align-items: center; gap: 14px; padding: 4px 0; cursor: default; }
.ia-cn { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ia-cn b { font-size: 13px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ia-cn small, .ia-cv small { font-size: 11.5px; color: var(--muted); }
.ia-bar { display: flex; gap: 2px; height: 12px; border-radius: 4px; background: var(--card-3); overflow: hidden; }
.ia-bar i { display: block; height: 100%; background: var(--g1); border-radius: 0 4px 4px 0; }
.ia-bar i.ia-cam { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--g1) 45%, transparent) 0 4px, color-mix(in srgb, var(--g1) 22%, transparent) 4px 8px); }
.ia-cv { display: flex; flex-direction: column; gap: 2px; text-align: right; }
.ia-cv b { font-size: 13px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.ia-k { width: 14px; height: 10px; border-radius: 3px; background: var(--g1); }
.ia-k.ia-cam { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--g1) 45%, transparent) 0 3px, color-mix(in srgb, var(--g1) 22%, transparent) 3px 6px); }
.ia-ests { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.ia-est { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); text-align: left; cursor: pointer; font: inherit; }
.ia-est:hover { border-color: color-mix(in srgb, var(--g1) 40%, var(--line)); }
.ia-est.on { border-color: var(--g1); box-shadow: inset 0 0 0 1px var(--g1); background: color-mix(in srgb, var(--g1) 6%, var(--card)); }
.ia-est b { font-size: 14px; font-weight: 600; }
.ia-est small { font-size: 11.5px; color: var(--muted); }
.ia-mas { margin: 10px 0 0; }
.ia-tbl td.first { min-width: 220px; }
.ia-pn { font-weight: 600; }
.ia-tbl td .chip { white-space: nowrap; }
.statlist li.inv-est { opacity: .8; }
.statlist li.inv-est i { background: repeating-linear-gradient(135deg, var(--c5) 0 2px, transparent 2px 4px) !important; box-shadow: inset 0 0 0 1px var(--c5); }
@media (max-width: 900px) {
  .ia-cat { grid-template-columns: 1fr auto; gap: 6px 10px; }
  .ia-cat .ia-bar { grid-column: 1 / -1; grid-row: 2; }
  .ia-ests { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* ================================================================ paleta neón: gráficos de Mercado y CRM */
:root:is([data-mod="mercado"], [data-mod="crm"]) {
  --g1: #0891b2; --g2: #a78bfa; --g3: #c026d3; --g4: #94a3b8; --g5: #4f46e5; --g6: #db2777;
  --mk1: #0891b2; --mk2: #a21caf; --mk3: #2563eb; --mk4: #db2777; --mk5: #7c3aed; --mk6: #0d9488; --mk7: #64748b; --mk-otro: #cbd5e1;
  --neon-a: #0891b2; --neon-b: #7c3aed; --neon-c: #c026d3; --hist-a: #c026d3; --hist-b: #0891b2; --hist-op: .85; --area-1: .26; --area-2: .08;
}
:root[data-theme="dark"]:is([data-mod="mercado"], [data-mod="crm"]) {
  --g1: #22d3ee; --g2: #c4b5fd; --g3: #e879f9; --g4: #7f8fb3; --g5: #818cf8; --g6: #f472b6;
  --mk1: #09a0be; --mk2: #c43fd6; --mk3: #4a7af0; --mk4: #e94c8f; --mk5: #9061f0; --mk6: #1c9a7a; --mk7: #7f8fb3; --mk-otro: #3a4766;
  --neon-a: #22d3ee; --neon-b: #8b5cf6; --neon-c: #e879f9; --hist-a: #e879f9; --hist-b: #22d3ee; --hist-op: .9; --area-1: .4; --area-2: .12;
}
@media (prefers-color-scheme: dark) { :root[data-theme="auto"]:is([data-mod="mercado"], [data-mod="crm"]) {
  --g1: #22d3ee; --g2: #c4b5fd; --g3: #e879f9; --g4: #7f8fb3; --g5: #818cf8; --g6: #f472b6;
  --mk1: #09a0be; --mk2: #c43fd6; --mk3: #4a7af0; --mk4: #e94c8f; --mk5: #9061f0; --mk6: #1c9a7a; --mk7: #7f8fb3; --mk-otro: #3a4766;
  --neon-a: #22d3ee; --neon-b: #8b5cf6; --neon-c: #e879f9; --hist-a: #e879f9; --hist-b: #22d3ee; --hist-op: .9; --area-1: .4; --area-2: .12;
} }
/* barras de ranking y embudo: degradado cian → violeta → magenta */
:root:is([data-mod="mercado"], [data-mod="crm"]) :is(.hbar .fill, .mk-bar .tr i) { background: linear-gradient(90deg, var(--neon-a), var(--neon-b) 55%, var(--neon-c)); }
/* modo oscuro: brillo suave en líneas y barras, como la imagen */
:root[data-theme="dark"]:is([data-mod="mercado"], [data-mod="crm"]) .chart .ln { filter: drop-shadow(0 0 6px color-mix(in srgb, currentColor 55%, transparent)) !important; }
:root[data-theme="dark"]:is([data-mod="mercado"], [data-mod="crm"]) :is(.hbar .fill, .mk-bar .tr i) { box-shadow: 0 0 12px -3px color-mix(in srgb, var(--neon-b) 70%, transparent); }
:root[data-theme="dark"]:is([data-mod="mercado"], [data-mod="crm"]) .dona .dn-arc { filter: drop-shadow(0 0 4px rgba(139, 92, 246, .35)); }
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"]:is([data-mod="mercado"], [data-mod="crm"]) .chart .ln { filter: drop-shadow(0 0 6px color-mix(in srgb, currentColor 55%, transparent)) !important; }
  :root[data-theme="auto"]:is([data-mod="mercado"], [data-mod="crm"]) :is(.hbar .fill, .mk-bar .tr i) { box-shadow: 0 0 12px -3px color-mix(in srgb, var(--neon-b) 70%, transparent); }
}
/* ================================================================ mercado: estado de las tiendas */
.mk-et { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink-2); font-size: 13px; }
.mk-et > svg { width: 16px; height: 16px; flex: none; color: var(--g1); }
.mk-et > div { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mk-et b { color: var(--ink); font-weight: 600; }
.mk-et.warn { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); background: color-mix(in srgb, var(--warn) 7%, var(--card)); }
.mk-et.warn > svg { color: var(--warn); }
.mk-et-err { color: var(--bad); }
.mk-et-err b { color: var(--bad); }
@media (max-width: 760px) { .mk-et { flex-wrap: wrap; } .mk-et .btn { margin-left: 26px; } }
/* ================================================================ agilidad al registrar */
.lrow > .lnew-f { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 2px 0 4px; padding: 8px 10px; border-radius: 10px;
  background: color-mix(in srgb, var(--g3) 9%, var(--card)); border: 1px dashed color-mix(in srgb, var(--g3) 45%, var(--line)); }
.lrow > .lnew-f select { width: auto; min-width: 170px; }
.lrow > .lnew-f input { width: 140px; }
.lrow > .lnew-f small { font-size: 12px; }
.lrow.lnew .pp-q { font-weight: 600; }
@media (max-width: 560px) {
  .lrow:not(.c) > .pp-sku { display: none; }
  .lrow:not(.c) > .desc { display: block; grid-area: s; }
  .lrow > .lnew-f select, .lrow > .lnew-f input { flex: 1 1 140px; width: auto; min-width: 0; }
}
@media (max-width: 760px) { .inp, select.inp, textarea.inp { font-size: 16px; } }
/* ================================================================ documentos: boleta o factura, comprobante, factura del proveedor */
.vd-res { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin: 0 0 12px; }
.vd-res b { font-size: 22px; color: var(--ink); }
.vd-res span { color: var(--muted); }
.vd-tipo { margin: 0 0 14px; }
.vd-pasos { margin: 0; padding: 0 0 0 20px; display: grid; gap: 16px; }
.vd-pasos > li > b { display: block; margin-bottom: 2px; color: var(--ink); }
.vd-pasos > li > p { margin: 0 0 8px; }
.vd-copiar { margin-top: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 4px 10px 8px; background: var(--card-2); }
.vd-sec { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 8px 0 4px; }
.vd-row, .vd-it { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; padding: 2px 0; }
.vd-row > span:first-child { min-width: 118px; color: var(--muted); font-size: 13px; }
.vd-c { border: 1px dashed var(--line-2); background: var(--card); border-radius: 7px; padding: 3px 8px; font: inherit; font-size: 13px; color: var(--ink); cursor: copy; max-width: 100%; text-align: left; overflow-wrap: anywhere; }
.vd-c:hover, .vd-c:focus-visible { border-color: var(--primary); }
.vd-c.ok { border-style: solid; border-color: var(--ok); color: var(--ok); }
.vd-c.ok::after { content: " ✓ copiado"; font-size: 12px; }
.vd-x { color: var(--muted); font-size: 12px; }
.vd-pdf { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.doc-in { width: max-content; gap: 6px; }
.cd-docs { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.cd-foot { justify-content: flex-end; }
.cd-foot > .small.muted:first-child { margin-right: auto; }
.btn.primary-soft { border-color: color-mix(in srgb, var(--primary) 35%, var(--line)); color: var(--primary); background: color-mix(in srgb, var(--primary) 7%, var(--card)); }
.toast-i.toast-acc { align-items: center; }
.toast-i.toast-acc .ti { background: color-mix(in srgb, var(--primary) 12%, var(--card)); color: var(--primary); }
.toast-i .ta-ok { font-size: 13px; font-weight: 600; color: var(--primary-ink); background: var(--primary); padding: 6px 12px; border-radius: 8px; }
.toast-i .ta-ok:hover { color: var(--primary-ink); background: var(--primary-hover); }
/* ================================================================ dólar y pesos juntos (Revisar compra) */
/* moneda de la factura arriba y pesos justo debajo: mismo ancho, números alineados a la derecha, sigla al lado */
.fac-mon { display: inline-grid; grid-template-columns: 96px 30px; align-items: center; gap: 2px 6px; text-align: right; }
.fac-mon > small { justify-self: start; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .03em; }
.fac-tbl .fac-mon .fac-n { width: 96px; min-width: 0; }
.fac-tbl .fac-clp { height: 24px; padding: 0 12px; border: 0; border-radius: 6px; background: none; box-shadow: none; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; cursor: default; -moz-appearance: textfield; }
.fac-tbl .fac-clp::-webkit-outer-spin-button, .fac-tbl .fac-clp::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.fac-tbl .fac-clp:focus { box-shadow: none; }
@media (max-width: 760px) { .fac-mon { display: grid; grid-template-columns: minmax(0, 1fr) 34px; } .fac-tbl .fac-mon .fac-n { width: 100%; } .fac-tbl .fac-clp { text-align: left; } }
/* ================================================================ comparador de lecturas de facturas */
.cmp-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.cmp-cfgs { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 8px; margin-bottom: 14px; }
.cmp-cfg { align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card-2); }
.cmp-cfg small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.cmp-tbl td { vertical-align: top; }
.cmp-d { display: block; font-size: 12px; }
.cmp-uso td:first-child { box-shadow: inset 3px 0 0 var(--primary); }
.cmp-l .cmp-dif td { color: var(--bad); font-weight: 600; }
.cmp-det { margin-top: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: var(--card); }
.cmp-det-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.cmp-l { width: 100%; }
.cmp-l td:nth-child(2) { white-space: normal; min-width: 220px; }
.cmp-l td:nth-child(3), .cmp-l td:nth-child(4) { white-space: nowrap; }
.cmp-l th { text-align: left; font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
/* ================================================================ precisión de la lectura de facturas */
.fac-rev { display: block; margin-top: 4px; color: var(--bad); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
/* ================================================================ costo del inventario · Si vendes todo (Inventario) */
.ivp { margin-bottom: 14px; }
.ivp .card-h .opt { text-align: right; }
.ivp-t { font-size: 13.5px; }
.ivp-t th { white-space: nowrap; }
.ivp-t td { padding: 8px 14px; white-space: nowrap; }
.ivp-t tr.ivp-g td { border-top: 1px solid var(--line); font-size: 14.5px; }
.ivp-t .ivp-tot { font-weight: 600; color: var(--ink); }
.ivp-n { margin: 10px 0 0; }
.ivp-av { margin: 8px 0 0; color: var(--warn); }
@media (max-width: 760px) { .ivp-t td, .ivp-t th { padding: 7px 8px; } .ivp .card-h { flex-wrap: wrap; } .ivp .card-h .opt { margin-left: 0; width: 100%; text-align: left; } }
/* ================================================================ Query: consultas SQL de solo lectura */
.qy { display: grid; grid-template-columns: minmax(250px, 290px) minmax(0, 1fr); gap: 14px; align-items: start; }
.qy.sin-panel { grid-template-columns: 44px minmax(0, 1fr); }
.qy-panel { padding: 0; display: flex; flex-direction: column; max-height: calc(100vh - 190px); position: sticky; top: 72px; overflow: hidden; }
.qy-panel.mini { align-items: center; gap: 12px; padding: 8px 0 14px; min-height: 220px; }
.qy-vert { writing-mode: vertical-rl; transform: rotate(180deg); color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.qy-ph { display: flex; align-items: center; gap: 2px; padding: 9px 8px 9px 14px; border-bottom: 1px solid var(--line); }
.qy-ph b { font-size: 14px; font-weight: 600; color: var(--ink); }
.qy-ib { display: inline-grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 7px; background: none; color: var(--muted); cursor: pointer; flex: none; }
.qy-ib:hover:not(:disabled) { background: var(--card-3); color: var(--ink); }
.qy-ib:disabled { opacity: .35; cursor: default; }
.qy-ib svg { width: 15px; height: 15px; }
.qy-ib-col svg { transform: rotate(90deg); }
.qy-panel.mini .qy-ib svg { transform: rotate(-90deg); }
.qy-pb { display: grid; gap: 6px; padding: 10px 12px 12px; border-bottom: 1px solid var(--line); }
.qy-lbl { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.qy-lbl2 { display: flex; justify-content: space-between; margin-top: 6px; }
.qy-lbl2 .muted { font-weight: 400; }
.qy-db { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--card-2); color: var(--ink); font-size: 13.5px; }
.qy-db svg { width: 15px; height: 15px; color: var(--muted); flex: none; }
.qy-db code { margin-left: auto; color: var(--muted); font-size: 12px; }
.qy-busca { position: relative; }
.qy-busca > svg { position: absolute; left: 10px; top: 50%; width: 15px; height: 15px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.qy-busca .inp { height: 34px; padding-left: 32px; font-size: 13.5px; }
.qy-lista { overflow: auto; flex: 1; min-height: 120px; padding: 4px 0 8px; }
.qy-gh { display: flex; align-items: center; gap: 6px; width: 100%; padding: 8px 12px; border: 0; background: none; color: var(--ink); font: inherit; font-size: 13px; font-weight: 600; text-align: left; cursor: pointer; }
.qy-gh:hover { background: var(--card-3); }
.qy-gn { color: var(--muted); font-weight: 400; }
.qy-ul, .qy-cols ul { list-style: none; margin: 0; padding: 0; }
.qy-tn { display: flex; align-items: center; gap: 6px; width: 100%; min-height: 32px; padding: 5px 12px 5px 24px; border: 0; background: none; color: var(--ink); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.qy-tn:hover { background: var(--card-3); }
.qy-tn:focus-visible, .qy-gh:focus-visible, .qy-tb:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.qy-car { display: grid; place-items: center; width: 14px; height: 14px; color: var(--muted); transform: rotate(-90deg); transition: transform .15s; flex: none; }
.qy-car svg { width: 13px; height: 13px; }
[aria-expanded="true"] > .qy-car { transform: none; }
.qy-ti { display: grid; place-items: center; color: var(--muted); flex: none; }
.qy-ti svg { width: 14px; height: 14px; }
.qy-t.on > .qy-tn { background: var(--card-2); font-weight: 600; }
.qy-nom { font: 12.5px/1.4 ui-monospace, "Cascadia Mono", Consolas, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qy-n { margin-left: auto; color: var(--muted); font-size: 11.5px; font-weight: 400; font-variant-numeric: tabular-nums; }
.qy-cols { padding: 4px 12px 12px 58px; background: var(--card-2); border-bottom: 1px solid var(--line); }
.qy-cols > p { margin: 4px 0 6px; }
.qy-cols li { display: flex; align-items: baseline; gap: 8px; padding: 2px 0; }
.qy-col { display: inline-flex; align-items: center; gap: 4px; min-width: 0; border: 0; background: none; padding: 0; color: var(--ink-2); font: 12.5px/1.5 ui-monospace, "Cascadia Mono", Consolas, monospace; cursor: pointer; text-align: left; overflow-wrap: anywhere; }
.qy-col:hover { color: var(--primary); text-decoration: underline; }
.qy-cols code { margin-left: auto; color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.qy-pk { display: inline-grid; color: var(--warn); }
.qy-pk svg { width: 12px; height: 12px; }
.qy-prev { margin-top: 8px; }
.qy-vg { padding: 2px 12px 8px 34px; font-size: 12.5px; }
.qy-der { display: grid; gap: 14px; min-width: 0; }
.qy-ed, .qy-res { padding: 0; min-width: 0; overflow: hidden; }
.qy-tabs { display: flex; align-items: flex-end; gap: 2px; padding: 8px 10px 0; background: var(--card-2); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: thin; }
.qy-tab { display: flex; align-items: center; flex: none; margin-bottom: -1px; border: 1px solid transparent; border-bottom: 0; border-radius: 8px 8px 0 0; }
.qy-tab.on { background: var(--card); border-color: var(--line); box-shadow: inset 0 2px 0 var(--primary); }
.qy-tb { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px; font-weight: 500; white-space: nowrap; cursor: pointer; }
.qy-tab:has(.qy-tx) .qy-tb { padding-right: 4px; }
.qy-tab.on .qy-tb { color: var(--ink); font-weight: 600; }
.qy-tb:hover { color: var(--ink); }
.qy-tx { width: 22px; height: 22px; margin-right: 6px; border: 0; border-radius: 5px; background: none; color: var(--muted); font-size: 16px; line-height: 1; cursor: pointer; }
.qy-tx:hover { background: var(--card-3); color: var(--ink); }
.qy-tadd { display: inline-grid; place-items: center; width: 30px; height: 30px; margin: 0 0 3px 4px; border: 0; border-radius: 7px; background: none; color: var(--muted); cursor: pointer; flex: none; }
.qy-tadd:hover { background: var(--card-3); color: var(--primary); }
.qy-tadd svg { width: 16px; height: 16px; }
.qy-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); flex: none; }
.qy-dot.bad { background: var(--bad); }
.qy-code { position: relative; background: var(--card); border-bottom: 1px solid var(--line); }
.qy-gut { position: absolute; top: 0; bottom: 0; left: 0; width: 46px; padding: 12px 8px 40px 0; overflow: hidden; background: var(--card-2); border-right: 1px solid var(--line); color: var(--muted); font: 13px/1.6 ui-monospace, "Cascadia Mono", Consolas, monospace; text-align: right; user-select: none; }
.qy-gut span { display: block; padding-left: 10px; }
.qy-gut span.err { color: var(--bad); font-weight: 700; background: var(--bad-soft); }
.qy-edw { position: relative; margin-left: 46px; background: var(--card); }
.qy-hl { position: absolute; inset: 0; margin: 0; padding: 12px 14px; overflow: hidden; border: 0; background: none; color: var(--ink); font: 13px/1.6 ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: 0; white-space: pre; tab-size: 2; pointer-events: none; }
.qy-sql { position: relative; z-index: 1; display: block; width: 100%; height: 230px; min-height: 120px; margin: 0; padding: 12px 14px; resize: vertical; border: 0; border-radius: 0; background: transparent; color: transparent; caret-color: var(--ink); font: 13px/1.6 ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: 0; white-space: pre; overflow: auto; tab-size: 2; outline: none; }
.qy-sql::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
.qy-sql::selection { background: color-mix(in srgb, var(--primary) 28%, transparent); color: transparent; }
.qy { --sx-kw: #1d4ed8; --sx-fn: #7c3aed; --sx-col: #0f766e; --sx-tb: #b45309; --sx-str: #be123c; --sx-num: #c2410c; --sx-typ: #0e7490; --sx-com: #6b7280; }
:root[data-theme="dark"] .qy { --sx-kw: #60a5fa; --sx-fn: #c4b5fd; --sx-col: #5eead4; --sx-tb: #fbbf24; --sx-str: #fda4af; --sx-num: #fdba74; --sx-typ: #67e8f9; --sx-com: #9ca3af; }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] .qy { --sx-kw: #60a5fa; --sx-fn: #c4b5fd; --sx-col: #5eead4; --sx-tb: #fbbf24; --sx-str: #fda4af; --sx-num: #fdba74; --sx-typ: #67e8f9; --sx-com: #9ca3af; } }
.sx-kw { color: var(--sx-kw); }
.sx-fn { color: var(--sx-fn); }
.sx-col { color: var(--sx-col); }
.sx-tb { color: var(--sx-tb); }
.sx-str { color: var(--sx-str); }
.sx-num { color: var(--sx-num); }
.sx-typ { color: var(--sx-typ); }
.sx-com { color: var(--sx-com); font-style: italic; }
.sx-esq { color: var(--muted); }
.qy-ley { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 2px 12px; }
.qy-ley i { display: inline-flex; align-items: center; gap: 5px; font-style: normal; white-space: nowrap; }
.qy-ley i::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: currentColor; }
.qy-sql:focus-visible { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--primary) 40%, transparent); }
.qy-sb { display: flex; align-items: center; gap: 14px; padding: 5px 14px; background: var(--card-2); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.qy-sbl { font-weight: 700; color: var(--ink-2); letter-spacing: .04em; }
.qy-ef { display: flex; align-items: center; gap: 8px; padding: 10px 14px; }
.qy-st { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; margin: 12px 14px 0; padding: 9px 12px; border: 1px solid; border-radius: 8px; font-size: 13px; }
.qy-st > svg { width: 16px; height: 16px; flex: none; margin-right: -10px; }
.qy-st > .mk-spin { margin-right: -10px; }
.qy-st b { margin-right: auto; }
.qy-st span:not(.mk-spin) { color: var(--ink-2); }
.qy-st.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 35%, transparent); color: var(--ok); }
.qy-st.bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 35%, transparent); color: var(--bad); }
.qy-st.run { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 35%, transparent); color: var(--info); }
.qy-espera { height: 80px; }
.qy-rbar { display: flex; align-items: center; gap: 8px; padding: 14px 14px 8px; }
.qy-rbar b { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.qy-rbar b .muted { font-weight: 400; }
.qy-rbar .btn svg { width: 14px; height: 14px; }
.qy-trunc { display: flex; align-items: flex-start; gap: 8px; margin: 0 14px 8px; padding: 8px 10px; border-radius: 8px; background: var(--warn-soft); color: var(--ink); font-size: 12.5px; }
.qy-trunc svg { width: 15px; height: 15px; color: var(--warn); flex: none; margin-top: 1px; }
.qy-rtools { display: flex; align-items: center; gap: 8px; padding: 0 14px 10px; }
.qy-rtools .qy-busca { width: min(320px, 100%); }
.qy-pag { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.qy-pag .qy-ib:first-child svg { transform: rotate(90deg); }
.qy-pag .qy-ib:last-child svg { transform: rotate(-90deg); }
.qy-tw { overflow: auto; max-height: 60vh; border-top: 1px solid var(--line); }
.qy-tbl { font-size: 12.5px; }
.qy-tbl th { position: sticky; top: 0; z-index: 1; text-transform: none; letter-spacing: 0; font: 600 12px/1.4 ui-monospace, "Cascadia Mono", Consolas, monospace; }
.qy-tbl td { padding: 6px 14px; white-space: nowrap; max-width: 360px; overflow: hidden; text-overflow: ellipsis; border-bottom: 1px solid var(--line); }
.qy-tbl td.num { text-align: right; font-variant-numeric: tabular-nums; }
.qy-tbl .qy-i { color: var(--muted); text-align: right; width: 1%; }
.qy-null { color: var(--muted); font-style: italic; }
.qy-vacio { padding: 18px 14px; color: var(--muted); font-size: 13.5px; }
.qy-cero { padding: 22px 16px 26px; }
.qy-ini { display: grid; justify-items: center; gap: 6px; padding: 36px 18px; text-align: center; color: var(--muted); font-size: 13.5px; }
.qy-ini b { color: var(--ink); font-size: 14.5px; font-weight: 600; }
.qy-ini-ic { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--card-2); color: var(--muted); }
.qy-ini-ic svg { width: 22px; height: 22px; }
.qy-err { margin: 10px 14px 14px; padding: 12px 14px; border: 1px solid var(--line); border-left: 3px solid var(--bad); border-radius: 8px; background: var(--card); color: var(--ink); font-size: 13.5px; }
.qy-et { display: block; font-size: 14px; font-weight: 600; color: var(--ink); }
.qy-err p { margin: 8px 0 0; }
.qy-lin { display: flex; align-items: center; gap: 8px; min-width: 0; margin-top: 10px; font-size: 12.5px; }
.qy-lin > span { color: var(--muted); white-space: nowrap; }
.qy-lin code { min-width: 0; padding: 3px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--card-2); font: 12.5px/1.5 ui-monospace, Consolas, monospace; white-space: pre; overflow: auto; }
.qy-lin mark { background: color-mix(in srgb, var(--bad) 20%, transparent); color: var(--ink); border-bottom: 2px solid var(--bad); border-radius: 2px; }
.qy-orig { margin-top: 10px; color: var(--muted); font-size: 12px; }
.qy-orig code { font: 12px/1.45 ui-monospace, Consolas, monospace; overflow-wrap: anywhere; }
.qy-aviso ol { margin: 6px 0 8px; padding-left: 20px; }
@media (max-width: 900px) {
  .qy, .qy.sin-panel { grid-template-columns: minmax(0, 1fr); }
  .qy-panel { position: static; max-height: 46vh; }
  .qy-panel.mini { flex-direction: row; min-height: 0; padding: 6px 10px; }
  .qy-panel.mini .qy-ib svg { transform: none; }
  .qy-vert { writing-mode: horizontal-tb; transform: none; }
  .qy-sql { height: 180px; }
  .qy-rtools { flex-wrap: wrap; }
  .qy-rbar { flex-wrap: wrap; }
  .qy-rbar b { white-space: nowrap; }
}

/* nombre NAIKAR en la barra lateral y el encabezado */
.nk-marca { font-size: 15px; font-weight: 500; letter-spacing: .32em; margin-right: -.32em; }
/* ---------- marca NAIKAR en la pantalla de ingreso (marca_patch) ---------- */
:root { --nk-ink: #3e1e00; --nk-crema: #efe8e0; }
:root[data-theme="dark"] { --nk-ink: #e8dccd; }
.nk-word { font-family: "Cormorant Garamond", "Times New Roman", serif; font-weight: 500; letter-spacing: .42em; margin-right: -.42em; line-height: 1; }
.login-logo.nk-logo { gap: 10px; margin-bottom: 26px; color: var(--nk-ink); }
.login-logo .nk-svg { width: 84px; height: auto; margin-bottom: 4px; }
.login-logo h1.nk-word { font-size: 30px; font-weight: 500; letter-spacing: .42em; color: var(--nk-ink); }
.login-logo small { color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
/* panel derecho: tablero animado con frases del negocio (colores crema, café y dorado de la marca) */
.login-right.nk-hero { display: flex; align-items: center; justify-content: center; padding: 48px clamp(28px, 4vw, 64px); gap: 0;
  background: radial-gradient(900px 600px at 30% 20%, #f8f2ea 0%, #efe5d8 55%, #e6d8c6 100%); color: #3e1e00; }
.nk-in { width: 100%; max-width: 560px; }
.nk-ojo { display: flex; align-items: center; gap: 12px; font-size: 11px; font-weight: 600; letter-spacing: .3em; text-transform: uppercase; color: #9a7444; }
.nk-ojo span { width: 34px; height: 1px; background: #c4a173; }
.nk-h { margin: 14px 0 0; font-family: "Cormorant Garamond", "Times New Roman", serif; font-weight: 500; font-size: clamp(34px, 3.4vw, 50px); line-height: 1.05; letter-spacing: -.01em; color: #3e1e00; }
.nk-rot { display: flex; align-items: center; gap: .32em; margin: 12px 0 0; font-size: 16px; color: #6b4a2b; }
.nk-rw { display: inline-block; height: 1.45em; overflow: hidden; }
.nk-rw > span { display: flex; flex-direction: column; animation: nkPal 12.5s cubic-bezier(.7, 0, .3, 1) infinite; }
.nk-rw b { height: 1.45em; line-height: 1.45em; font-weight: 700; color: #3e1e00; }
@keyframes nkPal { 0%, 16% { transform: translateY(0); } 20%, 36% { transform: translateY(-1.45em); } 40%, 56% { transform: translateY(-2.9em); } 60%, 76% { transform: translateY(-4.35em); } 80%, 96% { transform: translateY(-5.8em); } 100% { transform: translateY(-7.25em); } }
.nk-esc { position: relative; margin: 28px 0 0; }
.nk-dash { padding: 16px; border-radius: 16px; background: #fffaf3; border: 1px solid #eadcc8; box-shadow: 0 30px 60px -30px rgba(62, 30, 0, .45); animation: nkFlota 7s ease-in-out infinite; }
@keyframes nkFlota { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.nk-dash small { display: block; font-size: 10.5px; font-weight: 600; letter-spacing: .04em; color: #9a8169; }
.nk-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.nk-kpis div { padding: 10px 12px; border-radius: 10px; background: #f8f0e5; border-left: 3px solid #b08a4e; }
.nk-kpis b { display: block; margin-top: 3px; font-size: clamp(14px, 1.25vw, 18px); font-weight: 700; color: #3e1e00; font-variant-numeric: tabular-nums; }
.nk-kpis em { font-style: normal; font-size: 11px; font-weight: 600; color: #8a6a2a; }
.nk-g2 { display: grid; grid-template-columns: 2.2fr 1fr; gap: 10px; margin-top: 10px; }
.nk-area, .nk-dona, .nk-bars { padding: 10px 12px; border-radius: 10px; border: 1px solid #efe4d4; }
.nk-area svg { display: block; width: 100%; height: 92px; margin-top: 6px; }
.nk-ln { stroke-dasharray: 1; stroke-dashoffset: 1; animation: nkDibuja 6s ease-in-out infinite; }
.nk-ar { opacity: 0; animation: nkArea 6s ease-in-out infinite; }
@keyframes nkDibuja { 0% { stroke-dashoffset: 1; opacity: 1; } 45%, 88% { stroke-dashoffset: 0; opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes nkArea { 0%, 25% { opacity: 0; } 50%, 88% { opacity: 1; } 100% { opacity: 0; } }
.nk-dona { position: relative; display: flex; flex-direction: column; align-items: center; }
.nk-dona small { align-self: flex-start; }
.nk-dona svg { width: 84px; height: 84px; margin-top: 4px; }
.nk-arc { stroke-dasharray: 0 100; animation: nkDona 6s ease-in-out infinite; }
@keyframes nkDona { 0%, 8% { stroke-dasharray: 0 100; } 50%, 90% { stroke-dasharray: 62 100; } 100% { stroke-dasharray: 0 100; } }
.nk-dona b { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -20%); font-size: 17px; color: #3e1e00; }
.nk-bars { margin-top: 10px; }
.nk-bars > div { display: flex; align-items: flex-end; gap: 8px; height: 70px; margin-top: 8px; }
.nk-bars i { flex: 1; height: var(--h); border-radius: 5px 5px 2px 2px; background: #3e1e00; transform-origin: bottom; animation: nkBarra 6s var(--d) ease-in-out infinite; }
.nk-bars i:nth-child(even) { background: #b08a4e; }
@keyframes nkBarra { 0% { transform: scaleY(.15); } 35%, 85% { transform: scaleY(1); } 100% { transform: scaleY(.15); } }
.nk-toast { position: absolute; display: flex; align-items: center; gap: 8px; padding: 8px 12px 8px 8px; border-radius: 999px; background: #fff; border: 1px solid #eadcc8; box-shadow: 0 14px 30px -14px rgba(62, 30, 0, .5); font-size: 12.5px; font-weight: 600; color: #3e1e00; white-space: nowrap; opacity: 0; animation: nkToast 9s ease-in-out infinite; }
.nk-toast span { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #3e1e00; color: #f3e6d2; font-size: 12px; }
.nk-toast.t1 { top: -16px; right: -14px; }
.nk-toast.t2 { top: 44%; left: -26px; animation-delay: 3s; }
.nk-toast.t3 { bottom: -16px; right: 22px; animation-delay: 6s; }
.nk-toast.t2 span { background: #b08a4e; }
@keyframes nkToast { 0% { opacity: 0; transform: translateY(8px) scale(.96); } 6%, 28% { opacity: 1; transform: none; } 34%, 100% { opacity: 0; transform: translateY(-6px); } }
.nk-feat { display: flex; flex-wrap: wrap; gap: 8px; margin: 34px 0 0; padding: 0; list-style: none; }
.nk-feat li { padding: 6px 12px; border-radius: 999px; border: 1px solid #d9c3a3; font-size: 12.5px; font-weight: 600; color: #6b4a2b; background: rgba(255, 250, 243, .6); }
.nk-citas { position: relative; height: 34px; margin-top: 22px; }
.nk-citas p { position: absolute; inset: 0; margin: 0; font-family: "Cormorant Garamond", "Times New Roman", serif; font-style: italic; font-weight: 500; font-size: 21px; color: #6b4a2b; opacity: 0; animation: nkCita 15s ease-in-out infinite; }
.nk-citas p:nth-child(2) { animation-delay: 5s; } .nk-citas p:nth-child(3) { animation-delay: 10s; }
@keyframes nkCita { 0% { opacity: 0; transform: translateY(6px); } 5%, 30% { opacity: 1; transform: none; } 35%, 100% { opacity: 0; } }
@media (max-height: 760px) { .nk-bars { display: none; } .nk-feat { margin-top: 26px; } }
@media (prefers-reduced-motion: reduce) {
  .nk-rw > span, .nk-dash, .nk-bars i, .nk-toast, .nk-citas p, .nk-ln, .nk-ar, .nk-arc { animation: none; }
  .nk-ln { stroke-dashoffset: 0; } .nk-ar, .nk-toast.t1, .nk-citas p:first-child { opacity: 1; } .nk-arc { stroke-dasharray: 62 100; }
}

/* ---- Control de costos (ccvista_patch) ---- */
.cc-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); vertical-align: middle; flex: none; }
.cc-dot.cc-verde { background: var(--ok); }
.cc-dot.cc-amarillo { background: var(--warn); }
.cc-dot.cc-rojo { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.cc-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.cc-sem th, .cc-sem td { white-space: nowrap; }
.cc-kpi { padding: 14px 16px; min-width: 0; }
.cc-kh { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.cc-kv { font-size: 21px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-ks { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.35; }
.cc-n { display: inline-block; min-width: 34px; color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.cc-c { width: 22px; text-align: center; }
.cc-mat { min-width: 820px; }
.cc-anual { min-width: 1080px; }
.cc-mat td.cc-l, .cc-anual td.cc-l { white-space: nowrap; }
.cc-mat .cc-l, .cc-anual .cc-l { position: sticky; left: 0; z-index: 1; background: var(--card); }
.cc-mat tr.sub td { font-weight: 600; }
.cc-mat tr.res td, .cc-anual tr.res td { font-weight: 700; background: var(--card-2); }
.cc-mat tr.pctrow td { color: var(--muted); font-style: italic; font-size: 12px; }
.cc-mat tr.cc-info td { color: var(--muted); font-size: 12px; }
.cc-mat tr.click:hover td, .cc-mat tr.click:hover .cc-l { background: var(--gold-soft); }
.cc-anual th.cur, .cc-anual td.cur { background: var(--gold-soft); }
.cc-anual th .link { font-weight: 600; }
.cc-c-rojo { color: var(--bad); font-weight: 600; }
.cc-c-amarillo { color: var(--warn); }
.cc-wf { display: grid; gap: 10px; }
.cc-wf-r { display: grid; grid-template-columns: 160px minmax(0, 1fr) 120px; align-items: center; column-gap: 12px; row-gap: 2px; font-size: 13px; }
.cc-wf-l { color: var(--ink-2); }
.cc-wf-r b { text-align: right; }
.cc-wf-t { position: relative; height: 18px; background: var(--card-3); border-radius: 4px; overflow: hidden; }
.cc-wf-t i { position: absolute; top: 0; bottom: 0; border-radius: 3px; background: var(--gold); }
.cc-wf-t i.neg { background: var(--bad); }
.cc-wf-t i.pos { background: var(--ok); }
.cc-wf-t .cero { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--muted); z-index: 1; }
.cc-wf-d { grid-column: 2 / 4; color: var(--muted); font-size: 11.5px; line-height: 1.35; }
.cc-kv4 { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 10px; }
.cc-dot-m { display: none; }
@media (max-width: 760px) {   /* en el celular la matriz pasa a tarjetas (como todas las tablas); la anual sigue como tabla con desplazamiento */
  .cc-mat { min-width: 0; }
  .cc-mat .cc-l { position: static; background: none; }
  table.tcard.cc-mat > tbody > tr.res, table.tcard.cc-mat > tbody > tr.sub { background: var(--card-2); }
  table.tcard.cc-mat > tbody > tr.pctrow > td.kv-full, table.tcard.cc-mat td:empty, table.tcard.cc-mat td.cc-c { display: none; }
  .cc-mat .cc-dot-m { display: inline-block; margin-left: 8px; }
}
@media (max-width: 600px) {
  .seg.cc-seg button span { display: inline; }
  .seg.cc-seg button { font-size: 12.5px; padding: 7px 6px; }
}
@media (max-width: 640px) {
  .cc-wf-r { grid-template-columns: minmax(0, 1fr) auto; }
  .cc-wf-t { grid-column: 1 / -1; order: 3; }
  .cc-wf-d { grid-column: 1 / -1; order: 4; }
  .cc-kv4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cc-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .cc-kv { font-size: 18px; }
}

/* ---- Control de costos: editores (cceditor_patch) ---- */
.sheet.cc-xl { max-width: min(1320px, 97vw); }
.cc-ppto-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 10px; }
.cc-ppto-bar label { display: inline-flex; align-items: center; gap: 6px; }
.cc-ppto-bar .inp { width: auto; padding: 6px 8px; }
.cc-ppto { min-width: 1240px; }
.cc-ppto .cc-l { position: sticky; left: 0; z-index: 1; background: var(--card); white-space: nowrap; }
.cc-ppto tr.res td, .cc-ppto tr.res .cc-l { background: var(--card-2); font-weight: 600; }
.cc-ppto tr.sec td { color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding-top: 14px; }
.cc-ppto td { padding: 3px 3px; }
.cc-in { width: 100%; min-width: 74px; padding: 5px 7px; text-align: right; font-variant-numeric: tabular-nums; }
.cc-ppto .cc-modo { min-width: 86px; padding: 5px 6px; }
.cc-ppto .cc-in { min-width: 82px; font-size: 12.5px; }
.cc-ppto tr.res .cc-in { min-width: 104px; }
.cc-est .cc-in { max-width: 130px; margin-left: auto; }
.cc-umb .cc-in { max-width: 90px; margin-left: auto; }
.cc-umb select.inp { min-width: 200px; padding: 5px 6px; }

/* ---- Control de costos: protocolos (ccalerta_patch) ---- */
.cc-kpi.click { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.cc-kpi.click:hover, .cc-kpi.click:focus-visible { border-color: var(--gold); }
.cc-proto-est { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; }
ul.cc-proto-q, ul.cc-proto-m { margin: 0; display: grid; gap: 8px; }
ul.cc-proto-q { padding: 0; list-style: none; }
ul.cc-proto-q li { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 4px 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius, 8px); }
ul.cc-proto-q .cc-q { align-items: flex-start; flex: 1 1 320px; line-height: 1.4; }
ul.cc-proto-q .cc-q input { margin-top: 2px; flex: none; }
ul.cc-proto-q .link { white-space: nowrap; font-size: 13px; }
ul.cc-proto-m { padding-left: 20px; line-height: 1.45; }

@media (max-width: 420px) {   /* ux1: módulos, IA, buscar, +, avisos y tu cuenta caben en una línea */
  .app-hdr .modsw button { padding: 0 4px; font-size: 11.5px; }
  .app-hdr .ia-btn .ia-txt { display: none; }
  .app-hdr .ia-btn { padding: 0 8px; }
}
@media (max-width: 370px) {   /* ux1: celulares de 360 px */
  .app-hdr { gap: 4px; padding-inline: 6px; }
  .app-hdr .modsw button { padding: 0 3px; }
  .app-hdr .hdr-actions { gap: 1px; }
}

/* respaldo de datos: aviso discreto en el Dashboard del admin */
.resp-aviso { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 9px 12px; margin-bottom: 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); color: var(--ink-2); font-size: 13px; }
.resp-aviso > span:nth-child(2) { flex: 1 1 220px; }
.resp-ic { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--warn-soft); color: var(--warn); flex: none; }
.resp-ic svg { width: 15px; height: 15px; }
.resp-aviso .link { min-height: 32px; font-weight: 600; white-space: nowrap; }
@media (pointer: coarse) { .resp-aviso .link { min-height: 44px; } }
[data-act="respaldo"][aria-busy="true"] { cursor: progress; font-variant-numeric: tabular-nums; }

/* módulos y secciones: interruptores en Configuración */
.modsw[hidden], .mod-cards[hidden] { display: none !important; }
.vcfg-top p { margin: 0 0 4px; color: var(--ink-2); font-size: 13px; line-height: 1.5; }
.vcfg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 14px; margin-top: 14px; }
.vcfg-m { display: flex; flex-direction: column; gap: 10px; }
.vcfg-h { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.vcfg-h .vsw { flex: 1; }
.vcfg-tabs { display: flex; flex-direction: column; gap: 2px; }
.vcfg-m.apagado .vcfg-tabs { opacity: .5; }
.vsw { position: relative; display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 4px 6px; margin: 0 -6px; border-radius: 8px; cursor: pointer; font-size: 13.5px; color: var(--ink); }
.vsw:hover { background: var(--card-2); }
.vsw.fija { cursor: default; color: var(--muted); }
.vsw.fija:hover { background: none; }
.vsw input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.vsw-t { position: relative; flex: none; width: 34px; height: 20px; border-radius: 999px; background: color-mix(in srgb, var(--muted) 80%, var(--card)); transition: background-color .18s ease; }
.vsw-t::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .18s cubic-bezier(.2,.8,.2,1); }
.vsw input:checked + .vsw-t { background: var(--primary); }
.vsw input:checked + .vsw-t::after { transform: translateX(14px); }
.vsw input:disabled + .vsw-t { opacity: .55; }
.vsw input:focus-visible + .vsw-t { outline: 2px solid var(--focus-c, var(--gold)); outline-offset: 2px; }
.vsw-l { display: flex; flex-direction: column; min-width: 0; }
.vsw-l small { color: var(--muted); font-size: 12px; line-height: 1.35; }
@media (pointer: coarse) { .vsw { min-height: 44px; } }
@media (prefers-reduced-motion: reduce) { .vsw-t, .vsw-t::after { transition: none; } }

/* NAIKAR: marca, botones y movimiento ----------------------------------------------------------------------------- */
/* Tokens de acento: café y dorado de la marca. Contraste AA medido: texto de acento 6,3:1 (claro) y 10,7:1 (oscuro);
   botón primario 14:1 (crema sobre café) y 8,1:1 (café sobre camel); anillo de foco 3,2:1 y 8,8:1. */
:root {
  --nk-cafe: #3e1e00; --nk-cafe-2: #5a3414; --nk-dorado: #b08a4e; --nk-dorado-txt: #7a5a22; --nk-crema: #efe8e0;
  --brand: #7a5a22; --brand-2: #8a6a2e; --brand-dark: #3e1e00; --brand-soft: #f6efe3; --link: #7a5a22;
  --gold: #7a5a22; --gold-2: #7a5a22; --gold-soft: #f6efe3; --gold-claro: #e6d3b0;
  --primary: #3e1e00; --primary-ink: #fbf6ee; --primary-hover: #5a3414; --pill: #3e1e00; --pill-ink: #fbf6ee;
  --lat-activo: #f4ecdf; --lat-activo-ink: #5a3414;
  --ia-icono: #8a6a2e; --focus-c: #b08a4e; --focus: 0 0 0 3px rgba(176, 138, 78, .38);
  --sh-card: 0 1px 2px rgba(62, 30, 0, .04), 0 2px 8px -3px rgba(62, 30, 0, .06);
  --sh-primario: 0 1px 2px rgba(62, 30, 0, .22), inset 0 1px 0 rgba(255, 255, 255, .08);
  --sh-primario-h: 0 3px 8px -2px rgba(62, 30, 0, .32), inset 0 1px 0 rgba(255, 255, 255, .1);
  --e-sale: cubic-bezier(.23, 1, .32, 1);          /* ease-out (entrar/salir) */
  --e-mueve: cubic-bezier(.645, .045, .355, 1);    /* ease-in-out (algo que ya está en pantalla se mueve) */
}
:root[data-theme="dark"] {   /* modo oscuro «negro y camel» (opción D, elegida el 21-11): negro neutro + acento cuero, no metálico */
  --bg: #0e0e0e; --card: #161616; --card-2: #1c1c1c; --card-3: #232323; --head: #141414; --sec-bg: #1c1c1c;
  --ink: #f2ede6; --ink-2: #cfc8bf; --muted: #9a948c; --line: #262422; --line-2: #34312d;
  --hdr-bg: #0e0e0e; --hdr-ink: #cfc8bf; --seg-bg: #161616; --seg-on: #2b241d; --seg-on-ink: #f2ede6;
  --lat-bg: #121212; --lat-borde: #222120; --lat-ink: #f2ede6; --lat-ink-2: #cfc8bf; --lat-icono: #7d776f; --lat-muted: #6f6a63;
  --lat-hover: #1c1c1c; --lat-linea: #222120; --lat-activo: #2b241d; --lat-activo-ink: #e2c9a8;
  --ia-ink: #f2ede6; --ia-borde: #34312d; --ia-hover: #1c1c1c; --tip-bg: #26231f; --tip-ink: #f2ede6; --overlay: rgba(0, 0, 0, .66);
  --brand: #c9a988; --brand-2: #d6b994; --brand-dark: #8a6a4a; --brand-soft: rgba(201, 169, 136, .14); --link: #d6b994;
  --gold: #c9a988; --gold-2: #d6b994; --gold-soft: rgba(201, 169, 136, .14); --gold-claro: #d6b994;
  --primary: #c9a988; --primary-ink: #1f150c; --primary-hover: #d6b994; --pill: #c9a988; --pill-ink: #1f150c;
  --ia-icono: #d6b994; --focus-c: #c9a988; --focus: 0 0 0 3px rgba(201, 169, 136, .4);
  --sh-card: 0 0 0 1px rgba(255, 255, 255, .03); --sh-1: 0 1px 2px rgba(0, 0, 0, .5); --shadow: 0 1px 2px rgba(0, 0, 0, .5);
  --sh-primario: 0 1px 2px rgba(0, 0, 0, .5); --sh-primario-h: 0 3px 10px -2px rgba(201, 169, 136, .28);
  --ok: #8fbf6a; --ok-soft: rgba(143, 191, 106, .14); --bad: #f0846a; --bad-soft: rgba(240, 132, 106, .14);   /* bien/mal en tonos cálidos (oliva y terracota) */
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
  --bg: #0e0e0e; --card: #161616; --card-2: #1c1c1c; --card-3: #232323; --head: #141414; --sec-bg: #1c1c1c;
  --ink: #f2ede6; --ink-2: #cfc8bf; --muted: #9a948c; --line: #262422; --line-2: #34312d;
  --hdr-bg: #0e0e0e; --hdr-ink: #cfc8bf; --seg-bg: #161616; --seg-on: #2b241d; --seg-on-ink: #f2ede6;
  --lat-bg: #121212; --lat-borde: #222120; --lat-ink: #f2ede6; --lat-ink-2: #cfc8bf; --lat-icono: #7d776f; --lat-muted: #6f6a63;
  --lat-hover: #1c1c1c; --lat-linea: #222120; --lat-activo: #2b241d; --lat-activo-ink: #e2c9a8;
  --ia-ink: #f2ede6; --ia-borde: #34312d; --ia-hover: #1c1c1c; --tip-bg: #26231f; --tip-ink: #f2ede6; --overlay: rgba(0, 0, 0, .66);
  --brand: #c9a988; --brand-2: #d6b994; --brand-dark: #8a6a4a; --brand-soft: rgba(201, 169, 136, .14); --link: #d6b994;
  --gold: #c9a988; --gold-2: #d6b994; --gold-soft: rgba(201, 169, 136, .14); --gold-claro: #d6b994;
  --primary: #c9a988; --primary-ink: #1f150c; --primary-hover: #d6b994; --pill: #c9a988; --pill-ink: #1f150c;
  --ia-icono: #d6b994; --focus-c: #c9a988; --focus: 0 0 0 3px rgba(201, 169, 136, .4);
  --sh-card: 0 0 0 1px rgba(255, 255, 255, .03); --sh-1: 0 1px 2px rgba(0, 0, 0, .5); --shadow: 0 1px 2px rgba(0, 0, 0, .5);
  --sh-primario: 0 1px 2px rgba(0, 0, 0, .5); --sh-primario-h: 0 3px 10px -2px rgba(201, 169, 136, .28);
  --ok: #8fbf6a; --ok-soft: rgba(143, 191, 106, .14); --bad: #f0846a; --bad-soft: rgba(240, 132, 106, .14);   /* bien/mal en tonos cálidos (oliva y terracota) */
  }
}
/* lo que estaba escrito con texto blanco u oscuro fijo sobre el acento */
.path li.cur::before, .modsw button.on, .seg button.on em, .path li.won::before, .avatar-me { color: var(--primary-ink); }
.avatar-me { background: var(--primary); }

/* tipografía */
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
h1, h2, h3, .mhead h3 { text-wrap: balance; }
.page-head p, .dash-hero p, .cfg-c p, .empty { text-wrap: pretty; }
.page-head h1, .dash-hero h1 { font-family: "Cormorant Garamond", "Times New Roman", serif; font-weight: 500; letter-spacing: -.005em; line-height: 1.1; }
.page-head h1 { font-size: 30px; }
.dash-hero h1 { font-size: 34px; }
.mhead h3 { font-family: "Cormorant Garamond", "Times New Roman", serif; font-weight: 500; font-size: 23px; letter-spacing: 0; }
@media (max-width: 560px) { .page-head h1 { font-size: 26px; } .dash-hero h1 { font-size: 28px; } }
.val, .num, td, th, .kpis, .stat-sub, .toast-i, .chip { font-variant-numeric: tabular-nums; }

/* superficies */
.card { box-shadow: var(--sh-card); }
.page-head { margin-bottom: 18px; }

/* botones: estados de 160 ms, presión 0,97, primario con sombra sutil */
.btn, .icon-btn, .hbtn, .link, .side-i, .modsw button, .tab, .seg button, .mnav button {
  transition-property: background-color, border-color, color, box-shadow, scale, opacity; transition-duration: .16s; transition-timing-function: ease;
}
.btn:active:not(:disabled):not([aria-disabled="true"]), .icon-btn:active:not(:disabled), .hbtn:active { transform: none; scale: .97; }
.btn.primary, .btn.gold { box-shadow: var(--sh-primario); }
.btn.primary:hover:not(:disabled), .btn.gold:hover:not(:disabled) { box-shadow: var(--sh-primario-h); }
.btn:focus-visible, .icon-btn:focus-visible, .hbtn:focus-visible, .link:focus-visible { outline: 2px solid var(--focus-c); outline-offset: 2px; }
.btn:disabled, .btn[aria-disabled="true"] { box-shadow: none; }
@media (hover: none) { .btn:hover:not(.primary):not(.gold) { background: var(--card); } }

/* entrada después del login (escalonada) y cambio de pestaña o módulo (máx. 240 ms en total) */
@keyframes nkEntra { from { opacity: 0; transform: translateY(10px); } }
@keyframes nkCambia { from { opacity: 0; transform: translateY(6px); } }
main.entrada > *, main.entrada .kpis > *, main.entrada .dgrid > * { animation: nkEntra .42s var(--e-sale) both; }
main.entrada > *:nth-child(2) { animation-delay: .06s; } main.entrada > *:nth-child(3) { animation-delay: .12s; }
main.entrada > *:nth-child(4) { animation-delay: .18s; } main.entrada > *:nth-child(n+5) { animation-delay: .24s; }
main.entrada .kpis > *:nth-child(1) { animation-delay: .1s; } main.entrada .kpis > *:nth-child(2) { animation-delay: .16s; }
main.entrada .kpis > *:nth-child(3) { animation-delay: .22s; } main.entrada .kpis > *:nth-child(n+4) { animation-delay: .28s; }
main.entrada .dgrid > *:nth-child(1) { animation-delay: .26s; } main.entrada .dgrid > *:nth-child(n+2) { animation-delay: .32s; }
main.enter > * { animation: nkCambia .18s var(--e-sale) both; }
main.enter > *:nth-child(2) { animation-delay: .02s; } main.enter > *:nth-child(3) { animation-delay: .04s; } main.enter > *:nth-child(n+4) { animation-delay: .06s; }

/* fondo deslizante de la opción activa */
.con-ind { position: relative; }
.ind-desliza { position: absolute; top: 0; left: 0; z-index: 0; pointer-events: none; transition: transform .24s var(--e-mueve), width .24s var(--e-mueve), height .24s var(--e-mueve); }
.side-nav .ind-desliza { border-radius: 6px; background: var(--lat-activo); }
.side-nav.con-ind .side-i { position: relative; z-index: 1; }
.side-nav.con-ind .side-i.on { background: transparent; }
.app-hdr .modsw .ind-desliza { border-radius: 6px; background: var(--seg-on); box-shadow: 0 1px 2px rgba(16, 24, 40, .1), inset 0 0 0 1px var(--line); }
.app-hdr .modsw.con-ind button { position: relative; z-index: 1; }
.app-hdr .modsw.con-ind button.on { background: transparent; box-shadow: none; }

/* ventanas, menús, búsqueda y avisos: abren con escala + opacidad, cierran rápido */
@keyframes nkAbre { from { opacity: 0; transform: scale(.96); } }
@keyframes nkFondo { from { opacity: 0; } }
@keyframes nkCierra { to { opacity: 0; transform: scale(.97); } }
@keyframes nkFondoSale { to { opacity: 0; } }
.modal { animation: nkFondo .2s var(--e-sale); }
.sheet { animation: nkAbre .2s var(--e-sale); transform-origin: 50% 0; }
.dd { animation: nkAbre .15s var(--e-sale); transform-origin: top right; }
.pal-wrap { animation: nkFondo .18s var(--e-sale); }
.pal { animation: nkAbre .18s var(--e-sale); transform-origin: 50% 0; }
.dlg-wrap { animation: nkFondo .18s var(--e-sale); }
.dlg { animation: nkAbre .18s var(--e-sale); }
.saliendo { pointer-events: none !important; animation: nkCierra .14s ease-out forwards !important; }
.modal.saliendo, .pal-wrap.saliendo { animation-name: nkFondoSale !important; }
.modal.saliendo .sheet, .pal-wrap.saliendo .pal { animation: nkCierra .14s ease-out forwards; }
.toast-i { animation-duration: .2s; animation-timing-function: var(--e-sale); }
.toast-i.out { animation-duration: .15s; }

/* esqueleto de carga con la forma de la app */
.sk { background: linear-gradient(90deg, var(--card-3) 25%, color-mix(in srgb, var(--card-3) 40%, var(--card)) 37%, var(--card-3) 63%); background-size: 400% 100%; }
.sk-cuerpo { display: flex; }
.sk-lat { display: none; }
.sk-main { flex: 1; min-width: 0; }
.sk-eyebrow { height: 10px; width: 120px; margin-bottom: 10px; }
.sk-tabla { margin-top: 16px; padding: 6px 16px; }
.sk-fila { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.sk-fila:last-child { border-bottom: 0; }
.sk-c1 { height: 12px; width: 70%; } .sk-c2 { height: 12px; width: 50%; } .sk-c3 { height: 12px; width: 40%; justify-self: end; }
@media (min-width: 901px) {
  .sk-lat { display: flex; flex-direction: column; gap: 10px; width: 232px; padding: 18px 14px; border-right: 1px solid var(--line); min-height: calc(100vh - 56px); background: var(--card); }
  .sk-li { height: 26px; border-radius: 6px; }
  .sk-li:nth-child(3n+1) { width: 60%; height: 10px; margin-top: 8px; }
}
@media (max-width: 900px) { .sk-nav { display: none; } }

/* gráficos: paleta «Cuero» (elegida el 21-11) en TODA la app, también Mercado y CRM (reemplaza Elegante y neón).
   Solo cafés: 1 cacao · 2 camel · 3 chocolate · 4 taupe · 5 cobre · 6 arena. Subir/bajar en verde oliva y terracota.
   En oscuro, sin brillos: tonos claros de cuero sobre el negro. */
:root, :root:is([data-mod="mercado"], [data-mod="crm"], [data-mod="erp"], [data-mod="query"]) {
  --g1: #7a4a24; --g2: #b8916a; --g3: #4a2c14; --g4: #a8998a; --g5: #9c6b3f; --g6: #c2a582;
  --c1: #7a4a24; --c2: #b8916a; --c3: #9c6b3f; --c4: #9c6b3f; --c5: #4d7c3a; --c6: #a8998a; --c7: #b5452e; --c8: #5c3a1e;
  --mk1: #7a4a24; --mk2: #b8916a; --mk3: #4a2c14; --mk4: #a8998a; --mk5: #9c6b3f; --mk6: #c2a582; --mk7: #6e5a48; --mk-otro: #ddd3c8;
  --neon-a: #4a2c14; --neon-b: #7a4a24; --neon-c: #b8916a; --hist-a: #7a4a24; --hist-b: #b8916a; --hist-op: .85; --area-1: .2; --area-2: .04;
  --tip-borde: rgba(122, 74, 36, .2);
}
:root[data-theme="dark"], :root[data-theme="dark"]:is([data-mod="mercado"], [data-mod="crm"], [data-mod="erp"], [data-mod="query"]) {
  --g1: #d6b994; --g2: #a07650; --g3: #f0dcc2; --g4: #8a7f74; --g5: #c08a5a; --g6: #6b4a2f;
  --c1: #d6b994; --c2: #a07650; --c3: #c08a5a; --c4: #c08a5a; --c5: #8fbf6a; --c6: #8a7f74; --c7: #e8836b; --c8: #f0dcc2;
  --mk1: #d6b994; --mk2: #a07650; --mk3: #f0dcc2; --mk4: #8a7f74; --mk5: #c08a5a; --mk6: #6b4a2f; --mk7: #b8a594; --mk-otro: #3a3530;
  --neon-a: #6b4a2f; --neon-b: #a07650; --neon-c: #d6b994; --hist-a: #d6b994; --hist-b: #a07650; --hist-op: .9; --area-1: .22; --area-2: .03;
  --tip-borde: #34312d;
}
@media (prefers-color-scheme: dark) { :root[data-theme="auto"], :root[data-theme="auto"]:is([data-mod="mercado"], [data-mod="crm"], [data-mod="erp"], [data-mod="query"]) {
  --g1: #d6b994; --g2: #a07650; --g3: #f0dcc2; --g4: #8a7f74; --g5: #c08a5a; --g6: #6b4a2f;
  --c1: #d6b994; --c2: #a07650; --c3: #c08a5a; --c4: #c08a5a; --c5: #8fbf6a; --c6: #8a7f74; --c7: #e8836b; --c8: #f0dcc2;
  --mk1: #d6b994; --mk2: #a07650; --mk3: #f0dcc2; --mk4: #8a7f74; --mk5: #c08a5a; --mk6: #6b4a2f; --mk7: #b8a594; --mk-otro: #3a3530;
  --neon-a: #6b4a2f; --neon-b: #a07650; --neon-c: #d6b994; --hist-a: #d6b994; --hist-b: #a07650; --hist-op: .9; --area-1: .22; --area-2: .03;
  --tip-borde: #34312d;
} }
:root[data-theme]:is([data-mod="mercado"], [data-mod="crm"], [data-mod="erp"], [data-mod="query"]) .chart .ln, :root[data-theme]:is([data-mod="mercado"], [data-mod="crm"], [data-mod="erp"], [data-mod="query"]) .hbar .fill, :root[data-theme]:is([data-mod="mercado"], [data-mod="crm"], [data-mod="erp"], [data-mod="query"]) .mk-bar .tr i, :root[data-theme]:is([data-mod="mercado"], [data-mod="crm"], [data-mod="erp"], [data-mod="query"]) .dona .dn-arc { filter: none !important; box-shadow: none !important; }
/* aviso de estado de Mercado: con botones largos el texto quedaba en una columna de una palabra */
.mk-et { flex-wrap: wrap; }
.mk-et > div { flex: 1 1 260px; min-width: 0; }
@media (prefers-reduced-motion: reduce) {
  main.entrada > *, main.entrada .kpis > *, main.entrada .dgrid > *, main.enter > *,
  .modal, .sheet, .dd, .pal-wrap, .pal, .dlg-wrap, .dlg, .toast-i, .saliendo, .sk { animation: none !important; }
  .ind-desliza, .btn, .icon-btn, .hbtn, .link, .side-i, .modsw button, .tab, .seg button, .mnav button { transition: none; }
  .btn:active, .icon-btn:active, .hbtn:active { scale: none; }
  .saliendo { display: none !important; }
}

/* QR de registro (punto de venta) */
.qr-reg { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.qr-code { display: grid; place-items: center; width: min(320px, 78vw); aspect-ratio: 1; padding: 10px; border-radius: 14px; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .08); }
.qr-code svg { width: 100%; height: 100%; }
.qr-txt { margin: 4px 0 0; max-width: 380px; color: var(--ink-2); font-size: 14px; text-wrap: pretty; }
.qr-url { margin: 0; font-size: 12.5px; word-break: break-all; }
.qr-url a { color: var(--link); }
.qr-lista { width: 100%; margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--line); text-align: left; }
.qr-h { margin-bottom: 8px; color: var(--muted); font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.qr-cli { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.qr-cli > div { flex: 1; min-width: 0; }
.qr-cli b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qr-cli small { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qr-espera { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 4px 0; color: var(--muted); font-size: 13px; }
@media (max-width: 560px) { .qr-cli { flex-wrap: wrap; } .qr-cli .btn { width: 100%; } }
/* ================================================================ tienda web (sql/48): productos con variantes */
.tw-web td { vertical-align: middle; }
.tw-vars td { vertical-align: middle; }
.tw-vars .inp { min-width: 0; }
.tw-fotos { display: flex; flex-wrap: wrap; gap: 10px; }
.tw-foto { display: flex; flex-direction: column; gap: 4px; width: 104px; }
.tw-foto img { width: 104px; height: 104px; object-fit: cover; border-radius: 10px; outline: 1px solid rgba(0, 0, 0, .08); outline-offset: -1px; background: var(--card-2, #f4ede3); }
.tw-foto .inp { padding: 4px 6px; font-size: 12.5px; }
/* ================================================================ seguridad (Usuarios) */
.seg-tips { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px 18px; }
.seg-tips li { display: flex; gap: 10px; align-items: flex-start; }
.seg-ic { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--card-2); color: var(--ink-2); }
.seg-ic svg { width: 16px; height: 16px; }
.seg-tips b { display: block; font-size: 13.5px; }
.seg-tips small { display: block; color: var(--ink-2); font-size: 12.5px; line-height: 1.45; margin-top: 2px; }
/* ================================================================ medidor de rendimiento (#medir) */
.med-btn { position: fixed; left: max(12px, env(safe-area-inset-left, 0px)); bottom: calc(14px + env(safe-area-inset-bottom, 0px)); z-index: 60; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--card); color: var(--ink); font-size: 20px; box-shadow: var(--sh-pop); cursor: pointer; }
@media (max-width: 900px) { .med-btn { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); } }
.med-pre { margin: 0; max-height: 55vh; overflow: auto; padding: 12px; border-radius: 10px; background: var(--card-2); border: 1px solid var(--line); font: 12px/1.5 ui-monospace, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.med-acc { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
/* ================================================================ tienda propia: productos en Tienda online */
.tp-vistas { margin: 0 0 14px; }
.tp-barra { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0 0 12px; }
.tp-barra .seg { margin: 0; }
.tp-buscar { width: 220px; max-width: 100%; }
.tp-tbl td { vertical-align: middle; }
.tp-tbl .cprod { display: inline-flex; align-items: center; gap: 10px; }
.tp-nota { margin: 10px 2px 0; }
.tp-shop { margin-top: 16px; }
.tp-shop > summary { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.tp-shop > summary::-webkit-details-marker { display: none; }
.tp-shop-body { margin-top: 12px; }

/* hdrmovil: la barra de arriba cabe entera en celulares y tablets, aunque estén encendidos los cuatro módulos */
@media (max-width: 1023px) {   /* red de seguridad: si no cabe, los módulos se deslizan; los botones nunca salen de la pantalla */
  .app-hdr .modsw { flex: 0 1 auto; min-width: 0; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; }
  .app-hdr .modsw::-webkit-scrollbar { display: none; }
  .app-hdr .modsw button { flex: none; }
  .app-hdr .brand, .app-hdr .ia-btn, .app-hdr .hdr-actions { flex: none; }
  .app-hdr .hdr-actions { margin-left: auto; }
}
@media (max-width: 720px) {   /* celulares grandes y tablets chicas: la barra compacta */
  .app-hdr { gap: 6px; padding-inline: 8px; }
  .app-hdr .brand span { display: none; }
  .app-hdr .modsw button { padding: 0 7px; font-size: 12px; letter-spacing: 0; }
  .app-hdr .ia-btn { padding: 0 8px; }
  .app-hdr .ia-btn .ia-txt { display: none; }
  .app-hdr .hdr-actions { gap: 2px; }
  .app-hdr .hbtn { width: 32px; height: 32px; }
  .app-hdr .avatar-me { width: 32px; height: 32px; margin-left: 2px; }
}
@media (min-width: 1024px) {   /* notebooks de 1024–1366 px: la caja de búsqueda se achica (con «…») antes que empujar tu cuenta fuera */
  .app-hdr .cmdk-btn { min-width: 0; overflow: hidden; }
  .app-hdr .cmdk-btn > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .app-hdr .modsw, .app-hdr .ia-btn, .app-hdr .hdr-actions { flex: none; }
}
@media (max-width: 480px) { .app-hdr .brand { display: none; } }
@media (max-width: 420px) { .app-hdr .modsw button { padding: 0 4px; font-size: 11.5px; } }
@media (max-width: 370px) {
  .app-hdr { gap: 4px; padding-inline: 6px; }
  .app-hdr .modsw button { padding: 0 3px; }
  .app-hdr .hdr-actions { gap: 1px; }
}
