
:root {
  --bg: #0A0C11; --bg-2: #0E1118; --card: #131722; --card-2: #181D2A; --field: #0C0F16;
  --line: rgba(255,255,255,.07); --line-2: rgba(255,255,255,.13);
  --text: #ECEFF5; --muted: #8B93A7; --chip: rgba(255,255,255,.06);
  --accent: #7C6CFF; --accent-2: #3B82F6; --accent-text: #FFFFFF;
  --grad: linear-gradient(135deg, #8B5CF6 0%, #6366F1 55%, #3B82F6 100%);
  --ok: #34D399; --ok-bg: rgba(52,211,153,.12); --warn: #FBBF24; --warn-bg: rgba(251,191,36,.11);
  --err: #F87171; --err-bg: rgba(248,113,113,.12);
  --shadow: 0 1px 0 rgba(255,255,255,.035) inset, 0 10px 30px -12px rgba(0,0,0,.6);
  --radius: 16px; --nav-h: 64px; --side-w: 232px;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { min-height: 100%; background: radial-gradient(1200px 500px at 20% -10%, rgba(124,108,255,.10), transparent 60%),
    radial-gradient(900px 400px at 110% 0%, rgba(59,130,246,.07), transparent 60%), var(--bg);
  background-attachment: fixed; }
body { margin: 0; min-height: 100vh; color: var(--text); display: flow-root;
  font: 15px/1.5 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; }
/* iPhone horizontal: el contenido no queda bajo el notch (con viewport-fit=cover). */
main { --gx-l: max(16px, env(safe-area-inset-left)); --gx-r: max(16px, env(safe-area-inset-right));
  max-width: 820px; margin: 0 auto; padding: 0 var(--gx-r) 40px var(--gx-l); }
[id] { scroll-margin-top: 72px; } /* al abrir un enlace #sección, el encabezado fijo no la tapa */
body:has(nav.appnav) main { padding-bottom: calc(var(--nav-h) + 32px + env(safe-area-inset-bottom)); }
a { color: #A99BFF; text-decoration: none; }
a:hover { text-decoration: underline; }
p { margin: 0 0 10px; }
h1 { font-size: 26px; line-height: 1.2; letter-spacing: -.02em; margin: 0; font-weight: 750; }
h2 { font-size: 16px; margin: 0 0 12px; letter-spacing: -.01em; font-weight: 650; }
.muted { color: var(--muted); font-size: 13px; }
b, strong { font-weight: 650; }

/* Encabezado */
header.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin: 0 calc(-1 * var(--gx-r, 16px)) 8px calc(-1 * var(--gx-l, 16px)); padding: 12px var(--gx-r, 16px) 12px var(--gx-l, 16px);
  background: rgba(10,12,17,.72);
  -webkit-backdrop-filter: saturate(160%) blur(14px); backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; letter-spacing: -.01em;
  font-size: 16px; min-width: 0; }
.brand:hover { text-decoration: none; }
.brand .mark { width: 30px; height: 30px; border-radius: 9px; background: var(--grad); display: grid; place-items: center;
  box-shadow: 0 6px 18px -6px rgba(124,108,255,.7); flex: 0 0 auto; }
.brand .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
header .right { display: flex; align-items: center; gap: 8px; }
.page-title { margin: 14px 0 16px; display: flex; flex-direction: column; gap: 4px; }
.page-title .sub { color: var(--muted); font-size: 13px; }

/* Navegación: barra inferior (celular) / lateral (computadora) */
nav.appnav { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding: 6px max(6px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(6px, env(safe-area-inset-left));
  background: rgba(12,15,22,.86); -webkit-backdrop-filter: saturate(160%) blur(16px); backdrop-filter: saturate(160%) blur(16px);
  border-top: 1px solid var(--line); }
nav.appnav a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); font-size: 10.5px; font-weight: 600; border-radius: 12px; text-decoration: none; min-width: 0; }
nav.appnav a span.lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
nav.appnav a svg { width: 22px; height: 22px; }
nav.appnav a.active { color: var(--text); }
nav.appnav a.active svg { color: #A99BFF; filter: drop-shadow(0 0 8px rgba(124,108,255,.55)); }
nav.appnav a.active::before { content: ""; position: absolute; top: -6px; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--grad); }
nav.appnav .dot { position: absolute; top: 6px; right: calc(50% - 16px); width: 7px; height: 7px; border-radius: 50%;
  background: var(--ok); box-shadow: 0 0 0 2px var(--bg-2); }
nav.appnav .nav-brand { display: none; }
@media (min-width: 960px) {
  nav.appnav { top: 0; right: auto; width: var(--side-w); height: auto; grid-auto-flow: row; grid-auto-rows: max-content;
    align-content: start; gap: 4px; padding: 18px 12px; border-top: 0; border-right: 1px solid var(--line); background: rgba(12,15,22,.7); }
  nav.appnav .nav-brand { display: flex; margin: 0 6px 18px; }
  nav.appnav a { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 10px 12px; font-size: 14px; }
  nav.appnav a:hover { background: var(--chip); color: var(--text); text-decoration: none; }
  nav.appnav a.active { background: rgba(124,108,255,.12); }
  nav.appnav a.active::before { top: 10px; bottom: 10px; left: 0; width: 3px; height: auto; border-radius: 0 3px 3px 0; }
  nav.appnav a svg { width: 19px; height: 19px; }
  nav.appnav .dot { position: static; margin-left: auto; box-shadow: none; }
  body:has(nav.appnav) main { margin-left: var(--side-w); padding-left: 32px; padding-right: 32px; max-width: calc(820px + var(--side-w)); padding-bottom: 48px; }
  body:has(nav.appnav) header.topbar { margin: 0 -32px 8px; padding: 14px 32px; }
  body:has(nav.appnav) header.topbar .brand { visibility: hidden; }
}

/* Tarjetas */
section, details.fold { background: linear-gradient(180deg, var(--card-2), var(--card)); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); }
section { padding: 18px; margin-bottom: 14px; }
.card-title { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }
.card-title h2 { margin: 0; }
details.fold { margin-bottom: 12px; overflow: hidden; }
details.fold > summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer;
  font-weight: 650; font-size: 15.5px; letter-spacing: -.01em; -webkit-user-select: none; user-select: none; }
