/* ==========================================================================
   Panel de gestión v2 · ancho completo, claro/oscuro, cristal y sombras suaves.
   Movimiento: entradas con ease-out (≤ 300 ms), nada animado en atajos de teclado.
   ========================================================================== */
:root {
  --bg: #f5f2f1; --bg-2: #efebea; --panel: #ffffff; --panel-2: #faf8f7; --ink: #1a1617; --muted: #665d5f; --faint: #8f8688;
  --line: #ebe5e3; --line-2: #ddd5d3; --hover: rgba(26, 22, 23, .045); --sel: rgba(26, 22, 23, .075);
  --glass: rgba(255, 255, 255, .72); --glass-line: rgba(255, 255, 255, .6);
  --ok: #1d7a4c; --ok-bg: #e5f3eb; --warn: #8f5300; --warn-bg: #fbefd9; --danger: #b42318; --danger-bg: #fdeceb; --info: #2f5f9e; --info-bg: #e8eff9;
  --sh-1: 0 1px 2px rgba(40, 20, 25, .05), 0 1px 1px rgba(40, 20, 25, .03);
  --sh-2: 0 1px 2px rgba(40, 20, 25, .04), 0 6px 18px -6px rgba(40, 20, 25, .12);
  --sh-3: 0 2px 6px rgba(40, 20, 25, .06), 0 24px 60px -18px rgba(40, 20, 25, .28);
  --r: 16px; --r-sm: 11px; --r-xs: 8px; --side: 264px; --side-mini: 76px; --top: 64px; --gap: 20px;
  --ctl: 42px; --ctl-sm: 34px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1); --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1); --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --accent-soft: color-mix(in srgb, var(--accent) 12%, var(--panel));
  --accent-text: color-mix(in srgb, var(--accent) 88%, var(--ink));
  color-scheme: light;
}
:root[data-mode="dark"] {
  --bg: #111012; --bg-2: #161416; --panel: #1b191b; --panel-2: #201d20; --ink: #f2eded; --muted: #aaa1a3; --faint: #847b7d;
  --line: #2a2629; --line-2: #383336; --hover: rgba(255, 255, 255, .05); --sel: rgba(255, 255, 255, .09);
  --glass: rgba(27, 25, 27, .72); --glass-line: rgba(255, 255, 255, .06);
  --ok: #5fd39a; --ok-bg: rgba(95, 211, 154, .12); --warn: #f2b65a; --warn-bg: rgba(242, 182, 90, .12); --danger: #ff8a7f; --danger-bg: rgba(255, 138, 127, .12); --info: #8ab4f0; --info-bg: rgba(138, 180, 240, .12);
  --sh-1: 0 1px 2px rgba(0, 0, 0, .4); --sh-2: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 24px -10px rgba(0, 0, 0, .6); --sh-3: 0 30px 70px -20px rgba(0, 0, 0, .75), 0 0 0 1px rgba(255, 255, 255, .05);
  --accent-soft: color-mix(in srgb, var(--accent) 18%, var(--panel));
  --accent-text: color-mix(in srgb, var(--accent) 55%, #fff);
  color-scheme: dark;
}
:root[data-density="compact"] { --ctl: 38px; --ctl-sm: 32px; --gap: 14px; }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top) + 16px); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font-ui); -webkit-font-smoothing: antialiased; caret-color: var(--accent); }
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 12px; border: 4px solid transparent; background-clip: padding-box; }
.ic { width: 18px; height: 18px; flex: none; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.strong { font-weight: 600; }
.grow { flex: 1 1 auto; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.row--wrap { flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.row--end { justify-content: flex-end; }
.row--top { align-items: flex-start; }
.stack { display: grid; gap: 14px; align-content: start; min-width: 0; }
.stack--sm { gap: 8px; }
.stack--lg { gap: var(--gap); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }

/* ---------- Botones ---------- */
.btn { --h: var(--ctl); display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--h); min-width: var(--h); padding: 0 16px; border-radius: var(--r-sm); font-weight: 550; font-size: 14px; white-space: nowrap; text-decoration: none; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line-2), var(--sh-1); transition: transform 140ms var(--ease-out), background-color 160ms ease, box-shadow 160ms ease, color 160ms ease; user-select: none; position: relative; }
.btn:active { transform: scale(0.97); }
.btn .ic { width: 17px; height: 17px; transition: transform 200ms var(--ease-out); }
.btn--sm { --h: var(--ctl-sm); padding: 0 12px; font-size: 13.5px; border-radius: 9px; }
.btn--sm .ic { width: 16px; height: 16px; }
.btn--primary { background: var(--ink); color: var(--bg); box-shadow: var(--sh-1); }
.btn--accent { background: var(--accent); color: var(--accent-ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 6px 16px -8px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn--danger { background: var(--danger); color: #fff; box-shadow: none; }
:root[data-mode="dark"] .btn--danger { color: #1b0c0b; }
.btn--quiet { box-shadow: none; background: transparent; }
.btn--soft { box-shadow: none; background: var(--accent-soft); color: var(--accent-text); }
.btn--block { width: 100%; }
.btn--icon { padding: 0; width: var(--h); }
.btn[disabled] { opacity: .45; pointer-events: none; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line-2), var(--sh-2); }
  .btn--primary:hover { background: color-mix(in srgb, var(--ink) 86%, var(--bg)); box-shadow: var(--sh-2); }
  .btn--accent:hover { background: color-mix(in srgb, var(--accent) 90%, #000); box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 10px 22px -8px color-mix(in srgb, var(--accent) 80%, transparent); }
  .btn--danger:hover { background: color-mix(in srgb, var(--danger) 88%, #000); }
  .btn--quiet:hover, .btn--soft:hover { background: var(--hover); box-shadow: none; }
  .btn:hover .ic--go { transform: translateX(2px); }
}
.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading .ic { opacity: 0; }
.btn.is-loading::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--ink); border-right-color: transparent; animation: spin 520ms linear infinite; }
.btn--primary.is-loading::after { border-color: var(--bg); border-right-color: transparent; }
.btn--accent.is-loading::after { border-color: var(--accent-ink); border-right-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.iconbtn { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 10px; color: var(--muted); flex: none; transition: background-color 160ms ease, color 160ms ease, transform 140ms var(--ease-out); position: relative; }
.iconbtn:active { transform: scale(0.94); }
.iconbtn--sm { width: 30px; height: 30px; border-radius: 8px; }
.iconbtn--sm .ic { width: 16px; height: 16px; }
.iconbtn--danger { color: var(--danger); }
@media (hover: hover) and (pointer: fine) { .iconbtn:hover { background: var(--hover); color: var(--ink); } .iconbtn--danger:hover { background: var(--danger-bg); color: var(--danger); } }
.linkbtn { color: var(--accent-text); font-weight: 550; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* ---------- Distintivos ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--sel); color: var(--muted); white-space: nowrap; flex: none; }
.badge .ic { width: 13px; height: 13px; }
.badge--ok { background: var(--ok-bg); color: var(--ok); }
.badge--warn { background: var(--warn-bg); color: var(--warn); }
.badge--danger { background: var(--danger-bg); color: var(--danger); }
.badge--info { background: var(--info-bg); color: var(--info); }
.badge--accent { background: var(--accent-soft); color: var(--accent-text); }
.badge--dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 11.5px; font-weight: 700; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--accent)); flex: none; }
.avatar { width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 13.5px; font-weight: 650; background: color-mix(in srgb, var(--c, var(--accent)) 16%, var(--panel)); color: color-mix(in srgb, var(--c, var(--accent)) 75%, var(--ink)); overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--sm { width: 28px; height: 28px; font-size: 11px; }
.avatar--lg { width: 64px; height: 64px; font-size: 22px; }
.thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex: none; background: var(--bg-2); display: grid; place-items: center; color: var(--faint); }
.thumb--nail { border-radius: var(--nail, 50% 50% 46% 46% / 62% 62% 38% 38%); width: 34px; height: 46px; }

/* ---------- Acceso ---------- */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: radial-gradient(1200px 600px at 10% -10%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 60%), radial-gradient(900px 500px at 110% 110%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 60%), var(--bg); }
.auth__card { width: min(420px, 100%); background: var(--glass); backdrop-filter: blur(24px) saturate(1.4); -webkit-backdrop-filter: blur(24px) saturate(1.4); border-radius: 24px; padding: 36px 32px; box-shadow: var(--sh-3), inset 0 0 0 1px var(--glass-line); display: grid; gap: 22px; animation: rise 420ms var(--ease-out); }
.auth__brand { display: flex; align-items: center; gap: 12px; }
.auth h1 { font-family: var(--font-brand); font-size: 28px; line-height: 1.15; letter-spacing: -0.02em; font-weight: 600; }
.mark { width: 22px; height: 32px; border-radius: var(--nail, 50% 50% 46% 46% / 62% 62% 38% 38%); background: var(--accent); flex: none; box-shadow: inset 4px -6px 0 rgba(255, 255, 255, .22); }

/* ---------- Estructura ---------- */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100dvh; transition: grid-template-columns 300ms var(--ease-out); }
:root[data-side="mini"] .shell { grid-template-columns: var(--side-mini) minmax(0, 1fr); }
.side { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 6px; padding: 14px 12px; background: var(--bg-2); border-right: 1px solid var(--line); overflow: hidden; z-index: 40; }
.side__brand { display: flex; align-items: center; gap: 12px; padding: 8px 10px 14px; text-decoration: none; min-width: 0; }
.side__name { font-family: var(--font-brand); font-weight: 600; font-size: 16px; line-height: 1.2; letter-spacing: -0.01em; }
.side__sub { font-size: 12.5px; color: var(--muted); }
.side__scroll { flex: 1; overflow-y: auto; overflow-x: hidden; margin: 0 -12px; padding: 0 12px; scrollbar-width: thin; mask-image: linear-gradient(to bottom, transparent, #000 10px, #000 calc(100% - 14px), transparent); }
.nav { display: grid; gap: 2px; position: relative; }
.nav__group { display: grid; gap: 2px; padding: 8px 0; }
.nav__label { font-size: 11.5px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); padding: 6px 12px 4px; white-space: nowrap; }
.nav a, .nav button { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; height: 38px; padding: 0 12px; border-radius: 10px; font-size: 14.5px; font-weight: 500; color: var(--muted); text-decoration: none; transition: color 160ms ease, background-color 160ms ease; white-space: nowrap; width: 100%; }
.nav a .ic, .nav button .ic { width: 19px; height: 19px; }
.nav a span:not(.count), .nav button span:not(.count) { overflow: hidden; text-overflow: ellipsis; flex: 1; text-align: left; }
.nav a.is-on { color: var(--ink); font-weight: 600; }
.nav a.is-on .ic { color: var(--accent-text); }
@media (hover: hover) and (pointer: fine) { .nav a:not(.is-on):hover, .nav button:hover { background: var(--hover); color: var(--ink); } }
.nav__pill { position: absolute; z-index: 0; left: 0; right: 0; top: 0; height: 38px; border-radius: 10px; background: var(--panel); box-shadow: var(--sh-2), inset 0 0 0 1px var(--line); transition: transform 320ms var(--ease-out), opacity 200ms ease; pointer-events: none; }
:root[data-mode="dark"] .nav__pill { background: var(--panel-2); }
.side__foot { border-top: 1px solid var(--line); padding-top: 10px; }
/* Menú encogido: una columna de iconos centrada, con separadores finos entre grupos y rótulos flotantes */
:root[data-side="mini"] .side { padding: 14px 0; align-items: center; }
:root[data-side="mini"] .side__brand { justify-content: center; padding: 8px 0 14px; width: 100%; }
:root[data-side="mini"] .side__brand > div, :root[data-side="mini"] .nav a span:not(.count), :root[data-side="mini"] .nav button span:not(.count) { display: none; }
:root[data-side="mini"] .side__scroll { width: 100%; margin: 0; padding: 0; }
:root[data-side="mini"] .nav { justify-items: center; }
:root[data-side="mini"] .nav__group { justify-items: center; width: 100%; padding: 6px 0; }
:root[data-side="mini"] .nav__group + .nav__group { border-top: 1px solid var(--line); }
:root[data-side="mini"] .side .nav__label { display: none; }
:root[data-side="mini"] .nav a, :root[data-side="mini"] .nav button { width: 44px; height: 40px; justify-content: center; padding: 0; gap: 0; border-radius: 12px; }
:root[data-side="mini"] .nav__pill { left: 50%; right: auto; width: 44px; margin-left: -22px; border-radius: 12px; }
:root[data-side="mini"] .nav .count { position: absolute; top: 3px; right: 3px; min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; box-shadow: 0 0 0 2px var(--bg-2); }
:root[data-side="mini"] .side__foot { flex-direction: column; align-items: center; gap: 2px; width: 100%; padding: 10px 0 0; }
:root[data-side="mini"] .side__foot a, :root[data-side="mini"] .side__foot button { flex: none; }
:root[data-side="mini"] .side__collapse .ic { transform: scaleX(-1); }
.side__collapse .ic { transition: transform 300ms var(--ease-out); }
.side-tip { position: fixed; z-index: 120; left: 0; top: 0; padding: 7px 11px; border-radius: 9px; background: var(--ink); color: var(--bg); font-size: 13px; font-weight: 550; white-space: nowrap; pointer-events: none; box-shadow: var(--sh-2); opacity: 0; transform: translateX(-4px); transition: opacity 140ms ease, transform 180ms var(--ease-out); }
.side-tip.is-on { opacity: 1; transform: none; }
.side-tip::before { content: ""; position: absolute; left: -4px; top: 50%; width: 8px; height: 8px; margin-top: -4px; background: inherit; transform: rotate(45deg); border-radius: 2px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 30; height: var(--top); display: flex; align-items: center; gap: 12px; padding: 0 clamp(16px, 2.4vw, 32px); background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(18px) saturate(1.5); -webkit-backdrop-filter: blur(18px) saturate(1.5); transition: box-shadow 200ms ease; }
.top.is-scrolled { box-shadow: 0 1px 0 var(--line); }
.top__title { font-family: var(--font-brand); font-size: 21px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.2; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top__crumb { font-size: 12.5px; color: var(--faint); line-height: 1; margin-bottom: 3px; }
.top__menu { display: none; }
.top__search { display: flex; align-items: center; gap: 10px; height: 38px; width: clamp(180px, 22vw, 320px); padding: 0 8px 0 12px; border-radius: 11px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line), var(--sh-1); color: var(--faint); font-size: 14px; transition: box-shadow 160ms ease; }
.top__search span { flex: 1; text-align: left; }
.top__search kbd, .kbd { font: 600 11.5px/1 var(--font-ui); padding: 4px 6px; border-radius: 6px; background: var(--bg-2); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
@media (hover: hover) and (pointer: fine) { .top__search:hover { box-shadow: inset 0 0 0 1px var(--line-2), var(--sh-2); color: var(--muted); } }
.top__actions { display: flex; align-items: center; gap: 8px; }
.bell .count { position: absolute; top: 1px; right: 0; min-width: 17px; height: 17px; font-size: 10.5px; padding: 0 4px; box-shadow: 0 0 0 2px var(--bg); }
.bell.is-ring .ic { animation: ring 900ms var(--ease-out); transform-origin: 50% 2px; }
@keyframes ring { 0% { transform: rotate(0); } 15% { transform: rotate(14deg); } 30% { transform: rotate(-12deg); } 45% { transform: rotate(8deg); } 60% { transform: rotate(-5deg); } 75% { transform: rotate(2deg); } 100% { transform: rotate(0); } }
.content { flex: 1; width: 100%; padding: 8px clamp(16px, 2.4vw, 32px) 120px; }
.content.is-narrow { max-width: 1180px; }
.view-in { animation: viewIn 260ms var(--ease-out); }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } }
@keyframes rise { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 6px 0 18px; }
.page-head__t { font-family: var(--font-brand); font-size: clamp(24px, 2.2vw, 30px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
.page-head__d { color: var(--muted); max-width: 70ch; margin-top: 4px; }
.scrim { position: fixed; inset: 0; background: rgba(12, 8, 10, .38); backdrop-filter: blur(2px); z-index: 45; opacity: 0; pointer-events: none; transition: opacity 260ms ease; }
.scrim.is-on { opacity: 1; pointer-events: auto; }
.tabbar { display: none; }

/* ---------- Tarjetas y rejillas ---------- */
.card { background: var(--panel); border-radius: var(--r); box-shadow: var(--sh-1), 0 0 0 1px var(--line); min-width: 0; position: relative; }
:root[data-mode="dark"] .card { box-shadow: 0 0 0 1px var(--line); }
.card--glass { background: var(--glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.card--pad { padding: 20px; }
.card--lift { transition: transform 200ms var(--ease-out), box-shadow 200ms ease; }
@media (hover: hover) and (pointer: fine) { .card--lift:hover { transform: translateY(-2px); box-shadow: var(--sh-2), 0 0 0 1px var(--line-2); } }
.card__head { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 12px 14px 12px 20px; border-bottom: 1px solid var(--line); }
.card__head--flat { border-bottom: 0; padding-bottom: 0; }
.card__title { font-size: 15.5px; font-weight: 650; letter-spacing: -0.005em; display: flex; align-items: center; gap: 9px; min-width: 0; }
.card__title .ic { color: var(--faint); }
.card__sub { font-size: 13px; color: var(--muted); font-weight: 400; }
.card__body { padding: 18px 20px; }
.card__foot { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
.grid { display: grid; gap: var(--gap); min-width: 0; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--auto { grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); }
.grid--side { grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); align-items: start; }
.masonry { columns: 3 360px; column-gap: var(--gap); }
.masonry > * { break-inside: avoid; margin-bottom: var(--gap); display: block; }
@media (max-width: 1200px) { .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid--side { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 820px) { .grid--2, .grid--3 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 520px) { .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* KPIs */
.kpi { padding: 18px 20px; display: grid; gap: 6px; align-content: start; min-height: 112px; }
.kpi__l { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.kpi__l .ic { width: 16px; height: 16px; color: var(--faint); }
.kpi__v { font-family: var(--font-brand); font-size: clamp(24px, 2.2vw, 30px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi__d { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.delta { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; flex: none; font-weight: 650; font-size: 12px; padding: 2px 7px; border-radius: 999px; }
.delta .ic { width: 13px; height: 13px; }
.delta--up { color: var(--ok); background: var(--ok-bg); }
.delta--down { color: var(--danger); background: var(--danger-bg); }
.delta--flat { color: var(--muted); background: var(--sel); }
.kpi--accent { background: linear-gradient(140deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #000)); color: var(--accent-ink); box-shadow: 0 14px 34px -16px color-mix(in srgb, var(--accent) 80%, transparent); }
.kpi--accent .kpi__l, .kpi--accent .kpi__d, .kpi--accent .kpi__l .ic { color: color-mix(in srgb, var(--accent-ink) 80%, transparent); }

/* ---------- Listas ---------- */
.lines > * + * { border-top: 1px solid var(--line); }
.li { display: flex; align-items: center; gap: 14px; padding: 12px 20px; min-height: 60px; min-width: 0; position: relative; }
.li--click { cursor: pointer; transition: background-color 140ms ease; }
@media (hover: hover) and (pointer: fine) { .li--click:hover { background: var(--hover); } }
.li--click:active { background: var(--sel); }
.li__main { flex: 1; min-width: 0; }
.li__t { font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li__s { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li__end { display: flex; align-items: center; gap: 8px; flex: none; }
.li .time { width: 58px; flex: none; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.2; }
.li .time small { display: block; font-weight: 500; font-size: 12px; color: var(--muted); }
.li.is-past { opacity: .6; }
.li.is-now::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.empty { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 40px 24px; color: var(--muted); }
.empty > .ic { width: 40px; height: 40px; padding: 10px; border-radius: 14px; background: var(--bg-2); color: var(--faint); box-sizing: content-box; margin-bottom: 4px; }
.empty__t { font-weight: 650; color: var(--ink); font-size: 15.5px; }
.empty p { max-width: 46ch; }
.empty .btn { margin-top: 8px; }
.skeleton { border-radius: var(--r); background: linear-gradient(90deg, var(--bg-2), var(--hover), var(--bg-2)); background-size: 300% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -100% 0; } }

/* Tablas */
.table-wrap { overflow-x: auto; border-radius: var(--r); }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.table th { position: sticky; top: 0; z-index: 1; background: var(--panel-2); text-align: left; font-size: 12px; font-weight: 650; color: var(--muted); letter-spacing: .02em; padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th button { display: inline-flex; align-items: center; gap: 4px; font-weight: inherit; color: inherit; }
.table th button .ic { width: 13px; height: 13px; opacity: .5; }
.table th.is-sorted button { color: var(--ink); }
.table th.is-sorted button .ic { opacity: 1; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table tbody tr { transition: background-color 120ms ease; }
.table tbody tr.is-click { cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .table tbody tr.is-click:hover { background: var(--hover); } }
.table .cell-main { display: flex; align-items: center; gap: 12px; min-width: 200px; }

/* ---------- Barra de herramientas ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar--sticky { position: sticky; top: var(--top); z-index: 20; padding: 10px 0; margin-top: -10px; background: linear-gradient(var(--bg) 70%, transparent); }
.search { position: relative; display: flex; align-items: center; flex: 1 1 260px; max-width: 420px; }
.search .ic { position: absolute; left: 12px; color: var(--faint); pointer-events: none; }
.search .input { padding-left: 38px; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px; background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line); position: relative; flex: none; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { position: relative; z-index: 1; height: calc(var(--ctl) - 8px); padding: 0 14px; border-radius: 9px; font-size: 13.5px; font-weight: 550; color: var(--muted); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; transition: color 160ms ease; }
.seg button .ic { width: 16px; height: 16px; }
.seg button[aria-checked="true"], .seg button.is-on { color: var(--ink); }
.seg__pill { position: absolute; z-index: 0; top: 3px; left: 0; height: calc(var(--ctl) - 8px); border-radius: 9px; background: var(--panel); box-shadow: var(--sh-2), inset 0 0 0 1px var(--line); transition: transform 280ms var(--ease-out), width 280ms var(--ease-out); }
:root[data-mode="dark"] .seg__pill { background: var(--line-2); }
.seg--sm button { height: 28px; padding: 0 10px; font-size: 13px; }
.seg--sm .seg__pill { height: 28px; }
.seg--block { display: flex; width: 100%; }
.seg--block button { flex: 1; justify-content: center; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 13px; border-radius: 999px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line-2); font-size: 13.5px; font-weight: 550; color: var(--ink); transition: background-color 140ms ease, box-shadow 140ms ease, transform 140ms var(--ease-out), color 140ms ease; white-space: nowrap; }
.chip:active { transform: scale(0.96); }
.chip .ic { width: 15px; height: 15px; }
.chip small { color: var(--muted); font-weight: 500; }
.chip.is-on { background: var(--ink); color: var(--bg); box-shadow: none; }
.chip.is-on small { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.chip--accent.is-on { background: var(--accent); color: var(--accent-ink); }
@media (hover: hover) and (pointer: fine) { .chip:not(.is-on):hover { background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--faint); } }
.chip--x button { width: 20px; height: 20px; margin-right: -6px; border-radius: 50%; display: grid; place-items: center; }
.chip--x button .ic { width: 13px; height: 13px; }

/* ---------- Formularios ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 16px; align-items: start; }
.form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid--1 { grid-template-columns: minmax(0, 1fr); }
.form-grid > .span2, .form-grid > .span-all { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid, .form-grid--3 { grid-template-columns: minmax(0, 1fr); } }
.field { display: grid; gap: 7px; min-width: 0; align-content: start; }
.field__top { display: flex; align-items: center; gap: 6px; min-height: 20px; }
.field label, .field .label { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.field__top .tip-btn { margin-left: -2px; }
.field__count { margin-left: auto; font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.input, .field input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=range]):not([type=file]), .field select, .field textarea, select.input {
  width: 100%; height: var(--ctl); padding: 0 13px; border-radius: var(--r-sm); border: 0; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line-2); font-size: 15px; transition: box-shadow 160ms ease, background-color 160ms ease; outline: none; min-width: 0; }
:root[data-mode="dark"] .input, :root[data-mode="dark"] .field input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=range]), :root[data-mode="dark"] .field select, :root[data-mode="dark"] .field textarea { background: var(--bg-2); }
.field textarea, textarea.input { height: auto; min-height: 96px; padding: 11px 13px; resize: vertical; line-height: 1.5; }
.field select, select.input { appearance: none; padding-right: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; cursor: pointer; }
.input:hover, .field input:hover, .field select:hover, .field textarea:hover { box-shadow: inset 0 0 0 1px var(--faint); }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { box-shadow: inset 0 0 0 1.5px var(--accent), 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
.input.input--sm { height: var(--ctl-sm); font-size: 14px; padding: 0 11px; border-radius: 9px; }
[aria-invalid="true"] { box-shadow: inset 0 0 0 1.5px var(--danger), 0 0 0 4px var(--danger-bg) !important; animation: shake 300ms var(--ease-out); }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.affix { position: relative; display: flex; align-items: center; }
.affix > span { position: absolute; right: 13px; color: var(--muted); font-size: 14px; pointer-events: none; }
.affix input { padding-right: 52px !important; }
.affix--pre > span { right: auto; left: 13px; }
.affix--pre input { padding-left: 34px !important; padding-right: 13px !important; }
.vars { display: flex; flex-wrap: wrap; gap: 6px; }
.vars button { height: 26px; padding: 0 9px; border-radius: 7px; background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line); font: 600 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); transition: background-color 140ms ease, color 140ms ease; }
@media (hover: hover) and (pointer: fine) { .vars button:hover { background: var(--accent-soft); color: var(--accent-text); } }
.colorrow { display: flex; gap: 8px; align-items: center; }
.colorrow input[type=color] { width: var(--ctl); height: var(--ctl); border: 0; border-radius: var(--r-sm); padding: 4px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line-2); cursor: pointer; flex: none; }
.colorrow input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.colorrow input[type=color]::-webkit-color-swatch { border: 0; border-radius: 7px; }
.colorrow .input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: lowercase; }
input[type=range] { width: 100%; accent-color: var(--accent); height: 28px; }

/* Interruptores: la fila entera es pulsable */
.toggles { display: grid; }
.toggles > * + * { border-top: 1px solid var(--line); }
.toggle { display: flex; align-items: center; gap: 16px; padding: 14px 20px; cursor: pointer; min-height: 64px; transition: background-color 140ms ease; }
@media (hover: hover) and (pointer: fine) { .toggle:hover { background: var(--hover); } }
.toggle > div { flex: 1; min-width: 0; }
.toggle__t { font-weight: 600; font-size: 14.5px; display: flex; align-items: center; gap: 6px; }
.toggle__d { font-size: 13px; color: var(--muted); margin-top: 1px; }
.toggle--card { border-radius: var(--r-sm); box-shadow: inset 0 0 0 1px var(--line); padding: 12px 16px; min-height: 56px; }
.sw { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch { width: 44px; height: 26px; border-radius: 99px; background: var(--line-2); position: relative; flex: none; transition: background-color 200ms ease; }
.switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform 240ms var(--ease-out); }
.sw:checked + .switch, .sw:checked ~ .switch { background: var(--accent); }
.sw:checked + .switch::after, .sw:checked ~ .switch::after { transform: translateX(18px); }
.sw:focus-visible + .switch, .sw:focus-visible ~ .switch { outline: 2px solid var(--accent); outline-offset: 2px; }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

/* Ayudas: botón (i) con globo, para que los campos queden alineados */
.tip-btn { width: 20px; height: 20px; display: inline-grid; place-items: center; border-radius: 50%; color: var(--faint); flex: none; transition: color 140ms ease, background-color 140ms ease; }
.tip-btn .ic { width: 15px; height: 15px; }
@media (hover: hover) and (pointer: fine) { .tip-btn:hover { color: var(--accent-text); background: var(--accent-soft); } }
.tip-btn[aria-expanded="true"] { color: var(--accent-text); background: var(--accent-soft); }
.pop { position: fixed; z-index: 120; max-width: min(320px, calc(100vw - 24px)); padding: 11px 13px; border-radius: 12px; background: var(--ink); color: var(--bg); font-size: 13px; line-height: 1.5; box-shadow: var(--sh-3); transform-origin: var(--origin, top left); animation: popIn 160ms var(--ease-out); pointer-events: none; }
.pop--menu { padding: 6px; background: var(--panel); color: var(--ink); box-shadow: var(--sh-3), 0 0 0 1px var(--line); pointer-events: auto; min-width: 220px; animation-duration: 180ms; }
.pop--menu button, .pop--menu a { display: flex; align-items: center; gap: 10px; width: 100%; height: 38px; padding: 0 10px; border-radius: 8px; font-size: 14px; text-decoration: none; color: var(--ink); }
.pop--menu button .ic, .pop--menu a .ic { color: var(--muted); width: 17px; height: 17px; }
.pop--menu .is-danger, .pop--menu .is-danger .ic { color: var(--danger); }
.pop--menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
@media (hover: hover) and (pointer: fine) { .pop--menu button:hover, .pop--menu a:hover { background: var(--hover); } }
@keyframes popIn { from { opacity: 0; transform: scale(.96) translateY(-2px); } }

/* Selector de imagen */
.imgpick { display: flex; gap: 14px; align-items: center; min-height: 84px; padding: 10px; border-radius: var(--r-sm); box-shadow: inset 0 0 0 1px var(--line-2); background: var(--panel-2); }
.imgpick__pic { width: 64px; height: 64px; border-radius: 10px; background: var(--bg-2); display: grid; place-items: center; overflow: hidden; flex: none; color: var(--faint); }
.imgpick__pic img { width: 100%; height: 100%; object-fit: cover; }
.imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.imgs__item, .imgs__add { aspect-ratio: 1; border-radius: 12px; overflow: hidden; position: relative; background: var(--bg-2); }
.imgs__item img { width: 100%; height: 100%; object-fit: cover; }
.imgs__item button { position: absolute; top: 5px; right: 5px; width: 26px; height: 26px; border-radius: 50%; background: rgba(0, 0, 0, .6); color: #fff; display: grid; place-items: center; backdrop-filter: blur(6px); }
.imgs__item button .ic { width: 14px; height: 14px; }
.imgs__add { display: grid; place-items: center; color: var(--muted); box-shadow: inset 0 0 0 1.5px var(--line-2); background: transparent; border: 0; transition: background-color 140ms ease, color 140ms ease; }
@media (hover: hover) and (pointer: fine) { .imgs__add:hover { background: var(--accent-soft); color: var(--accent-text); } }
.itemlist { display: grid; gap: 10px; }
.item { border-radius: var(--r-sm); box-shadow: inset 0 0 0 1px var(--line); padding: 12px 14px 16px; display: grid; gap: 12px; background: var(--panel); }
.item__bar { display: flex; align-items: center; gap: 4px; }

/* ---------- Avisos ---------- */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-sm); background: var(--warn-bg); color: var(--ink); font-size: 14px; line-height: 1.5; }
.alert > .ic { color: var(--warn); margin-top: 1px; }
.alert--info { background: var(--info-bg); }
.alert--info > .ic { color: var(--info); }
.alert--ok { background: var(--ok-bg); }
.alert--ok > .ic { color: var(--ok); }
.alert--danger { background: var(--danger-bg); }
.alert--danger > .ic { color: var(--danger); }
.alert a { color: inherit; font-weight: 600; }
.alert .btn { margin-left: auto; flex: none; }
.preview-msg { white-space: pre-wrap; font-size: 14px; line-height: 1.55; padding: 14px 16px; border-radius: 16px 16px 16px 4px; background: #dcf8c6; color: #111; box-shadow: var(--sh-1); max-width: 440px; }
:root[data-mode="dark"] .preview-msg { background: #1f4d3a; color: #e9fff1; }
.preview-msg--tg { background: #fff; border-radius: 14px 14px 14px 4px; box-shadow: var(--sh-2), 0 0 0 1px var(--line); }
:root[data-mode="dark"] .preview-msg--tg { background: #24303f; color: #e8f1ff; }
.copy-field { display: flex; gap: 8px; }
.copy-field .input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.steps-help { counter-reset: s; display: grid; gap: 10px; }
.steps-help li { counter-increment: s; display: grid; grid-template-columns: 28px 1fr; gap: 10px; font-size: 14px; line-height: 1.5; }
.steps-help li::before { content: counter(s); width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); font-weight: 700; font-size: 12.5px; display: grid; place-items: center; }

/* ---------- Diálogos y hojas ---------- */
dialog { padding: 0; border: 0; color: inherit; background: none; max-width: none; max-height: none; }
dialog::backdrop { background: rgba(12, 8, 10, 0); transition: background-color 240ms ease, backdrop-filter 240ms ease; }
dialog.is-in::backdrop { background: rgba(12, 8, 10, .42); backdrop-filter: blur(3px); }
.modal { margin: auto; width: min(460px, calc(100vw - 32px)); border-radius: 20px; background: var(--panel); box-shadow: var(--sh-3); opacity: 0; transform: scale(.96); transition: opacity 200ms ease, transform 220ms var(--ease-out); }
.modal.is-in { opacity: 1; transform: none; }
.modal__body { padding: 24px 24px 8px; display: grid; gap: 8px; }
.modal__ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--danger-bg); color: var(--danger); margin-bottom: 6px; }
.modal__ic--info { background: var(--accent-soft); color: var(--accent-text); }
.modal__t { font-size: 18px; font-weight: 650; letter-spacing: -0.01em; }
.modal__foot { display: flex; gap: 10px; justify-content: flex-end; padding: 18px 24px 22px; }
.drawer { position: fixed; inset: 0 0 0 auto; margin: 0; height: 100dvh; width: min(560px, 100vw); background: var(--panel); box-shadow: var(--sh-3); display: flex; flex-direction: column; transform: translateX(100%); transition: transform 340ms var(--ease-drawer); border-radius: 22px 0 0 22px; overflow: hidden; }
.drawer--wide { width: min(980px, 100vw); }
.drawer--xl { width: min(1240px, 100vw); }
.drawer.is-in { transform: none; }
.drawer__head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 14px 24px; min-height: 68px; border-bottom: 1px solid var(--line); flex: none; }
.drawer__title { font-family: var(--font-brand); font-size: 20px; font-weight: 600; letter-spacing: -0.015em; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; outline: none; }
.drawer__body { flex: 1; overflow-y: auto; padding: 22px 24px 32px; overscroll-behavior: contain; }
.drawer__foot { display: flex; gap: 10px; align-items: center; padding: 14px 20px max(14px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); flex: none; }
.drawer__foot:empty { display: none; }
.subhead { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); margin: 6px 0 -4px; }
.section-title { font-size: 16px; font-weight: 650; margin: 28px 0 12px; display: flex; align-items: center; gap: 10px; }
.section-title:first-child { margin-top: 0; }
.section-title .ic { color: var(--faint); }

/* Hoja inferior en móvil */
@media (max-width: 760px) {
  .drawer, .drawer--wide, .drawer--xl { inset: auto 0 0 0; width: 100vw; height: calc(100dvh - 28px); border-radius: 22px 22px 0 0; transform: translateY(100%); }
  .drawer::before { content: ""; position: absolute; top: 7px; left: 50%; width: 40px; height: 5px; margin-left: -20px; border-radius: 9px; background: var(--line-2); z-index: 2; }
  .drawer__head { padding-top: 18px; }
  .drawer__body { padding: 18px 16px 28px; }
}

/* Avisos emergentes */
.toasts { position: fixed; z-index: 200; right: 20px; bottom: 20px; display: grid; gap: 10px; width: min(400px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; position: relative; overflow: hidden; display: grid; grid-template-columns: 20px 1fr auto; gap: 12px; align-items: start; padding: 14px 12px 15px 16px; border-radius: 14px; background: var(--ink); color: var(--bg); box-shadow: var(--sh-3); font-size: 14px; line-height: 1.45; opacity: 0; transform: translateY(12px) scale(.98); transition: opacity 240ms ease, transform 300ms var(--ease-out); }
.toast.is-in { opacity: 1; transform: none; }
.toast.is-out { opacity: 0; transform: translateX(24px); transition-duration: 180ms; }
.toast > .ic { width: 20px; height: 20px; color: color-mix(in srgb, var(--accent) 50%, #fff); }
.toast--ok > .ic { color: #6fdca5; }
.toast--error > .ic { color: #ff9b91; }
.toast__act { display: flex; gap: 4px; align-items: center; }
.toast__btn { height: 28px; padding: 0 10px; border-radius: 8px; font-weight: 650; font-size: 13px; background: color-mix(in srgb, var(--bg) 14%, transparent); color: var(--bg); }
.toast__x { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: color-mix(in srgb, var(--bg) 70%, transparent); }
.toast__x .ic { width: 15px; height: 15px; }
.toast__bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: color-mix(in srgb, var(--accent) 70%, #fff); transform-origin: left; animation: bar linear forwards; }
.toast:hover .toast__bar { animation-play-state: paused; }
@keyframes bar { to { transform: scaleX(0); } }
.toast__title { font-weight: 650; }
.toast__sub { color: color-mix(in srgb, var(--bg) 72%, transparent); font-size: 13px; }

/* Barra de cambios sin guardar */
.savebar { position: fixed; z-index: 35; left: 50%; bottom: 20px; display: flex; align-items: center; gap: 14px; padding: 8px 8px 8px 18px; border-radius: 16px; background: var(--ink); color: var(--bg); box-shadow: var(--sh-3); transform: translate(-50%, 140%); opacity: 0; transition: transform 340ms var(--ease-out), opacity 200ms ease; font-size: 14px; font-weight: 550; white-space: nowrap; }
.savebar.is-on { transform: translate(-50%, 0); opacity: 1; }
.savebar .btn--quiet { color: var(--bg); }
@media (hover: hover) and (pointer: fine) { .savebar .btn--quiet:hover { background: color-mix(in srgb, var(--bg) 12%, transparent); } }
:root:not([data-side]) .savebar, :root[data-side="full"] .savebar { margin-left: calc(var(--side) / 2); }
:root[data-side="mini"] .savebar { margin-left: calc(var(--side-mini) / 2); }

/* Paleta de comandos (sin animación: se usa con teclado) */
.cmd { margin: 12vh auto auto; width: min(640px, calc(100vw - 24px)); border-radius: 18px; background: var(--panel); box-shadow: var(--sh-3), 0 0 0 1px var(--line); overflow: hidden; }
.cmd::backdrop { background: rgba(12, 8, 10, .42); backdrop-filter: blur(3px); }
.cmd__in { display: flex; align-items: center; gap: 12px; padding: 0 18px; height: 60px; border-bottom: 1px solid var(--line); }
.cmd__in .ic { color: var(--faint); }
.cmd__in input { flex: 1; height: 100%; border: 0; outline: none; background: none; font-size: 17px; }
.cmd__list { max-height: min(60vh, 520px); overflow-y: auto; padding: 8px; }
.cmd__h { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); padding: 10px 10px 6px; }
.cmd__it { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 46px; padding: 6px 10px; border-radius: 10px; text-align: left; }
.cmd__it .ic { color: var(--muted); }
.cmd__it.is-on { background: var(--sel); }
.cmd__it small { color: var(--muted); font-size: 12.5px; display: block; }
.cmd__foot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }

/* Panel de avisos */
.notif { position: fixed; z-index: 60; top: calc(var(--top) - 4px); right: 16px; width: min(420px, calc(100vw - 24px)); max-height: min(72vh, 640px); display: flex; flex-direction: column; border-radius: 18px; background: var(--glass); backdrop-filter: blur(24px) saturate(1.5); -webkit-backdrop-filter: blur(24px) saturate(1.5); box-shadow: var(--sh-3), inset 0 0 0 1px var(--glass-line), 0 0 0 1px var(--line); transform-origin: top right; opacity: 0; transform: scale(.96) translateY(-4px); pointer-events: none; transition: opacity 180ms ease, transform 220ms var(--ease-out); }
.notif.is-open { opacity: 1; transform: none; pointer-events: auto; }
.notif__head { display: flex; align-items: center; gap: 8px; padding: 14px 12px 10px 18px; }
.notif__list { overflow-y: auto; padding: 0 6px 8px; }
.ev-item { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: start; padding: 10px 12px; border-radius: 12px; text-align: left; width: 100%; position: relative; }
.ev-item.is-new::after { content: ""; position: absolute; right: 12px; top: 16px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
@media (hover: hover) and (pointer: fine) { .ev-item:hover { background: var(--hover); } }
.ev-item__ic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--bg-2); color: var(--muted); }
.ev-item__ic .ic { width: 17px; height: 17px; }
.ev-item__ic--booked { background: var(--ok-bg); color: var(--ok); }
.ev-item__ic--cancelled, .ev-item__ic--noshow { background: var(--danger-bg); color: var(--danger); }
.ev-item__ic--modified, .ev-item__ic--waitlist { background: var(--info-bg); color: var(--info); }
.ev-item__ic--review, .ev-item__ic--paid { background: var(--accent-soft); color: var(--accent-text); }
.ev-item__ic--stock { background: var(--warn-bg); color: var(--warn); }
.ev-item__t { font-weight: 600; font-size: 14px; line-height: 1.35; }
.ev-item__s { font-size: 13px; color: var(--muted); margin-top: 2px; }
.ev-item__time { font-size: 12px; color: var(--faint); white-space: nowrap; padding-right: 14px; }

/* ---------- Hoy ---------- */
.hello { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 6px 0 22px; }
.hello__d { font-size: 13.5px; color: var(--muted); }
.hello__t { font-family: var(--font-brand); font-size: clamp(26px, 2.6vw, 36px); font-weight: 600; letter-spacing: -0.025em; line-height: 1.1; }
.dash { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); align-items: stretch; grid-auto-flow: row dense; }
.dash > .card:not(.next) { display: flex; flex-direction: column; }
.dash > .card:not(.next) > :last-child:not(.card__head) { flex: 1; }
.dash > .card .empty { height: 100%; align-content: center; }
.dash > * { grid-column: span 4; }
.dash > .w-8 { grid-column: span 8; }
.dash > .w-6 { grid-column: span 6; }
.dash > .w-12 { grid-column: 1 / -1; }
@media (max-width: 1280px) { .dash > *, .dash > .w-6 { grid-column: span 6; } .dash > .w-8 { grid-column: 1 / -1; } }
@media (max-width: 860px) { .dash > *, .dash > .w-6, .dash > .w-8 { grid-column: 1 / -1; } }
.next { display: grid; grid-template-columns: auto 1fr auto; gap: 20px; align-items: center; padding: 22px 24px; overflow: hidden; background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 12%, var(--panel)), var(--panel) 60%); }
.next__time { display: grid; place-items: center; width: 84px; height: 108px; border-radius: var(--nail, 50% 50% 46% 46% / 62% 62% 38% 38%); background: var(--accent); color: var(--accent-ink); box-shadow: 0 16px 30px -14px color-mix(in srgb, var(--accent) 90%, transparent); text-align: center; line-height: 1.1; }
.next__time b { font-family: var(--font-brand); font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.next__time small { font-size: 12px; opacity: .85; }
.next__in { font-size: 12.5px; font-weight: 650; color: var(--accent-text); text-transform: uppercase; letter-spacing: .05em; }
.next__name { font-family: var(--font-brand); font-size: 24px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.2; margin: 2px 0 4px; }
@media (max-width: 640px) { .next { grid-template-columns: auto 1fr; } .next > :last-child { grid-column: 1 / -1; } }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; padding: 18px 20px 20px; align-items: stretch; min-height: 170px; }
.week__d { display: grid; grid-template-rows: auto 1fr auto; gap: 6px; justify-items: center; text-decoration: none; }
.week__bar { width: 100%; max-width: 44px; height: auto; min-height: 96px; border-radius: 10px; background: var(--bg-2); position: relative; overflow: hidden; }
.week__bar i { position: absolute; left: 0; right: 0; bottom: 0; height: var(--h); border-radius: 10px; background: var(--accent); transform-origin: bottom; animation: grow 700ms var(--ease-out) both; animation-delay: calc(var(--i) * 50ms); }
.week__d.is-full .week__bar i { background: color-mix(in srgb, var(--accent) 55%, var(--ink)); }
@keyframes grow { from { transform: scaleY(0); } }
.week__n { font-weight: 650; font-variant-numeric: tabular-nums; font-size: 14px; }
.week__l { font-size: 12px; color: var(--muted); text-transform: capitalize; }
.week__d.is-today .week__l { color: var(--accent-text); font-weight: 700; }
.timeline { position: relative; }
.cash-row { display: flex; align-items: center; gap: 12px; padding: 10px 20px; }

/* ---------- Agenda ---------- */
.agenda-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.agenda-bar__date { font-family: var(--font-brand); font-size: 20px; font-weight: 600; letter-spacing: -0.01em; margin: 0 6px; min-width: 0; }
.daylist { display: grid; gap: 22px; }
.daylist__h { display: flex; align-items: baseline; gap: 10px; margin: 0 4px 8px; }
.daylist__h b { font-size: 15px; display: inline-block; }
.daylist__h.is-today b { color: var(--accent-text); }
.cal-grid { overflow: auto; max-height: calc(100dvh - 230px); border-radius: var(--r); background: var(--panel); box-shadow: 0 0 0 1px var(--line), var(--sh-1); }
.cal-cols { display: grid; min-width: 100%; position: relative; }
.cal-colhead { position: sticky; top: 0; z-index: 3; height: 52px; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 13.5px; font-weight: 600; background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); padding: 0 6px; }
.cal-colhead.is-today { color: var(--accent-text); }
.cal-col { border-left: 1px solid var(--line); min-width: 0; }
.cal-times { position: sticky; left: 0; z-index: 4; background: var(--panel); }
.cal-time { height: 60px; font-size: 11.5px; color: var(--faint); text-align: right; padding-right: 8px; transform: translateY(-8px); font-variant-numeric: tabular-nums; }
.cal-hour { height: 0; border-top: 1px solid var(--line); }
.cal-closed { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(135deg, transparent 0 6px, var(--hover) 6px 7px); background-color: color-mix(in srgb, var(--bg) 60%, transparent); }
.cal-now { position: absolute; left: -1px; right: 0; height: 2px; background: var(--accent); z-index: 2; }
.cal-now::before { content: ""; position: absolute; left: -4px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.cal-slot-hover { position: absolute; left: 4px; right: 4px; height: 26px; border-radius: 7px; background: var(--accent-soft); color: var(--accent-text); font-size: 12px; font-weight: 650; display: flex; align-items: center; padding: 0 8px; opacity: 0; pointer-events: none; transition: opacity 120ms ease; z-index: 1; }
.ev { position: absolute; left: 3px; right: 3px; border-radius: 9px; padding: 6px 8px; overflow: hidden; cursor: pointer; z-index: 2; background: color-mix(in srgb, var(--c) 16%, var(--panel)); box-shadow: inset 3px 0 0 var(--c), 0 0 0 1px color-mix(in srgb, var(--c) 26%, transparent); transition: transform 160ms var(--ease-out), box-shadow 160ms ease; }
@media (hover: hover) and (pointer: fine) { .ev:hover { transform: translateY(-1px); box-shadow: inset 3px 0 0 var(--c), 0 0 0 1px color-mix(in srgb, var(--c) 40%, transparent), var(--sh-2); z-index: 3; } }
.ev--pending { background: var(--panel); box-shadow: inset 0 0 0 1.5px var(--c); border: 1.5px dashed transparent; }
.ev--completed { opacity: .75; }
.ev--noshow { opacity: .55; text-decoration: line-through; }
.ev--block { --c: var(--faint); background: repeating-linear-gradient(135deg, var(--bg-2) 0 6px, var(--panel) 6px 12px); box-shadow: inset 0 0 0 1px var(--line-2); }
.ev__t { font-size: 12.5px; font-weight: 650; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev__s { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 14px; height: 14px; border-radius: 5px; }
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-radius: var(--r); overflow: hidden; background: var(--line); gap: 1px; box-shadow: 0 0 0 1px var(--line), var(--sh-1); }
.month__h { background: var(--panel-2); padding: 10px; font-size: 12px; font-weight: 650; color: var(--muted); text-transform: capitalize; text-align: center; }
.month__d { background: var(--panel); min-height: 118px; padding: 8px; display: flex; flex-direction: column; gap: 4px; cursor: pointer; transition: background-color 140ms ease; min-width: 0; }
@media (hover: hover) and (pointer: fine) { .month__d:hover { background: var(--panel-2); } }
.month__d.is-out { background: var(--bg-2); }
.month__d.is-out .month__n { color: var(--faint); }
.month__n { font-size: 13px; font-weight: 650; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; font-variant-numeric: tabular-nums; }
.month__d.is-today .month__n { background: var(--accent); color: var(--accent-ink); }
.month__ev { font-size: 11.5px; padding: 2px 6px; border-radius: 6px; background: color-mix(in srgb, var(--c, var(--accent)) 14%, var(--panel)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.month__ev--block { background: var(--bg-2); color: var(--muted); }
.month__more { font-size: 11.5px; color: var(--muted); font-weight: 600; padding-left: 4px; }
@media (max-width: 760px) { .month__d { min-height: 64px; padding: 4px; } .month__ev { display: none; } .month__d.has-ev .month__n::after { content: ""; display: block; } .month__dots { display: flex !important; } }
.month__dots { display: none; gap: 3px; justify-content: center; }
.month__dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--c, var(--accent)); }

/* Cita y cobro */
.appt-head { display: grid; gap: 4px; padding: 18px 20px; border-radius: var(--r); background: linear-gradient(130deg, color-mix(in srgb, var(--c, var(--accent)) 14%, var(--panel)), var(--panel)); box-shadow: 0 0 0 1px var(--line); }
.appt-head__t { font-family: var(--font-brand); font-size: 22px; font-weight: 600; letter-spacing: -0.015em; }
.status-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.status-btn { height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; font-size: 13.5px; box-shadow: inset 0 0 0 1px var(--line-2); transition: background-color 140ms ease, box-shadow 140ms ease, color 140ms ease, transform 140ms var(--ease-out); }
.status-btn:active { transform: scale(0.97); }
.status-btn.is-on { background: var(--ink); color: var(--bg); box-shadow: none; }
@media (hover: hover) and (pointer: fine) { .status-btn:not(.is-on):hover { background: var(--hover); } }
.money-big { font-family: var(--font-brand); font-size: 38px; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1; }
.paybox { display: grid; gap: 16px; padding: 20px; border-radius: var(--r); background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); }
.methods { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.method { height: 64px; border-radius: 12px; display: grid; place-items: center; align-content: center; gap: 4px; font-size: 13px; font-weight: 600; box-shadow: inset 0 0 0 1px var(--line-2); background: var(--panel); transition: box-shadow 140ms ease, background-color 140ms ease, transform 140ms var(--ease-out); }
.method:active { transform: scale(0.97); }
.method .ic { width: 20px; height: 20px; color: var(--muted); }
.method.is-on { box-shadow: inset 0 0 0 2px var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.method.is-on .ic { color: var(--accent-text); }
.sumline { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; padding: 4px 0; }
.sumline--total { font-size: 17px; font-weight: 700; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }
.svc-pick { display: grid; gap: 6px; }
.svc-opt { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); text-align: left; transition: box-shadow 140ms ease, background-color 140ms ease; }
.svc-opt.is-on { box-shadow: inset 0 0 0 1.5px var(--accent); background: var(--accent-soft); }
.svc-opt__tick { width: 22px; height: 22px; border-radius: 7px; box-shadow: inset 0 0 0 1.5px var(--line-2); display: grid; place-items: center; flex: none; transition: background-color 140ms ease; }
.svc-opt__tick .ic { width: 14px; height: 14px; opacity: 0; transition: opacity 140ms ease; }
.svc-opt.is-on .svc-opt__tick { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.svc-opt.is-on .svc-opt__tick .ic { opacity: 1; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 6px; }
.slot { height: 38px; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line-2); font-weight: 600; font-size: 13.5px; font-variant-numeric: tabular-nums; transition: background-color 140ms ease, box-shadow 140ms ease; }
.slot.is-on { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
@media (hover: hover) and (pointer: fine) { .slot:not(.is-on):hover { background: var(--hover); } }
.sugg { position: absolute; z-index: 10; left: 0; right: 0; top: calc(100% + 6px); background: var(--panel); border-radius: 14px; box-shadow: var(--sh-3), 0 0 0 1px var(--line); padding: 6px; max-height: 300px; overflow-y: auto; }
.sugg .li { padding: 8px 10px; min-height: 52px; border-radius: 10px; }

/* Ficha de clienta */
.profile { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; }
.profile__name { font-family: var(--font-brand); font-size: 24px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
.ministats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-radius: var(--r); box-shadow: 0 0 0 1px var(--line); overflow: hidden; }
.ministats > div { padding: 14px 16px; display: grid; gap: 2px; }
.ministats > div + div { border-left: 1px solid var(--line); }
.ministats b { font-size: 19px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.ministats span { font-size: 12.5px; color: var(--muted); }
@media (max-width: 560px) { .ministats { grid-template-columns: repeat(2, 1fr); } .ministats > div:nth-child(3) { border-left: 0; } .ministats > div:nth-child(n+3) { border-top: 1px solid var(--line); } }
.meter { height: 8px; border-radius: 8px; background: var(--bg-2); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 8px; background: var(--c, var(--accent)); width: var(--w); transform-origin: left; animation: growX 800ms var(--ease-out) both; }
@keyframes growX { from { transform: scaleX(0); } }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; position: relative; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { height: 44px; padding: 0 14px; font-weight: 600; font-size: 14px; color: var(--muted); white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; transition: color 140ms ease; }
.tabs button.is-on { color: var(--ink); }
.tabs__ink { position: absolute; bottom: -1px; left: 0; height: 2px; border-radius: 2px; background: var(--accent); transition: transform 280ms var(--ease-out), width 280ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .tabs button:hover { color: var(--ink); } }

/* ---------- Ajustes ---------- */
.settings { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 32px; align-items: start; }
.settings__nav { position: sticky; top: calc(var(--top) + 12px); display: grid; gap: 2px; }
.settings__nav a { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 7px 12px; border-radius: 9px; font-size: 14px; line-height: 1.3; color: var(--muted); text-decoration: none; transition: background-color 140ms ease, color 140ms ease; }
.settings__nav a .ic { width: 16px; height: 16px; flex: none; }
.settings__nav a.is-on { background: var(--panel); color: var(--ink); font-weight: 600; box-shadow: var(--sh-1), 0 0 0 1px var(--line); }
@media (hover: hover) and (pointer: fine) { .settings__nav a:not(.is-on):hover { background: var(--hover); color: var(--ink); } }
.settings__main { display: grid; gap: var(--gap); min-width: 0; }
.settings__main > .card { scroll-margin-top: calc(var(--top) + 16px); }
@media (max-width: 1100px) { .settings { grid-template-columns: minmax(0, 1fr); } .settings__nav { position: static; display: flex; overflow-x: auto; scrollbar-width: none; gap: 6px; } .settings__nav a { flex: none; white-space: nowrap; box-shadow: inset 0 0 0 1px var(--line); } }
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.theme { border-radius: 14px; padding: 8px; box-shadow: inset 0 0 0 1px var(--line); text-align: left; display: grid; gap: 8px; background: var(--panel); transition: box-shadow 160ms ease, transform 160ms var(--ease-out); }
.theme:active { transform: scale(0.98); }
.theme.is-on { box-shadow: inset 0 0 0 2px var(--accent), var(--sh-2); }
.theme__sw { display: grid; grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 30px 30px; gap: 3px; border-radius: 9px; overflow: hidden; }
.theme__sw span:first-child { grid-row: span 2; }
.theme__n { display: flex; align-items: center; justify-content: space-between; font-size: 13.5px; font-weight: 600; padding: 0 4px 2px; }
.theme__n .ic { width: 16px; height: 16px; color: var(--accent-text); }
.opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.opt { display: grid; gap: 8px; justify-items: center; align-content: center; padding: 14px 10px; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line); background: var(--panel); text-align: center; font-size: 13px; font-weight: 600; min-height: 104px; transition: box-shadow 160ms ease, background-color 160ms ease, transform 140ms var(--ease-out); }
.opt:active { transform: scale(0.97); }
.opt.is-on { box-shadow: inset 0 0 0 2px var(--accent); background: var(--accent-soft); }
.opt small { font-weight: 500; color: var(--muted); font-size: 12px; line-height: 1.3; }
.opt__demo { height: 40px; display: grid; place-items: center; width: 100%; }
.opt:has(.opt__demo) { align-content: start; padding-top: 18px; }
.shape-i { width: 24px; height: 34px; background: var(--accent); }
.preview-wrap { position: sticky; top: calc(var(--top) + 12px); display: grid; gap: 10px; }
.preview { position: relative; border-radius: 18px; overflow: hidden; background: var(--panel); box-shadow: var(--sh-3), 0 0 0 1px var(--line); }
.preview iframe { display: block; border: 0; width: 100%; height: calc(100dvh - var(--top) - 120px); background: #fff; }
.preview--mobile { width: 390px; margin-inline: auto; border-radius: 34px; padding: 10px; background: #111; }
.preview--mobile iframe { border-radius: 26px; height: min(780px, calc(100dvh - var(--top) - 140px)); }
.preview__bar { display: flex; align-items: center; gap: 8px; }
.sortlist > [data-key] { background: var(--panel); }
.handle { width: 30px; height: 36px; display: grid; place-items: center; color: var(--faint); cursor: grab; flex: none; touch-action: none; border-radius: 8px; }
.handle:active { cursor: grabbing; }
@media (hover: hover) and (pointer: fine) { .handle:hover { color: var(--ink); background: var(--hover); } }
.is-dragging { z-index: 100; box-shadow: var(--sh-3), 0 0 0 1px var(--line-2) !important; border-radius: var(--r-sm); background: var(--panel); transform-origin: center; }
.drop-ph { border-radius: var(--r-sm); background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px dashed var(--accent); }
.is-hidden-row { opacity: .55; }
.dropzone { display: grid; justify-items: center; gap: 8px; padding: 34px 20px; border-radius: var(--r); background: var(--panel); box-shadow: inset 0 0 0 1.5px var(--line-2); text-align: center; cursor: pointer; transition: background-color 160ms ease, box-shadow 160ms ease; }
.dropzone > .ic { width: 28px; height: 28px; color: var(--accent-text); }
.dropzone.is-over { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.gal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.gal-item { position: relative; border-radius: 14px; overflow: hidden; background: var(--panel); box-shadow: 0 0 0 1px var(--line), var(--sh-1); display: flex; flex-direction: column; transition: transform 200ms var(--ease-out), box-shadow 200ms ease; }
@media (hover: hover) and (pointer: fine) { .gal-item:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px var(--line-2), var(--sh-2); } }
.gal-item img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; background: var(--bg-2); }
.gal-item.is-hidden img { opacity: .4; }
.gal-item__t { font-size: 13.5px; font-weight: 600; padding: 10px 12px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gal-item__bar { display: flex; align-items: center; padding: 4px 6px 6px; }
.gal-item__flags { position: absolute; top: 8px; left: 8px; right: 8px; display: flex; gap: 4px; flex-wrap: wrap; }
.gal-item__flags .badge { backdrop-filter: blur(8px); background: color-mix(in srgb, var(--panel) 82%, transparent); }
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
@media (max-width: 900px) { .editor { grid-template-columns: minmax(0, 1fr); } }
.editor__stage { position: relative; display: grid; place-items: center; background: repeating-conic-gradient(var(--bg-2) 0 25%, var(--panel) 0 50%) 0 0 / 20px 20px; border-radius: 14px; min-height: 320px; overflow: hidden; touch-action: none; }
.editor__stage canvas { max-width: 100%; }
.editor__crop { position: absolute; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .45), inset 0 0 0 2px #fff; cursor: move; }
.editor__h { position: absolute; width: 18px; height: 18px; background: #fff; border-radius: 50%; box-shadow: 0 1px 4px rgba(0, 0, 0, .4); }
.editor__h[data-h=nw] { left: -9px; top: -9px; cursor: nwse-resize; } .editor__h[data-h=ne] { right: -9px; top: -9px; cursor: nesw-resize; }
.editor__h[data-h=sw] { left: -9px; bottom: -9px; cursor: nesw-resize; } .editor__h[data-h=se] { right: -9px; bottom: -9px; cursor: nwse-resize; }
.queue { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.queue img { width: 58px; height: 58px; object-fit: cover; border-radius: 10px; cursor: pointer; opacity: .55; flex: none; transition: opacity 140ms ease, box-shadow 140ms ease; }
.queue img.is-on { opacity: 1; box-shadow: 0 0 0 2px var(--accent); }
.queue img.is-done { opacity: .9; box-shadow: 0 0 0 2px var(--ok); }
.posgrid { display: grid; grid-template-columns: repeat(3, 34px); gap: 4px; }
.posgrid button { height: 34px; border-radius: 8px; box-shadow: inset 0 0 0 1px var(--line-2); position: relative; }
.posgrid button::after { content: ""; position: absolute; inset: 12px; border-radius: 50%; background: var(--line-2); }
.posgrid button.is-on { box-shadow: inset 0 0 0 2px var(--accent); }
.posgrid button.is-on::after { background: var(--accent); }
.sched { display: grid; }
.sched-day { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 14px; align-items: start; padding: 12px 20px; }
.sched-day + .sched-day { border-top: 1px solid var(--line); }
.sched-day__name { display: flex; align-items: center; gap: 12px; height: var(--ctl-sm); text-transform: capitalize; font-weight: 600; cursor: pointer; }
.sched-ivs { display: grid; gap: 8px; }
.sched-iv { display: flex; align-items: center; gap: 8px; }
.sched-iv .input { width: 118px; }
@media (max-width: 640px) { .sched-day { grid-template-columns: minmax(0, 1fr); gap: 8px; } }
.contrast { display: flex; gap: 6px; flex-wrap: wrap; }
.banner-prev { border-radius: 12px; padding: 12px 16px; display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 14px; font-weight: 400; text-align: center; flex-wrap: wrap; }
.banner-prev code { padding: 3px 8px; border-radius: 6px; border: 1px dashed currentColor; font-size: 12.5px; }
.coupon { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; padding: 16px 18px; position: relative; }
.coupon__code { white-space: nowrap; font: 700 15px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; padding: 10px 12px; border-radius: 10px; border: 1.5px dashed var(--accent); color: var(--accent-text); background: var(--accent-soft); }
.coupon.is-off { opacity: .6; }
.stock { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; font-variant-numeric: tabular-nums; }
.stock--low { color: var(--danger); }
.stock--ok { color: var(--ok); }
.qty { display: inline-flex; align-items: center; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line-2); overflow: hidden; }
.qty button { width: 32px; height: 32px; display: grid; place-items: center; color: var(--muted); }
.qty button .ic { width: 15px; height: 15px; }
.qty span { min-width: 44px; text-align: center; font-weight: 650; font-variant-numeric: tabular-nums; font-size: 14px; }
@media (hover: hover) and (pointer: fine) { .qty button:hover { background: var(--hover); color: var(--ink); } }
.stars { display: inline-flex; gap: 1px; color: #e2a52a; }
.stars .ic { width: 15px; height: 15px; }
.stars .is-off { color: var(--line-2); }
.review-card { padding: 18px 20px; display: grid; gap: 10px; }
.review-card__photo { width: 96px; height: 96px; border-radius: 12px; object-fit: cover; cursor: zoom-in; }
.review-card blockquote { margin: 0; font-size: 14.5px; line-height: 1.55; }
.review-card__reply { padding: 12px 14px; border-radius: 12px; background: var(--bg-2); font-size: 14px; }

/* ---------- Estadísticas ---------- */
.chart { position: relative; padding: 16px 20px 18px; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart .grid-l { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--faint); font-size: 11px; font-family: var(--font-ui); }
.chart .bar { fill: var(--accent); transition: opacity 140ms ease; }
.chart .bar--2 { fill: color-mix(in srgb, var(--accent) 35%, var(--panel)); }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart .area { fill: url(#gArea); }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart-tip { position: absolute; pointer-events: none; padding: 8px 10px; border-radius: 10px; background: var(--ink); color: var(--bg); font-size: 12.5px; line-height: 1.4; white-space: nowrap; box-shadow: var(--sh-3); transform: translate(-50%, calc(-100% - 10px)); opacity: 0; transition: opacity 120ms ease; z-index: 5; }
.chart-tip.is-on { opacity: 1; }
.chart-tip b { font-variant-numeric: tabular-nums; }
.statbars { display: grid; gap: 12px; padding: 18px 20px; }
.statbar { display: grid; grid-template-columns: minmax(90px, 160px) 1fr auto; gap: 12px; align-items: center; font-size: 13.5px; }
.statbar__l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.statbar__v { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; min-width: 64px; }
.heat { display: grid; grid-template-columns: 40px repeat(var(--cols), minmax(0, 1fr)); gap: 3px; padding: 18px 20px; font-size: 11px; color: var(--faint); }
.heat i { aspect-ratio: 1.4; border-radius: 4px; background: color-mix(in srgb, var(--accent) calc(var(--v) * 100%), var(--bg-2)); }
.heat span { display: grid; place-items: center; text-transform: capitalize; }
.donut { display: grid; grid-template-columns: 140px 1fr; gap: 20px; align-items: center; padding: 18px 20px; }
.donut svg { width: 140px; height: 140px; transform: rotate(-90deg); }
.legend-list { display: grid; gap: 8px; font-size: 13.5px; }
.legend-list li { display: grid; grid-template-columns: 12px 1fr auto; gap: 10px; align-items: center; }
.legend-list i { width: 10px; height: 10px; border-radius: 3px; }

/* ---------- Móvil ---------- */
@media (max-width: 1024px) {
  .shell, :root[data-side="mini"] .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: min(300px, 86vw); transform: translateX(-104%); transition: transform 320ms var(--ease-drawer); box-shadow: var(--sh-3); z-index: 50; border-radius: 0 22px 22px 0; }
  .side.is-open { transform: none; }
  :root[data-side="mini"] .side .nav__label, :root[data-side="mini"] .side__brand > div, :root[data-side="mini"] .nav a span, :root[data-side="mini"] .nav button span { opacity: 1; pointer-events: auto; }
  :root[data-side="mini"] .nav a, :root[data-side="mini"] .nav button { justify-content: flex-start; padding: 0 12px; }
  .top__menu { display: inline-grid; }
  .side__collapse { display: none !important; }
  .savebar, :root[data-side] .savebar { margin-left: 0 !important; }
}
@media (max-width: 760px) {
  :root { --top: 58px; }
  .top { padding: 0 10px 0 6px; gap: 6px; }
  .top__title { font-size: 18px; }
  .top__search { width: 40px; padding: 0; justify-content: center; box-shadow: none; background: none; }
  .top__search span, .top__search kbd { display: none; }
  .top__new span { display: none; }
  .top__new { width: var(--ctl-sm); padding: 0; }
  .content { padding: 4px 14px 120px; }
  .card__head { padding: 10px 10px 10px 16px; min-height: 54px; }
  .card__body { padding: 16px; }
  .li { padding: 12px 16px; }
  .toggle { padding: 13px 16px; }
  .tabbar { position: fixed; z-index: 40; left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; height: 66px; padding: 0 6px; border-radius: 22px; background: var(--glass); backdrop-filter: blur(20px) saturate(1.6); -webkit-backdrop-filter: blur(20px) saturate(1.6); box-shadow: var(--sh-3), inset 0 0 0 1px var(--glass-line), 0 0 0 1px var(--line); }
  .tabbar a, .tabbar > button { display: grid; justify-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); text-decoration: none; padding: 6px 0; position: relative; transition: color 140ms ease; }
  .tabbar .ic { width: 22px; height: 22px; }
  .tabbar .is-on { color: var(--accent-text); }
  .tabbar__new > span:first-child { width: 48px; height: 48px; border-radius: 16px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--accent) 90%, transparent); transition: transform 140ms var(--ease-out); }
  .tabbar__new:active > span:first-child { transform: scale(.94); }
  .tabbar__new > span:last-child { display: none; }
  .tabbar .count { position: absolute; top: 0; left: calc(50% + 6px); min-width: 17px; height: 17px; font-size: 10px; }
  .toasts { left: 16px; right: 16px; bottom: calc(86px + env(safe-area-inset-bottom)); width: auto; }
  .savebar { bottom: calc(86px + env(safe-area-inset-bottom)); width: calc(100vw - 20px); justify-content: space-between; }
  .savebar > span { overflow: hidden; text-overflow: ellipsis; }
  .page-head { margin-bottom: 14px; }
  .table-wrap--cards .table thead { display: none; }
  .table-wrap--cards .table, .table-wrap--cards .table tbody { display: block; }
  .table-wrap--cards .table tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .table-wrap--cards .table td { display: block; padding: 0; border: 0; min-width: 0; }
  .table-wrap--cards .table td:first-child { grid-column: 1 / -1; }
  .table-wrap--cards .table td[data-l] { text-align: left; font-size: 13.5px; font-weight: 600; }
  .table-wrap--cards .table td[data-l]::before { content: attr(data-l); display: block; color: var(--faint); font-size: 11.5px; font-weight: 500; margin-bottom: 1px; }
  .table-wrap--cards .table td.hide-m { display: none; }
  .notif { top: auto; bottom: 0; right: 0; left: 0; width: 100vw; max-height: 80dvh; border-radius: 22px 22px 0 0; transform-origin: bottom center; transform: translateY(20px); }
  .cmd { margin-top: 10px; }
  .methods { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .preview--mobile { width: 100%; padding: 0; background: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}
:root[data-motion="off"] *, :root[data-motion="off"] *::before, :root[data-motion="off"] *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }

.agenda-bar__date::first-letter, .daylist__h b::first-letter, .appt-head__t::first-letter { text-transform: uppercase; }
.top__title, .top__crumb { transition: opacity 200ms ease, transform 240ms var(--ease-out); }
.has-head .top:not(.is-past) .top__title { opacity: 0; transform: translateY(6px); }
.has-head .top:not(.is-past) .top__crumb { opacity: 0; }
.card:has(.sortlist), .card:has(> .lines), .card:has(> div > .lines) { overflow: clip; }
.search .input.input--sm, .search .input { padding-left: 38px; }
.side__foot { display: flex; gap: 4px; flex: none; }
.side__foot a, .side__foot button { flex: 1; justify-content: center; padding: 0; }
.side__foot a span, .side__foot button span { display: none; }
:root[data-side="mini"] .side__foot { flex-direction: column; }
.nav a, .nav button { height: 36px; }
.nav__pill { height: 36px; }
.nav__group { padding: 6px 0; }
@media (max-width: 760px) { .alert { flex-wrap: wrap; } .alert > p { flex: 1 1 calc(100% - 40px); } .alert .btn { margin-left: 32px; } }
.daylist { grid-template-columns: minmax(0, 1fr); } .daylist > section { min-width: 0; }
@media (max-width: 760px) { .agenda-bar__list .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; } .agenda-bar__list .search { max-width: none; flex-basis: 100%; } .agenda-bar .seg button .ic { display: none; } .agenda-bar .seg button { padding: 0 11px; } .agenda-bar__date { font-size: 17px; } }
.grid--ap { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); align-items: start; }
@media (max-width: 1100px) { .grid--ap { grid-template-columns: minmax(0, 1fr); } .preview-wrap { position: static; } .preview iframe { height: 70vh; } }
.card__head .card__title { flex-wrap: wrap; row-gap: 0; }
.card__sub--long { flex-basis: 100%; }
.agenda-bar__list { gap: 8px; flex: 0 1 auto; min-width: 0; }
.agenda-bar__list .search { flex: 0 1 220px; width: 220px; min-width: 150px; }
.agenda-bar__tools { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 760px) { .agenda-bar__tools { margin-left: 0; width: 100%; justify-content: space-between; } .agenda-bar__list { flex: 1 1 100%; } .agenda-bar__list .search { width: auto; flex: 1 1 100%; } .agenda-bar__tools > :first-child:not(.seg) { flex: 1 1 auto; } }
.agenda-bar__list[hidden] { display: none; }

@media (max-width: 560px) {
  .li .li__end .badge--dot { font-size: 0; gap: 0; width: 22px; height: 22px; padding: 0; justify-content: center; border-radius: 50%; }
  .li .li__end .badge--dot::before { width: 8px; height: 8px; }
  .li .time { width: 48px; }
  .li { gap: 10px; }
}
.daylist__h { flex-wrap: wrap; row-gap: 2px; }
.daylist__h .small { white-space: nowrap; }
@media (max-width: 760px) {
  .chips--scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -14px; padding-inline: 14px; scroll-snap-type: x proximity; mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 24px), transparent); }
  .chips--scroll::-webkit-scrollbar { display: none; }
  .chips--scroll .chip { flex: none; scroll-snap-align: start; }
}
.field > .seg:not(.seg--block), .field > div > .seg:not(.seg--block) { justify-self: start; width: fit-content; }
@media (max-width: 760px) {
  .status-row { grid-template-columns: repeat(6, minmax(0, 1fr)) !important; }
  .status-row > * { grid-column: span 2; }
  .status-row > :nth-child(4), .status-row > :nth-child(5) { grid-column: span 3; }
  .drawer__foot { gap: 8px; padding-inline: 14px; }
  .drawer__foot .btn--quiet:not(:only-child) > span:not(.ic) { display: none; }
  .drawer__foot .btn { padding-inline: 12px; }
  .drawer__foot .btn--accent { flex: 1 1 auto; justify-content: center; }
}

/* ---------- Caja (v3) ---------- */
.alert--warn { background: var(--warn-bg); }
.cashp { margin-bottom: var(--gap); }
.cashp__closed { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 18px 20px; }
.cashp__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.cashp__state { display: flex; align-items: center; gap: 14px; min-width: 0; flex: 1 1 280px; }
.cashp__lock { width: 44px; height: 44px; flex: none; border-radius: 14px; display: grid; place-items: center; background: var(--bg-2); color: var(--muted); }
.cashp__lock .ic { width: 20px; height: 20px; }
.cashp__lock.is-open { background: var(--ok-bg); color: var(--ok); }
.cashp__t { font-weight: 650; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.cashp__acts { gap: 8px; justify-content: flex-end; }
.cashp__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cashp__stat { padding: 18px 20px; display: grid; gap: 4px; align-content: start; min-height: 104px; }
.cashp__stat + .cashp__stat { box-shadow: inset 1px 0 0 var(--line); }
.cashp__stat.is-main { background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 9%, transparent), transparent 70%); }
.cashp__l { font-size: 12.5px; color: var(--muted); font-weight: 550; }
.cashp__v { font-family: var(--font-brand); font-size: 26px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.15; }
.cashp__s { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.cashp__moves { border-top: 1px solid var(--line); }
.cashp__moves > summary { display: flex; align-items: center; gap: 8px; padding: 14px 20px; cursor: pointer; font-weight: 600; font-size: 14px; list-style: none; }
.cashp__moves > summary::-webkit-details-marker { display: none; }
.cashp__moves > summary .ic { width: 16px; height: 16px; color: var(--muted); }
.cashp__mv { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.cashp__mv .ic { width: 16px; height: 16px; }
.cashp__mv--in { background: var(--ok-bg); color: var(--ok); }
.cashp__mv--out { background: var(--danger-bg); color: var(--danger); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 50%, transparent); animation: livePulse 2s ease-out infinite; flex: none; }
@keyframes livePulse { 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.cashc__sum { justify-items: center; text-align: center; gap: 10px; }
.cashc__diff { display: grid; justify-items: center; gap: 6px; min-height: 48px; }
.cashc__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.cashc__row { display: grid; grid-template-columns: 76px 12px minmax(0, 1fr) 76px; gap: 8px; align-items: center; }
.cashc__row .input { text-align: right; }
.cashc__row > :last-child { text-align: right; }
.cashc__den { height: 32px; display: grid; place-items: center; border-radius: 8px; font-weight: 650; font-size: 13px; font-variant-numeric: tabular-nums; }
.cashc__den.is-note { background: color-mix(in srgb, var(--accent) 10%, var(--panel)); color: var(--accent-text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent); }
.cashc__den.is-coin { background: var(--bg-2); border-radius: 999px; }
.zr { display: grid; gap: 18px; max-width: 560px; margin-inline: auto; padding: 24px; border-radius: var(--r); background: var(--panel); box-shadow: var(--sh-2), inset 0 0 0 1px var(--line); }
.zr__head { text-align: center; display: grid; gap: 2px; padding-bottom: 14px; border-bottom: 1px dashed var(--line-2); }
.zr__brand { font-family: var(--font-brand); font-weight: 700; font-size: 20px; }
.zr__line { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 7px 0; border-bottom: 1px dotted var(--line); font-size: 14px; }
.zr__line.is-total { font-weight: 700; border-bottom: 1px solid var(--line-2); }
.zr .subhead { margin-bottom: 4px; }
@media (max-width: 1100px) { .cashp__grid { grid-template-columns: 1fr 1fr; } .cashp__stat:nth-child(3) { box-shadow: inset 0 1px 0 var(--line); } .cashp__stat:nth-child(4) { box-shadow: inset 1px 0 0 var(--line), inset 0 1px 0 var(--line); } }
@media (max-width: 760px) {
  .cashp__acts { width: 100%; justify-content: stretch; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cashp__acts .btn { padding-inline: 8px; }
  .cashp__acts .btn { justify-content: center; }
  .cashp__acts .btn--accent { grid-column: 1 / -1; }
  .cashp__acts .btn--quiet { display: none; }
  .cashc__grid { grid-template-columns: 1fr; }
  .cashp__v { font-size: 22px; }
}

/* ---------- Accesos y permisos (v3) ---------- */
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: var(--gap); }
.person-card { display: grid; gap: 14px; padding: 18px; cursor: pointer; text-align: left; transition: transform 200ms var(--ease-out), box-shadow 200ms ease; }
@media (hover: hover) and (pointer: fine) { .person-card:hover { transform: translateY(-2px); box-shadow: var(--sh-2); } }
.person-card:active { transform: scale(0.99); }
.person-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.person-card.is-paused { opacity: .62; }
.person-card__top { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px 14px; align-items: center; }
.person-card__top .avatar--lg { width: 52px; height: 52px; font-size: 18px; grid-row: span 2; }
.person-card__top .badge { grid-column: 2; justify-self: start; }
.person-card__name { font-weight: 650; font-size: 16px; }
.person-card__meter { height: 6px; border-radius: 6px; background: var(--bg-2); overflow: hidden; }
.person-card__meter span { display: block; height: 100%; width: var(--w); border-radius: inherit; background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 60%, var(--panel)), var(--accent)); transform-origin: left; animation: growX 700ms var(--ease-out) both; }
.person-card__foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 22px; }
.person-card__foot .dot { display: inline-block; vertical-align: middle; }
.person-card--add { place-items: center; align-content: center; min-height: 168px; color: var(--muted); font-weight: 600; background: transparent; box-shadow: inset 0 0 0 1.5px var(--line-2); border: 0; gap: 8px; }
.person-card--add .ic { width: 26px; height: 26px; }
@media (hover: hover) and (pointer: fine) { .person-card--add:hover { color: var(--accent-text); background: var(--accent-soft); } }
.preset-table { display: grid; }
.preset-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 20px; }
.preset-row + .preset-row { border-top: 1px solid var(--line); }
.preset-row__ic, .preset__ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); flex: none; }
.preset-row__ic .ic, .preset__ic .ic { width: 19px; height: 19px; }
.access-layout { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 24px; align-items: start; }
.preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.preset { position: relative; display: grid; grid-template-rows: auto auto 1fr; gap: 6px; padding: 14px; border-radius: var(--r-sm); background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); text-align: left; transition: box-shadow 160ms ease, transform 160ms var(--ease-out), background-color 160ms ease; min-height: 128px; }
.preset:active:not(:disabled) { transform: scale(0.98); }
@media (hover: hover) and (pointer: fine) { .preset:hover:not(:disabled) { box-shadow: inset 0 0 0 1px var(--line-2), var(--sh-1); } }
.preset.is-on { box-shadow: inset 0 0 0 2px var(--accent), 0 8px 24px -14px color-mix(in srgb, var(--accent) 70%, transparent); background: color-mix(in srgb, var(--accent) 5%, var(--panel)); }
.preset:disabled { opacity: .45; cursor: not-allowed; }
.preset__t { font-weight: 650; font-size: 14px; }
.preset__d { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.preset__check { position: absolute; top: 12px; right: 12px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); opacity: 0; transform: scale(.8); transition: opacity 160ms ease, transform 200ms var(--ease-out); }
.preset__check .ic { width: 13px; height: 13px; }
.preset.is-on .preset__check { opacity: 1; transform: none; }
.preset--custom { grid-column: 1 / -1; min-height: 0; grid-template-columns: auto 1fr; grid-template-rows: auto; align-items: center; column-gap: 12px; }
.preset--custom .preset__d { grid-column: 2; }
.preset--custom .preset__ic { grid-row: span 2; }
.perm-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 12px; align-items: start; }
.perm-groups.is-admin .toggle { opacity: .6; }
.perm-group { overflow: hidden; }
.perm-group__head { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 10px 10px 10px 18px; border-bottom: 1px solid var(--line); background: var(--panel-2); min-height: 50px; }
.perm-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.perm-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 999px; font-size: 12.5px; font-weight: 550; color: var(--faint); background: var(--bg-2); }
.perm-chip .ic { width: 13px; height: 13px; }
.perm-chip.is-on { color: var(--ok); background: var(--ok-bg); }
@media (max-width: 1100px) { .access-layout { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .preset-grid { grid-template-columns: 1fr 1fr; } .preset { min-height: 116px; padding: 12px; } }

/* ---------- Portada y diseños (v3) ---------- */
.versions { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: var(--gap); padding: 18px; }
.version { display: grid; grid-template-rows: auto 1fr; border-radius: var(--r-sm); background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; transition: box-shadow 200ms ease, transform 200ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .version:hover { box-shadow: inset 0 0 0 1px var(--line-2), var(--sh-2); transform: translateY(-2px); } }
.version.is-on { box-shadow: inset 0 0 0 2px var(--accent), 0 12px 30px -18px color-mix(in srgb, var(--accent) 80%, transparent); }
.version__shot { position: relative; display: block; width: 100%; aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg-2); border: 0; padding: 0; cursor: zoom-in; }
.version__frame { position: absolute; left: 0; top: 0; width: 1280px; height: 800px; transform-origin: 0 0; transform: scale(var(--k, .22)); pointer-events: none; }
.version__frame iframe { width: 1280px; height: 800px; border: 0; background: #fff; }
.version__zoom { position: absolute; right: 10px; bottom: 10px; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: var(--ink); opacity: 0; transform: translateY(4px); transition: opacity 160ms ease, transform 200ms var(--ease-out); box-shadow: var(--sh-1); }
.version__zoom .ic { width: 16px; height: 16px; }
.version__shot:hover .version__zoom, .version__shot:focus-visible .version__zoom { opacity: 1; transform: none; }
.version__body { display: grid; grid-template-rows: auto 1fr auto; gap: 8px; padding: 14px 16px 16px; }
.version__name { font-weight: 650; font-size: 15.5px; }
.version__desc { font-size: 13px; color: var(--muted); line-height: 1.45; }
.version__acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
.version__acts .btn { justify-content: center; }
.version__acts .btn:only-child { grid-column: 1 / -1; }
.preview--big iframe { height: calc(100dvh - 230px); }
.opts--layouts { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.opts--layouts .opt__demo { height: auto; }
.ht { position: relative; display: block; width: 100%; aspect-ratio: 16 / 10; border-radius: 8px; background: var(--bg-2); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.ht__b { position: absolute; display: block; border-radius: 3px; }
.ht__card { background: var(--panel); box-shadow: 0 0 0 1px var(--line); border-radius: 5px; }
.ht__img { background: color-mix(in srgb, var(--accent) 38%, var(--panel)); border-radius: 5px; }
.ht__nail { border-radius: 50% 50% 46% 46% / 64% 64% 36% 36%; box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 70%, transparent); }
.ht__dark { background: #151213; border-radius: 0; }
.ht__glass { background: color-mix(in srgb, var(--panel) 70%, transparent); box-shadow: 0 0 0 1px var(--line); border-radius: 5px; }
.ht__t { height: 7%; background: var(--ink); opacity: .82; border-radius: 3px; }
.ht__t--s { height: 4%; opacity: .35; }
.ht__t--xl { height: 13%; }
.ht__t--thin { opacity: .55; }
.ht__t--light { background: #f2eded; }
.ht__t--diff { background: var(--ink); mix-blend-mode: multiply; opacity: .9; }
.ht__btn { width: 18%; height: 8%; background: var(--accent); border-radius: 99px; }
.opt.is-on .ht { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent); }
.md { display: grid; place-items: center; width: 52px; height: 36px; overflow: hidden; font-family: var(--font-brand); font-size: 22px; font-weight: 700; }
.md b { display: block; }
.opt:hover .md--rise b, .opt.is-on .md--rise b { animation: mdRise 1.2s var(--ease-out) infinite; }
.opt:hover .md--mask b, .opt.is-on .md--mask b { animation: mdMask 1.4s var(--ease-in-out) infinite; }
.opt:hover .md--blur b, .opt.is-on .md--blur b { animation: mdBlur 1.4s ease infinite; }
@keyframes mdRise { 0% { transform: translateY(110%); } 45%, 100% { transform: none; } }
@keyframes mdMask { 0% { clip-path: inset(0 100% 0 0); } 55%, 100% { clip-path: inset(0 0 0 0); } }
@keyframes mdBlur { 0% { filter: blur(6px); opacity: 0; } 55%, 100% { filter: none; opacity: 1; } }
.rb { display: grid; place-items: center; height: 28px; padding: 0 10px; border-radius: 6px; font-size: 11.5px; font-weight: 650; white-space: nowrap; }
.rb--accent { background: var(--accent); color: var(--accent-ink); }
.rb--ink { background: var(--ink); color: var(--panel); }
.rb--tint { background: var(--accent-soft); color: var(--accent-text); }
.rb--outline { box-shadow: inset 0 1px 0 var(--line-2), inset 0 -1px 0 var(--line-2); }
@media (prefers-reduced-motion: reduce) { .md b { animation: none !important; } }
@media (min-width: 1280px) { .versions { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.version__shot--own { display: grid; place-items: center; cursor: pointer; background: var(--accent-soft); color: var(--accent-text); text-decoration: none; }
.version__shot--own > .ic { width: 30px; height: 30px; position: relative; z-index: 1; }
.version__palette { position: absolute; inset: 22% 18%; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; opacity: .35; }
.version__palette i { border-radius: 10px; }
.opts--layouts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.opts--layouts > :last-child:nth-child(odd) { grid-column: 1 / -1; }
.opts--layouts > :last-child:nth-child(odd) .ht { max-width: calc(50% - 5px); justify-self: center; }
.opts--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.opts--4 .opt { min-height: 96px; padding: 12px 6px; }
@media (min-width: 1500px) { .opts--layouts { grid-template-columns: repeat(3, minmax(0, 1fr)); } .opts--layouts > :last-child:nth-child(odd) { grid-column: auto; } .opts--layouts > :last-child:nth-child(3n+1) { grid-column: 2; } .opts--layouts > :last-child .ht { max-width: none; } }
@media (max-width: 560px) { .opts--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Marca de agua con logo (v3) ---------- */
.wm-logo { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 14px; align-items: center; padding: 12px; border-radius: var(--r-sm); background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); }
.wm-logo[hidden] { display: none; }
.wm-logo__pic { width: 88px; height: 88px; border-radius: 12px; display: grid; place-items: center; overflow: hidden; color: var(--faint);
  background-color: #fff; background-image: linear-gradient(45deg, #e9e5e4 25%, transparent 25%), linear-gradient(-45deg, #e9e5e4 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e9e5e4 75%), linear-gradient(-45deg, transparent 75%, #e9e5e4 75%);
  background-size: 14px 14px; background-position: 0 0, 0 7px, 7px -7px, -7px 0; box-shadow: inset 0 0 0 1px var(--line); }
:root[data-mode="dark"] .wm-logo__pic { background-color: #2a2628; background-image: linear-gradient(45deg, #343033 25%, transparent 25%), linear-gradient(-45deg, #343033 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #343033 75%), linear-gradient(-45deg, transparent 75%, #343033 75%); }
.wm-logo__pic img { max-width: 78%; max-height: 78%; object-fit: contain; }
.wm-logo__pic .ic { width: 26px; height: 26px; }
.wm-logo__info { min-width: 0; display: grid; gap: 2px; }
.wm-grid { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px; align-items: start; }
.field[hidden] { display: none; }

/* ---------- Fichar (v3) ---------- */
.punch { display: inline-flex; align-items: center; gap: 7px; height: var(--ctl-sm, 36px); padding: 0 12px 0 10px; border-radius: 999px; font-weight: 650; font-size: 13.5px; font-variant-numeric: tabular-nums; color: var(--ink); background: var(--panel); box-shadow: inset 0 0 0 1px var(--line-2); transition: background-color 200ms ease, box-shadow 200ms ease, transform 140ms var(--ease-out); }
.punch:active { transform: scale(0.96); }
.punch .ic { width: 16px; height: 16px; }
.punch__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); transition: background-color 200ms ease; }
.punch.is-on { background: var(--ok-bg); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ok) 35%, transparent); color: var(--ok); }
.punch.is-on .punch__dot { background: var(--ok); animation: livePulse 2s ease-out infinite; }
@media (max-width: 760px) { .punch { padding: 0 10px; } .punch .ic { display: none; } }
@media (max-width: 760px) { .cashp__acts--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }


/* ==========================================================================
   v4 · Seguridad
   ========================================================================== */
.label-cap { font-size: 11.5px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); margin-top: 6px; }
.label-cap:first-child { margin-top: 0; }
.toggles--flat { border-radius: var(--r-sm); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.toggles--flat .toggle { padding: 12px 16px; min-height: 58px; }
.sechead { display: flex; align-items: center; gap: 18px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.sechead__t { font-family: var(--font-brand); font-size: 19px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; margin-bottom: 2px; }
.secring { --p: 0; flex: none; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--ok) calc(var(--p) * 360deg), var(--line) 0); transition: background 600ms var(--ease-out); position: relative; }
.secring::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--panel); }
.secring__n { position: relative; font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.checks { display: grid; }
.checks__row { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; align-items: start; padding: 13px 20px; }
.checks__row + .checks__row { border-top: 1px solid var(--line); }
.checks__ic { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-bg); color: var(--ok); }
.checks__ic .ic { width: 15px; height: 15px; }
.checks__row.is-warn .checks__ic { background: var(--warn-bg); color: var(--warn); }
.checks__row.is-bad .checks__ic { background: var(--danger-bg); color: var(--danger); }
.checks__row.is-info .checks__ic { background: var(--info-bg); color: var(--info); }
.checks__row .small { margin-top: 2px; line-height: 1.45; }
.seckpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.seckpi { padding: 14px; border-radius: var(--r-sm); background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); display: grid; gap: 6px; }
.seckpi__l { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); line-height: 1.25; min-height: 32px; }
.seckpi__l .ic { width: 15px; height: 15px; flex: none; }
.seckpi__v { font-family: var(--font-brand); font-size: 26px; font-weight: 650; line-height: 1; letter-spacing: -0.02em; }
.seckpi.is-hot { background: var(--danger-bg); box-shadow: none; }
.seckpi.is-hot .seckpi__v { color: var(--danger); }
.secbars { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 5px; align-items: end; height: 72px; }
.secbars__b { height: 100%; display: flex; align-items: flex-end; }
.secbars__b i { display: block; width: 100%; height: max(3px, calc(var(--h) * 100%)); border-radius: 5px 5px 2px 2px; background: color-mix(in srgb, var(--accent) 70%, transparent); transform-origin: bottom; animation: barUp 600ms var(--ease-out) both; }
.secbars__b:nth-child(n+8) i { animation-delay: 60ms; }
@keyframes barUp { from { transform: scaleY(0); } }
.secbars__x { display: flex; justify-content: space-between; margin-top: 6px; }
.secstate { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; align-items: start; padding: 14px; border-radius: var(--r-sm); background: var(--ok-bg); }
.secstate.is-warn { background: var(--warn-bg); }
.secstate__ic { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--panel); color: var(--ok); box-shadow: var(--sh-1); }
.secstate.is-warn .secstate__ic { color: var(--warn); }
.devlist { display: grid; }
.devlist__row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 12px 20px; min-height: 64px; }
.devlist__row + .devlist__row { border-top: 1px solid var(--line); }
.devlist__ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); }
.devlist__ic .ic { width: 18px; height: 18px; }
.devlist__ic--bad { background: var(--danger-bg); color: var(--danger); box-shadow: none; }
.hereline { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--r-sm); background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); }
.hereline__ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--panel); color: var(--accent-text); box-shadow: var(--sh-1); }
.chip__x { width: 20px; height: 20px; margin-right: -6px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.chip__x .ic { width: 12px; height: 12px; }
@media (hover: hover) and (pointer: fine) { .chip__x:hover { background: var(--hover); color: var(--ink); } }
.seclog { display: grid; max-height: 520px; overflow-y: auto; overscroll-behavior: contain; }
.seclog__row { display: grid; grid-template-columns: 32px minmax(0, 1fr) 36px; gap: 12px; align-items: center; padding: 10px 20px; }
.seclog__row + .seclog__row { border-top: 1px solid var(--line); }
.seclog__ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--panel-2); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.seclog__ic .ic { width: 16px; height: 16px; }
.seclog__ic.is-hot { background: var(--danger-bg); color: var(--danger); box-shadow: none; }
.seclog__row p:first-child { font-size: 14px; font-weight: 550; }
/* Verificación en dos pasos */
.modal--wide { width: min(560px, calc(100vw - 32px)); }
.steps-list { display: grid; gap: 16px; counter-reset: st; margin-top: 8px; }
.steps-list > li { position: relative; padding-left: 40px; display: grid; gap: 6px; counter-increment: st; }
.steps-list > li::before { content: counter(st); position: absolute; left: 0; top: -2px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 650; font-size: 13.5px; background: var(--accent-soft); color: var(--accent-text); }
.steps-list > li > span { color: var(--muted); font-size: 14px; }
.twofa-qr { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.twofa-qr__img { padding: 8px; border-radius: 14px; background: #fff; box-shadow: var(--sh-2), inset 0 0 0 1px var(--line); line-height: 0; }
.twofa-qr__img svg { width: 168px; height: 168px; }
.twofa-qr__alt { display: grid; gap: 8px; min-width: 0; flex: 1 1 180px; }
.keychip { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 8px 12px; border-radius: 10px; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line-2); text-align: left; }
.keychip code { font: 600 13.5px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; word-break: break-all; }
.keychip .ic { width: 15px; height: 15px; flex: none; color: var(--muted); }
.otp { width: 100%; height: 58px; border-radius: 14px; border: 0; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line-2); text-align: center; font: 650 28px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .42em; padding-left: .42em; font-variant-numeric: tabular-nums; transition: box-shadow 160ms ease; }
.otp::placeholder { color: var(--line-2); }
.otp:focus { outline: none; box-shadow: inset 0 0 0 2px var(--accent); }
.otp--text { letter-spacing: .12em; padding-left: .12em; font-size: 22px; }
.twofa-badge { justify-self: center; width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.twofa-badge .ic { width: 26px; height: 26px; }
.check-line { display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--muted); cursor: pointer; }
.check-line input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; counter-reset: cd; }
.codes li { padding: 10px 12px; border-radius: 10px; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); text-align: center; }
.codes code { font: 650 16px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .06em; }
@media (max-width: 760px) {
  .seckpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .devlist__row { grid-template-columns: 36px minmax(0, 1fr) auto; padding: 12px 16px; }
  .devlist__row > .badge { grid-column: 2; justify-self: start; grid-row: 2; }
  .hereline { grid-template-columns: 36px minmax(0, 1fr); }
  .hereline > :last-child { grid-column: 1 / -1; justify-self: stretch; }
  .hereline > .btn { width: 100%; justify-content: center; }
  .checks__row, .seclog__row { padding-inline: 16px; }
  .sechead { padding: 16px; }
  .twofa-qr { justify-content: center; }
}