details.fold > summary:hover { background: rgba(255,255,255,.02); }
details.fold > summary::-webkit-details-marker, details.sub > summary::-webkit-details-marker { display: none; }
.fold .ico svg { width: 19px; height: 19px; color: #C4BAFF; }
.fold .ico { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; font-size: 17px; flex: 0 0 auto;
  background: linear-gradient(135deg, rgba(139,92,246,.22), rgba(59,130,246,.14)); border: 1px solid rgba(124,108,255,.25); }
.fold .ttl, .sub .ttl { flex: 1 1 auto; min-width: min-content; } /* el título no parte palabras ni queda bajo las etiquetas */
.chev { width: 8px; height: 8px; flex: 0 0 auto; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg); transition: transform .18s ease; margin: 0 4px 3px 2px; }
details[open] > summary > .chev { transform: rotate(-135deg); margin-bottom: -3px; }
.fold-body { padding: 16px; border-top: 1px solid var(--line); }
details.sub { border: 1px solid var(--line); border-radius: 12px; margin-top: 8px; background: rgba(0,0,0,.18); }
details.sub > summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 11px 12px; cursor: pointer; font-weight: 600; font-size: 14px; }
details.sub[open] > summary { border-bottom: 1px solid var(--line); }
.sub-body { padding: 12px; }

/* Estados */
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  background: var(--chip); border: 1px solid var(--line); white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.pill.ok { color: var(--ok); background: var(--ok-bg); border-color: rgba(52,211,153,.25); }
.pill.warn { color: var(--warn); background: var(--warn-bg); border-color: rgba(251,191,36,.25); }
.pill.err { color: var(--err); background: var(--err-bg); border-color: rgba(248,113,113,.25); }
/* Celular angosto: "Conectado" queda solo como el punto verde, para que quepa el nombre de la tienda. */
@media (max-width: 360px) { .topbar .pill.ok { font-size: 0; gap: 0; padding: 8px; } }
.badge { font-size: 11.5px; font-weight: 650; padding: 3px 9px; border-radius: 999px; background: var(--chip); color: var(--muted);
  border: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55%; letter-spacing: .01em; }
.badge.ok { background: var(--ok-bg); color: var(--ok); border-color: rgba(52,211,153,.22); }
.badge.warn { background: var(--warn-bg); color: var(--warn); border-color: rgba(251,191,36,.22); }
.badge.err { background: var(--err-bg); color: var(--err); border-color: rgba(248,113,113,.22); }
.cards .badge { max-width: none; flex: 0 0 auto; }
/* Si no cabe junto al título, la etiqueta se acorta ("Cambio recom…"), no el título. */
.sub > summary .badge, .fold > summary .badge { max-width: none; flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ttl small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }
.flash { padding: 12px 14px; border-radius: 12px; margin: 4px 0 14px; white-space: pre-line; background: var(--ok-bg); color: var(--ok);
  border: 1px solid rgba(52,211,153,.25); font-size: 14px; }
.flash.err { background: var(--err-bg); color: var(--err); border-color: rgba(248,113,113,.25); }
/* Estado fijo dentro de una sección (agendado, en curso): como .flash pero sin volverse aviso flotante. */
.status-box { padding: 12px 14px; border-radius: 12px; margin: 4px 0 14px; background: var(--ok-bg); color: var(--ok);
  border: 1px solid rgba(52,211,153,.25); line-height: 1.45; }
.status-box a { color: inherit; text-decoration: underline; }
.status-box .muted { display: block; margin-top: 4px; }
.notice { padding: 11px 13px; border-radius: 12px; background: var(--warn-bg); color: #FCD98A; margin-bottom: 12px; white-space: pre-line;
  border: 1px solid rgba(251,191,36,.2); font-size: 14px; }