/* ==========================================================================
   v5
   ========================================================================== */
.item__n { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--bg-2); font-size: 12px; font-weight: 650; color: var(--muted); margin-right: 8px; font-variant-numeric: tabular-nums; }
.item__bar .strong:not(.muted) { color: var(--ink); }
.item.is-off { opacity: .62; }
.idea { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; align-items: start; padding: 14px; border-radius: var(--r-sm); box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; transition: box-shadow 160ms ease, background-color 160ms ease; }
.idea:has(input:checked) { box-shadow: inset 0 0 0 2px var(--accent); background: var(--accent-soft); }
.idea input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); }
.idea .badge { margin-top: 8px; }
.idea > div { display: grid; gap: 3px; justify-items: start; }
.secshort { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 640px) { .secshort { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.secshort__b { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px; border-radius: var(--r-sm); background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; font-weight: 550; text-align: left; transition: box-shadow 160ms ease, background-color 160ms ease, transform 140ms var(--ease-out); }
.secshort__b .ic { width: 17px; height: 17px; color: var(--accent-text); flex: none; }
.secshort__b span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.secshort__b small { font-size: 11.5px; color: var(--faint); font-weight: 500; }
.secshort__b.is-off .ic { color: var(--faint); }
@media (hover: hover) and (pointer: fine) { .secshort__b:hover { box-shadow: inset 0 0 0 1px var(--line-2), var(--sh-1); background: var(--panel); } }
.secshort__b:active { transform: scale(.98); }

/* Avisos en la capa superior (popover): siempre por encima de fichas y ventanas */
.toasts[popover] { margin: 0; padding: 0; border: 0; background: transparent; overflow: visible; color: inherit; top: auto; left: auto; height: auto; max-height: none; }
@media (max-width: 760px) { .toasts[popover] { left: 16px; right: 16px; bottom: calc(86px + env(safe-area-inset-bottom)); } }

.pop[popover] { margin: 0; border: 0; inset: auto; right: auto; bottom: auto; overflow: visible; height: auto; width: auto; }
.pop--menu[popover] { padding: 6px; }
.appt-color__dot { width: 14px; height: 20px; border-radius: 50% 50% 46% 46% / 62% 62% 38% 38%; flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); display: inline-block; vertical-align: -4px; }
.appt-color { align-items: center; }
.appt-color-line { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
/* Retoque de fotos */
.adj > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 14px 20px; cursor: pointer; font-weight: 600; }
.adj > summary::-webkit-details-marker { display: none; }
.adj > summary .ic { width: 18px; height: 18px; color: var(--accent-text); }
.adj > summary small { margin-left: auto; color: var(--faint); font-weight: 500; font-size: 12.5px; }
.adj[open] > summary { border-bottom: 1px solid var(--line); }
.adj-presets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.adj-preset { display: grid; gap: 6px; justify-items: center; padding: 6px 4px 8px; border-radius: 10px; font-size: 12px; font-weight: 550; box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow 160ms ease; }
.adj-preset.is-on { box-shadow: inset 0 0 0 2px var(--accent); }
.adj-preset__sw { width: 100%; aspect-ratio: 1; border-radius: 7px; overflow: hidden; background: var(--bg-2); display: block; }
.adj-preset__sw img { width: 100%; height: 100%; object-fit: cover; }
.adj-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.adj-grid > :last-child:nth-child(odd) { grid-column: 1 / -1; }
@media (max-width: 760px) { .adj-presets { grid-template-columns: repeat(4, minmax(0, 1fr)); } .adj-grid { grid-template-columns: 1fr; } }
.svc-seo > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 14px 20px; cursor: pointer; font-weight: 600; }
.svc-seo > summary::-webkit-details-marker { display: none; }
.svc-seo > summary .ic { width: 18px; height: 18px; color: var(--accent-text); }
.svc-seo > summary small { margin-left: auto; color: var(--faint); font-weight: 500; font-size: 12.5px; max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.svc-seo[open] > summary { border-bottom: 1px solid var(--line); }
/* Carta de colores (panel) */
.colgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.colgrid__row { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px; border-radius: var(--r-sm); box-shadow: inset 0 0 0 1px var(--line); background: var(--panel); transition: opacity 200ms ease; }
.colgrid__row.is-off { opacity: .55; }
.colgrid__pick { position: relative; display: grid; place-items: center; height: 76px; border-radius: 12px; background: var(--bg-2); cursor: pointer; }
.colgrid__sw { width: 34px; height: 50px; border-radius: 50% 50% 46% 46% / 62% 62% 38% 38%; background: var(--polish); box-shadow: inset 3px -5px 0 rgba(255,255,255,.22), 0 4px 10px -4px rgba(0,0,0,.35); }
.colgrid__sw[data-finish="mate"] { box-shadow: 0 4px 10px -4px rgba(0,0,0,.35); }
.colgrid__sw[data-finish="metalizado"], .colgrid__sw[data-finish="cromo"] { background: linear-gradient(150deg, #fff 0%, var(--polish) 30%, color-mix(in srgb, var(--polish) 60%, #000) 55%, #fff 70%, var(--polish) 100%); }
.colgrid__sw[data-finish="purpurina"] { background: radial-gradient(circle, rgba(255,255,255,.9) 0 .8px, transparent 1.4px) 0 0 / 5px 5px, var(--polish); }
.colgrid__sw[data-finish="francesa"] { background: linear-gradient(to top, #f0d4cc 0 64%, var(--polish) 64%); }
.colgrid__hex { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.colgrid__fields { display: grid; gap: 6px; min-width: 0; }
.colgrid__two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; }
.colgrid__tools { display: grid; gap: 2px; }
/* Fidelidad */
.stamps { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 8px; }
.stamp { aspect-ratio: .74; border-radius: 50% 50% 46% 46% / 62% 62% 38% 38%; display: grid; place-items: center; font-size: 12px; font-weight: 650; color: var(--faint); box-shadow: inset 0 0 0 1.5px var(--line-2); background: var(--bg-2); max-height: 60px; justify-self: center; width: 100%; max-width: 44px; }
.stamp.is-on { background: var(--accent); color: var(--accent-ink, #fff); box-shadow: inset 3px -5px 0 rgba(255,255,255,.2); }
.stamp .ic { width: 16px; height: 16px; }
/* Google */
.serp { padding: 18px 20px; border-radius: var(--r-sm); background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); display: grid; gap: 4px; font-family: Arial, ui-sans-serif, sans-serif; }
.serp__site { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.serp__fav { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); }
.serp__fav .ic { width: 15px; height: 15px; }
.serp__name { font-size: 14px; color: var(--ink); line-height: 1.2; }
.serp__url { font-size: 12px; color: var(--muted); line-height: 1.3; }
.serp__t { font-size: 20px; line-height: 1.3; color: #1a0dab; }
:root[data-mode="dark"] .serp__t { color: #99c3ff; }
.serp__d { font-size: 14px; line-height: 1.58; color: var(--muted); }
.serp__meter { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 12px; font-family: var(--font-ui); }
.serp__m { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.serp__m i { height: 6px; border-radius: 6px; background: var(--line); position: relative; overflow: hidden; }
.serp__m i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--warn); border-radius: inherit; transition: width 300ms var(--ease-out); }
.serp__m.is-ok i::after { background: var(--ok); } .serp__m.is-bad i::after { background: var(--danger); }
.svclinks { display: grid; gap: 6px; }
.svclinks li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line); }
.svclinks a { flex: 1; min-width: 0; display: grid; text-decoration: none; }
.svclinks a span { font-weight: 550; font-size: 14px; }
.svclinks a small { color: var(--faint); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Puesta en marcha */
.launch__bar { height: 6px; margin: 0 20px; border-radius: 6px; background: var(--line); overflow: hidden; }
.launch__bar i { display: block; height: 100%; width: var(--w); background: var(--accent); border-radius: inherit; }
.launch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; padding: 10px 8px 8px; }
.launch__i { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; min-height: 64px; }
.launch__ic { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.launch__ic .ic { width: 15px; height: 15px; }
.launch__i.is-ok .launch__ic { background: var(--ok-bg); color: var(--ok); }
.launch__i.is-ok .strong { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-2); }
@media (max-width: 760px) { .launch { grid-template-columns: 1fr; } .serp__meter { grid-template-columns: 1fr; } .colgrid { grid-template-columns: 1fr; } }
/* Simetría: tarjetas de una misma fila con el mismo alto y contenido vacío centrado */
.grid--eq { align-items: stretch; }
.grid--eq > .card { display: flex; flex-direction: column; min-width: 0; }
.grid--eq > .card > :not(.card__head):not(.card__foot) { flex: 1 1 auto; }
.grid--eq > .card > .empty { align-content: center; }
.grid--eq > .card > :not(.card__head) > .empty:only-child { height: 100%; align-content: center; }
.grid--eq .statbars { align-content: start; }
.ht__arch { border-radius: 999px 999px 6px 6px; }
.ht__shade { background: linear-gradient(0deg, rgba(0,0,0,.6), transparent 70%); border-radius: 0; }
.ht__bar { height: 3px; background: #fff; border-radius: 2px; }
/* "A tu medida" ocupa la fila entera: así las versiones quedan siempre en filas completas */
.versions > .version--own { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(180px, 280px) minmax(0, 1fr); align-items: center; }
.versions > .version--own .version__shot--own { height: 100%; min-height: 140px; aspect-ratio: auto; }
@media (max-width: 640px) { .versions > .version--own { grid-template-columns: 1fr; } .versions > .version--own .version__shot--own { min-height: 120px; } }
.cashfix__info { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.cashfix__info > div { padding: 14px 16px; border-radius: var(--r-sm); background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); display: grid; gap: 4px; align-content: start; }
.cashfix__info .strong { font-size: 18px; }
/* ¿A quién afecta el cierre? */
.whoopts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.whoopt { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; align-items: start; padding: 14px; border-radius: var(--r-sm); box-shadow: inset 0 0 0 1px var(--line); text-align: left; transition: box-shadow 160ms ease, background-color 160ms ease; }
.whoopt b { display: block; font-size: 14.5px; }
.whoopt small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.4; margin-top: 2px; }
.whoopt__ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--bg-2); color: var(--muted); }
.whoopt.is-on { box-shadow: inset 0 0 0 2px var(--accent); background: var(--accent-soft); }
.whoopt.is-on .whoopt__ic { background: var(--accent); color: #fff; }
.whochips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.whochip { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line-2); font-size: 14px; font-weight: 550; }
.whochip__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.whochip .ic { width: 15px; height: 15px; display: none; }
.whochip.is-on { box-shadow: inset 0 0 0 2px var(--c); background: color-mix(in srgb, var(--c) 10%, var(--panel)); }
.whochip.is-on .ic { display: block; color: var(--c); }
@media (max-width: 640px) { .whoopts { grid-template-columns: 1fr; } }

/* ---------- v6 · Tarjetas regalo ---------- */
.giftrow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 14px 16px; }
.giftrow.is-off { opacity: .62; }
.giftrow__sw { display: grid; place-items: center; width: 64px; aspect-ratio: 1.586; border-radius: 9px; background: var(--gsw, var(--accent)); color: var(--gsw-ink, #fff); font-weight: 700; font-size: .8125rem; font-variant-numeric: tabular-nums; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.giftrow__sw .icon { width: 18px; height: 18px; }
.giftrow__end { gap: 8px; justify-content: flex-end; }
.gsw--lacado { --gsw: linear-gradient(140deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #000)); }
.gsw--nude { --gsw: linear-gradient(150deg, #f3e3d6, #e2c4b0); --gsw-ink: #3b2a22; }
.gsw--noche { --gsw: radial-gradient(120% 90% at 100% 0%, #2b2440, #14121c 60%); --gsw-ink: #e8c77d; }
.gsw--confeti { --gsw: radial-gradient(circle at 18% 24%, #ff8fab 0 3px, transparent 4px), radial-gradient(circle at 82% 70%, #06d6a0 0 3px, transparent 4px), radial-gradient(circle at 70% 18%, #ffd166 0 3px, transparent 4px), #fff6ef; --gsw-ink: #2a1d1a; }
.gsw--floral { --gsw: linear-gradient(160deg, #eef3e8, #d7e4cf); --gsw-ink: #24331f; }
@media (max-width: 640px) { .giftrow { grid-template-columns: auto minmax(0, 1fr); } .giftrow__end { grid-column: 1 / -1; justify-content: space-between; } }

/* ---------- v7 · Gastos ---------- */
.receipt__add { display: flex; align-items: center; gap: 14px; width: 100%; padding: 16px; border-radius: var(--r, 14px); border: 1.5px dashed var(--line-2, var(--line)); background: transparent; text-align: left; color: inherit; transition: border-color 160ms ease, background-color 160ms ease; }
.receipt__add:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 5%, transparent); }
.receipt__add > .icon { width: 26px; height: 26px; color: var(--accent); flex: none; }
.receipt__add span { display: grid; gap: 2px; } .receipt__add small { color: var(--muted); }
.receipt__has { display: flex; align-items: center; gap: 14px; }
.receipt__img { width: 72px; height: 96px; border-radius: 10px; overflow: hidden; flex: none; box-shadow: 0 0 0 1px var(--line); }
.receipt__img img { width: 100%; height: 100%; object-fit: cover; }
.cashleft { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--r, 14px); background: var(--surface-2, var(--bg)); }
.cashleft > .icon { color: var(--muted); }
.cashleft > div:last-child { text-align: right; }
.cashleft.is-bad { background: color-mix(in srgb, #d92d20 10%, var(--bg)); }
.cashleft.is-bad > div:last-child .strong { color: #b42318; }
.catbar { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: .875rem; }
.catbar__l { display: flex; align-items: center; gap: 8px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.catbar__l .icon { width: 16px; height: 16px; color: var(--muted); flex: none; }
.catbar__m { height: 8px; border-radius: 99px; background: var(--surface-2, var(--line)); overflow: hidden; }
.catbar__m i { display: block; height: 100%; width: var(--w); border-radius: inherit; background: var(--accent); }
.catbar__v { min-width: 72px; text-align: right; }
.exp__ic, .exp__pic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--surface-2, var(--bg)); overflow: hidden; }
.exp__ic .icon { width: 18px; height: 18px; color: var(--muted); }
.exp__pic img { width: 100%; height: 100%; object-fit: cover; }
.paystate { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--r, 14px); background: var(--surface-2, var(--bg)); }
.paystate > .icon { width: 26px; height: 26px; color: var(--muted); flex: none; }
.paystate.is-on > .icon { color: #17794a; }
.codebox { display: block; padding: 10px 12px; border-radius: 10px; background: var(--surface-2, var(--bg)); font-size: .8125rem; overflow-wrap: anywhere; }

/* ---------- v8 · Actualización suave de la pantalla ---------- */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 200ms; animation-timing-function: cubic-bezier(0.23, 1, 0.32, 1); }
.content--next { contain: layout paint; }
/* Fichas con columna lateral: la tarjeta de la derecha empieza a la altura del texto de la primera etiqueta,
   no por encima de él (las etiquetas tienen aire arriba; las tarjetas, borde). */
.drawer__body :is(.grid--side, .grid--2):has(> :first-child:not(.card):not(:has(> .card:first-child)):not(:has(> .stack:first-child > .card:first-child))) > :last-child { margin-top: 5px; }
/* Ningún bloque puede empujar la pantalla hacia los lados (textos largos en una línea, listas…) */
.stack > *, .grid > *, .settings__main > *, .form-grid > * { min-width: 0; }
.field > *, .card__body > *, .item > * { min-width: 0; }
@media (max-width: 640px) {
  .coupon { grid-template-columns: minmax(0, 1fr) auto; gap: 10px 12px; }
  .coupon > :nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .coupon__code { justify-self: start; }
  .coupon__end { grid-column: 2; grid-row: 1; }
}
/* Los botones nunca se encogen por debajo de su texto (era lo que hacía que se "pisaran" con lo de al lado) */
.btn { flex-shrink: 0; }
.card__foot { flex-wrap: wrap; }
.card__foot > p, .card__foot > span:not(.grow) { flex: 1 1 220px; min-width: 0; }
@media (max-width: 560px) {
  .savebar { left: 12px; right: 12px; width: auto; justify-content: space-between; gap: 8px; padding: 8px 8px 8px 14px; transform: translateY(140%); bottom: calc(84px + env(safe-area-inset-bottom)); }
  .savebar.is-on { transform: none; }
  .savebar > span { font-size: 13px; line-height: 1.25; min-width: 0; }
}
.card__head { flex-wrap: wrap; row-gap: 8px; }
.card__head > .card__title { min-width: 0; }
@media (max-width: 640px) {
  /* En listas, el nombre siempre se ve: las etiquetas bajan a otra línea si no caben */
  .li { flex-wrap: wrap; row-gap: 8px; }
  .li__main { flex: 1 1 140px; }
  .li__end { flex-wrap: wrap; justify-content: flex-end; max-width: 100%; }
  .li__end:has(.badge ~ .badge) { flex: 1 1 100%; justify-content: flex-start; padding-left: 0; }
}
@media (max-width: 560px) { .savebar > span { flex: 1 1 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .savebar > .row { flex: none; } .savebar .btn--quiet { padding: 0 10px; } }
.aphotos { display: flex; flex-wrap: wrap; gap: 10px; }
.aphotos__item { position: relative; width: 84px; height: 104px; border-radius: 12px; overflow: hidden; box-shadow: 0 0 0 1px var(--line); }
.aphotos__item img { width: 100%; height: 100%; object-fit: cover; }
.aphotos__del { position: absolute; top: 4px; right: 4px; background: color-mix(in srgb, var(--panel) 88%, transparent); }
.aphotos__add { width: 84px; height: 104px; border-radius: 12px; display: grid; place-content: center; justify-items: center; gap: 6px; border: 1.5px dashed var(--line-2, var(--line)); color: var(--muted); font-size: 12px; font-weight: 600; transition: border-color 160ms ease, color 160ms ease, transform 160ms var(--ease-out); }
.aphotos__add .ic { width: 20px; height: 20px; }
.aphotos__add:hover { border-color: var(--accent); color: var(--accent-text); }
.aphotos__add:active { transform: scale(.97); }
.repeatpic { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; background: var(--accent-soft); }
.repeatpic img { width: 56px; height: 70px; border-radius: 10px; object-fit: cover; display: block; }
.albumgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.albumgrid a { display: grid; gap: 4px; font-size: 12px; color: var(--muted); text-decoration: none; }
.albumgrid img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 12px; box-shadow: 0 0 0 1px var(--line); }