.notice a { color: #FDE68A; text-decoration: underline; }

/* Botones */
button, .btn { font: inherit; font-weight: 650; font-size: 14.5px; border: 0; border-radius: 11px; padding: 11px 16px; cursor: pointer;
  background: var(--grad); color: var(--accent-text); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  box-shadow: 0 8px 20px -10px rgba(99,102,241,.8), 0 1px 0 rgba(255,255,255,.18) inset; transition: transform .08s ease, filter .15s ease; }
button:hover, .btn:hover { filter: brightness(1.08); text-decoration: none; }
button:active, .btn:active { transform: translateY(1px); }
button.secondary, .btn.secondary { background: var(--chip); color: var(--text); border: 1px solid var(--line-2); box-shadow: none; }
button.secondary:hover, .btn.secondary:hover { background: rgba(255,255,255,.1); }
button.danger { background: var(--err-bg); color: var(--err); border: 1px solid rgba(248,113,113,.3); box-shadow: none; }
button.small, .btn.small { padding: 7px 11px; font-size: 13px; border-radius: 9px; }
button:disabled { opacity: .4; cursor: not-allowed; filter: grayscale(.4); transform: none; }
.help-toggle { width: 34px; height: 34px; padding: 0; border-radius: 50%; background: var(--chip); color: var(--muted); font-size: 15px;
  border: 1px solid var(--line-2); box-shadow: none; display: inline-flex; align-items: center; justify-content: center;
  line-height: 1; text-decoration: none; flex: 0 0 auto; box-sizing: border-box; }
html.hints .help-toggle { background: var(--grad); color: #fff; border-color: transparent; }

/* Campos */
input, select, textarea { font: inherit; font-size: 15px; color: var(--text); background: var(--field); border: 1px solid var(--line-2);
  border-radius: 11px; padding: 11px 13px; width: 100%; transition: border-color .15s ease, box-shadow .15s ease; }
input::placeholder, textarea::placeholder { color: #5C6478; }
/* iPhone: con letra de menos de 16 px, Safari acerca la página al tocar un campo y se queda así. */
@media (pointer: coarse) { input, select, textarea { font-size: 16px; } }
input:focus, select:focus, textarea:focus { outline: none; border-color: rgba(124,108,255,.7); box-shadow: 0 0 0 3px rgba(124,108,255,.22); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--accent); }
select { appearance: none; -webkit-appearance: none; padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, #8B93A7 50%), linear-gradient(135deg, #8B93A7 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
select option, select optgroup { background-color: #151A26; color: var(--text); }
select:disabled { opacity: .55; }
textarea { min-height: 60px; max-height: 9em; overflow-y: auto; resize: vertical; line-height: 1.45; }
label { display: block; font-weight: 600; font-size: 13.5px; margin: 14px 0 6px; color: #C9CEDA; }
label:first-child { margin-top: 0; }
.sub-body input, .sub-body textarea, .sub-body select { background-color: var(--field); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row > * { flex: 0 0 auto; }
.grow { flex: 1 1 160px !important; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0 12px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.pair > * { min-width: 0; }
.pair input { min-width: 0; max-width: 100%; padding-left: 8px; padding-right: 6px; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; margin: 18px 0 8px; text-transform: uppercase; letter-spacing: .06em; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choices label { margin: 0; font-weight: 600; }
.choices input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.choices span { display: inline-block; min-width: 54px; text-align: center; padding: 9px 14px; border-radius: 10px; font-size: 14px;
  background: var(--chip); border: 1px solid var(--line-2); cursor: pointer; transition: background .15s ease; }
.choices input:checked + span { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 6px 16px -8px rgba(99,102,241,.9); }
.choices input:focus-visible + span { box-shadow: 0 0 0 3px rgba(124,108,255,.35); }
.vars { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.vars button { font: 500 12px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 5px 8px; border-radius: 7px;
  background: rgba(124,108,255,.1); color: #C4BAFF; border: 1px solid rgba(124,108,255,.25); box-shadow: none; }

/* Datos */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.stat { background: rgba(0,0,0,.22); border: 1px solid var(--line); border-radius: 12px; padding: 12px; min-width: 0; }
.stat b { display: block; font-size: 20px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat span { color: var(--muted); font-size: 12px; }
@media (max-width: 420px) { .stat { padding: 10px 8px; } .stat b { font-size: clamp(14px, 4.4vw, 18px); } }
.cards { list-style: none; margin: 0; padding: 0; }
.cards li { display: flex; gap: 12px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); }
.cards li:first-child { border-top: 0; }
.code { font: 650 11.5px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 2px 6px; border-radius: 6px; margin-right: 7px;
  background: rgba(124,108,255,.12); color: #C4BAFF; border: 1px solid rgba(124,108,255,.25); vertical-align: 1px; letter-spacing: .02em; }
.thumb { width: 50px; height: 70px; object-fit: cover; border-radius: 7px; background: var(--chip); flex: 0 0 auto;
  box-shadow: 0 6px 14px -8px rgba(0,0,0,.8); border: 1px solid var(--line); }
.thumb.missing { display: grid; place-items: center; font-size: 11px; color: var(--muted); text-align: center; }
.info { flex: 1 1 auto; min-width: 0; }
/* Nombres de cartas y compradores: hasta dos líneas en vez de cortarse en la primera (celular). */
.info b { overflow: hidden; white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
  overflow-wrap: anywhere; line-height: 1.3; }
/* Si el nombre trae una etiqueta (Suspendido, No responde…), crece normal: recortarlo la encimaría. */
.info b:has(.badge) { display: block; overflow: visible; -webkit-line-clamp: unset; line-clamp: none; }
.info b .badge { vertical-align: middle; margin: 2px 0; }
.qr { display: block; width: 100%; max-width: 300px; margin: 8px auto 12px; background: #fff; padding: 12px; border-radius: 14px; }
.offer { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  padding: 11px 13px; background: rgba(0,0,0,.2); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; }
ol.steps { margin: 0 0 12px; padding-left: 20px; }
form.inline { display: inline; }

/* Pestañas internas (Pedidos, Reportes): control segmentado */
nav.tabs { display: flex; gap: 4px; overflow-x: auto; margin: 0 0 14px; padding: 4px; scrollbar-width: none;
  background: rgba(0,0,0,.25); border: 1px solid var(--line); border-radius: 13px; }
nav.tabs::-webkit-scrollbar { display: none; }
/* Cuatro tipos de venta en el celular: en dos filas (así se ven todos, sin deslizar). */
@media (max-width: 560px) { nav.tabs.seg4 { display: grid; grid-template-columns: 1fr 1fr; } }
nav.tabs a { flex: 1 0 auto; text-align: center; padding: 8px 12px; border-radius: 9px; color: var(--muted); text-decoration: none;
  font-weight: 600; font-size: 13.5px; white-space: nowrap; }
nav.tabs a.active { background: var(--card-2); color: var(--text); box-shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 4px 12px -6px rgba(0,0,0,.8); }

/* Subir archivos */
body.subiendo label.btn { opacity: .5; pointer-events: none; }
.dropzone { position: relative; border: 1.5px dashed var(--line-2); border-radius: 14px; padding: 20px 14px; text-align: center;
  background: rgba(0,0,0,.18); color: var(--muted); transition: border-color .15s, background .15s; cursor: pointer; }
.dropzone:hover, .dropzone.over { border-color: rgba(124,108,255,.7); background: rgba(124,108,255,.08); color: var(--text); }
.dropzone.has-files { border-style: solid; border-color: rgba(124,108,255,.6); color: var(--text); }
.dropzone input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dropzone .dz-title { font-weight: 650; display: block; color: var(--text); }
.dropzone .dz-files { display: block; font-size: 13px; margin-top: 4px; overflow-wrap: anywhere; }

/* Ayuda: los textos .hint solo se ven con el botón ? del encabezado */
.hint { display: none; }
html.hints .hint { display: block; }
html.hints span.hint { display: inline; }

/* Guía de inicio */
.setup-banner { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 10px 0 0; padding: 12px 14px;
  border-radius: 14px; color: var(--text); background: linear-gradient(135deg, rgba(139,92,246,.22), rgba(59,130,246,.16));
  border: 1px solid rgba(124,108,255,.35); font-size: 14px; }
.setup-banner:hover { text-decoration: none; filter: brightness(1.1); }
.setup-banner span:last-child { color: #C4BAFF; font-weight: 650; white-space: nowrap; }
.progress { height: 8px; border-radius: 999px; background: rgba(255,255,255,.07); overflow: hidden; margin-top: 10px; }
.progress > div { height: 100%; background: var(--grad); border-radius: 999px; transition: width .3s ease; }
.fold .ico { font-weight: 750; font-size: 15px; color: #C4BAFF; }
ol.steps li { margin: 6px 0; }
@media (max-width: 959px) { nav.appnav a.side-only { display: none; } }

/* Entrar */
.login { max-width: 380px; margin: 12vh auto 0; }
.login .brand { justify-content: center; font-size: 20px; margin-bottom: 18px; }
.login .brand .mark { width: 40px; height: 40px; border-radius: 12px; }

/* Listas desplegables propias (computadora): se ven como el campo y el menú sale justo debajo */
.dd { position: relative; display: block; min-width: 0; }
.dd .dd-native { display: none; }
.dd-btn { width: 100%; text-align: left; justify-content: flex-start; font: inherit; font-size: 15px; font-weight: 400; color: var(--text);
  background-color: var(--field); border: 1px solid var(--line-2); border-radius: 11px; padding: 11px 34px 11px 13px; min-height: 45px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; box-shadow: none;
  background-image: linear-gradient(45deg, transparent 50%, #8B93A7 50%), linear-gradient(135deg, #8B93A7 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.dd-btn:hover { border-color: rgba(124,108,255,.45); filter: none; transform: none; }
.dd-btn:focus-visible, .dd.open .dd-btn { outline: none; border-color: rgba(124,108,255,.7); box-shadow: 0 0 0 3px rgba(124,108,255,.22); }
.dd-btn:disabled { opacity: .55; cursor: not-allowed; }
.dd-list { display: none; position: fixed; z-index: 75; min-width: 180px; max-height: 280px;
  overflow-y: auto; margin: 0; padding: 6px; list-style: none; background: #151A26; border: 1px solid var(--line-2); border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0,0,0,.55); }
.dd.open .dd-list { display: block; animation: toast-in .12s ease; }
.dd-list li { padding: 10px 12px 10px 32px; border-radius: 8px; cursor: pointer; font-size: 15px; color: var(--text); position: relative; }
.dd-list li.active { background: var(--chip); }
.dd-list li[aria-selected="true"] { color: #C9C1FF; font-weight: 600; }
.dd-list li[aria-selected="true"]::before { content: "✓"; position: absolute; left: 11px; color: #A99BFF; }
.dd-list li[aria-disabled="true"] { opacity: .45; cursor: default; }

/* Actualización en curso: tapa la página con un aviso tranquilo hasta que el panel vuelve */
.updating { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: rgba(10,12,17,.92);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); text-align: center; padding: 24px; animation: toast-in .2s ease; }
.updating > div { display: grid; gap: 10px; justify-items: center; max-width: 340px; }
.updating b { font-size: 19px; }
.updating span:not(.spin) { color: var(--muted); font-size: 14.5px; }
.updating .spin { width: 44px; height: 44px; border-radius: 50%; border: 4px solid #232838; border-top-color: #7C6CFF; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
/* Deslizar para recargar (webapp): el círculo baja con el dedo y gira al soltar. */
.ptr { position: fixed; z-index: 65; top: calc(env(safe-area-inset-top) - 44px); left: 50%; width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; background: var(--card-2); border: 1px solid var(--line-2); box-shadow: 0 6px 18px rgba(0,0,0,.5);
  transform: translate(-50%, 0); opacity: 0; pointer-events: none; transition: transform .2s ease, opacity .2s ease; }
.ptr.on { opacity: 1; transition: none; }
.ptr.loading { transition: transform .2s ease; }
.ptr span { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid #2A3042; border-top-color: var(--muted); }
.ptr.ready span { border-top-color: var(--accent); }
.ptr.loading span { animation: spin .8s linear infinite; }

/* Avisos flotantes, barra de progreso y visor de fotos */
.toasts { position: fixed; z-index: 60; top: calc(10px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  width: min(560px, calc(100vw - 24px)); display: grid; gap: 8px; pointer-events: none; }
.toasts .flash { margin: 0; pointer-events: auto; position: relative; padding-right: 40px; box-shadow: 0 12px 30px rgba(0,0,0,.45);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); animation: toast-in .22s ease; }
.toasts .flash.out { opacity: 0; transform: translateY(-6px); transition: opacity .2s ease, transform .2s ease; }
.toast-x { position: absolute; top: 6px; right: 6px; background: transparent; color: inherit; padding: 4px 8px; font-size: 13px; opacity: .7; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }
.progress-top { position: fixed; z-index: 70; top: 0; left: 0; height: 3px; width: 0; background: var(--grad); opacity: 0; pointer-events: none; }
.progress-top.run { opacity: 1; width: 80%; transition: width 6s cubic-bezier(.1,.7,.2,1); }
.progress-top.done { opacity: 0; width: 100%; transition: width .2s ease, opacity .3s ease .15s; }
form.sending { opacity: .7; }
img[data-full] { cursor: zoom-in; }
html.no-scroll, html.no-scroll body { overflow: hidden; }
.viewer { position: fixed; inset: 0; z-index: 80; background: rgba(5,6,10,.96); display: none; place-items: center; touch-action: pinch-zoom; }
.viewer.on { display: grid; animation: toast-in .18s ease; }
.viewer img { max-width: 100vw; max-height: 100vh; max-height: 100dvh; object-fit: contain; }
.viewer button { position: absolute; background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.14);
  width: 44px; height: 44px; padding: 0; border-radius: 50%; font-size: 22px; line-height: 1; }
.viewer .v-x { top: calc(12px + env(safe-area-inset-top)); right: 12px; font-size: 16px; }
.viewer .v-prev { left: 10px; top: 50%; transform: translateY(-50%); }
.viewer .v-next { right: 10px; top: 50%; transform: translateY(-50%); }
.viewer.single .v-prev, .viewer.single .v-next { display: none; }
.viewer .v-count { position: absolute; bottom: calc(14px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  color: #cfd3dd; font-size: 13px; background: rgba(0,0,0,.4); padding: 3px 10px; border-radius: 999px; }
.viewer .v-count:empty { display: none; }

/* ---- Estilo minimalista: superficies planas, menos bordes y sombras, un solo acento ---- */
:root {
  --bg: #0B0C10; --bg-2: #0B0C10; --card: #131419; --card-2: #17181E; --field: #0F1015;
  --line: rgba(255,255,255,.06); --line-2: rgba(255,255,255,.10); --chip: rgba(255,255,255,.05);
  --text: #EDEEF2; --muted: #8A8F9C; --accent: #7C6CFF; --grad: #7C6CFF; --radius: 18px;
}
html { background: var(--bg); }
header.topbar { background: rgba(11,12,16,.8); border-bottom: 0; padding-top: 14px; padding-bottom: 10px; }
.brand .mark { box-shadow: none; }
.page-title { margin: 18px 0 18px; }
h1 { font-size: 28px; font-weight: 700; letter-spacing: -.025em; }
/* Tarjetas planas */
section, details.fold { background: var(--card); border: 1px solid var(--line); box-shadow: none; }
details.fold { margin-bottom: 10px; }
details.fold > summary { padding: 16px 18px; gap: 12px; font-weight: 600; font-size: 15.5px; }
details.fold > summary:hover { background: transparent; }
.fold .ico, .fold .ico svg { background: none; border: 0; width: 20px; height: 20px; color: var(--muted); font-size: 17px; }
.fold .ico { width: 22px; }
.fold-body { border-top: 0; padding: 2px 18px 18px; }
details.sub { background: transparent; border: 1px solid var(--line); border-radius: 14px; }
details.sub > summary { padding: 12px 14px; font-weight: 550; }
details.sub[open] > summary { border-bottom: 0; }
.sub-body { padding: 2px 14px 14px; }
.chev { border-color: #5E6371; }
/* Etiquetas discretas */
.badge, .pill { border: 0; font-weight: 600; }
.badge { background: rgba(255,255,255,.06); padding: 4px 10px; }
.pill::before { box-shadow: none; }
.flash, .status-box, .notice { border: 0; border-radius: 14px; }
.notice { background: rgba(251,191,36,.09); color: #F3D58C; }
/* Botones de un solo color */
button, .btn { background: var(--accent); box-shadow: none; border-radius: 12px; font-weight: 600; }
button:hover, .btn:hover { filter: brightness(1.1); }
button.secondary, .btn.secondary { background: rgba(255,255,255,.06); border: 0; }
button.secondary:hover, .btn.secondary:hover { background: rgba(255,255,255,.1); }
button.danger { background: rgba(248,113,113,.1); border: 0; }
.help-toggle { background: rgba(255,255,255,.05); border: 0; }
html.hints .help-toggle { background: var(--accent); }
/* Campos */
input, select, textarea, .dd-btn { background-color: var(--field); border: 1px solid var(--line-2); border-radius: 12px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124,108,255,.18); }
label { color: #B9BDC8; font-weight: 550; }
.choices span { background: rgba(255,255,255,.05); border: 0; }
.choices input:checked + span { background: var(--accent); box-shadow: none; }
.vars button { background: rgba(124,108,255,.1); border: 0; }
/* Datos y listas */
.stat { background: rgba(255,255,255,.03); border: 0; border-radius: 14px; }
.cards li { border-top-color: var(--line); padding: 12px 0; }
.thumb { box-shadow: none; border: 0; border-radius: 8px; }
.code { border: 0; }
.offer { background: rgba(255,255,255,.03); border: 0; }
/* Pestañas (tipo de venta, Pedidos, Reportes) */
nav.tabs { background: rgba(255,255,255,.04); border: 0; border-radius: 14px; }
nav.tabs a.active { background: #22232B; box-shadow: none; }
/* Navegación */
nav.appnav { background: rgba(11,12,16,.9); border-top: 1px solid var(--line); }
nav.appnav a.active::before { display: none; }
nav.appnav a.active svg { color: var(--accent); filter: none; }
@media (min-width: 960px) {
  nav.appnav { background: var(--bg); border-right: 1px solid var(--line); }
  nav.appnav a.active { background: rgba(255,255,255,.05); }
}
.setup-banner { background: rgba(124,108,255,.1); border: 0; }
nav.tabs a { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
nav.tabs .dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; }
nav.tabs .dot.live { background: #F87171; }
nav.tabs .dot.sched { background: var(--accent); }
/* Los badges cortos (Listo, Siguiente) no se cortan: el título es el que se ajusta. */
.sub > summary .badge, .fold > summary .badge { flex: 0 0 auto; max-width: 45%; }
/* Íconos de sección con emoji: en gris discreto, como los de línea. */
.fold .ico { filter: grayscale(1); opacity: .75; }
@media (max-width: 420px) { .stat b { font-size: clamp(13px, 3.9vw, 18px); } nav.tabs a { padding: 8px 10px; } }
.dropzone { background: transparent; border-color: var(--line-2); }
