/* Phi Review · hoja de estilo única del panel (autocontenida). Sube ?v= en header.php al cambiarla. */
:root {
  --ink: #17181c; --ink-soft: #6b7280; --line: #e7e7ea; --bg: #f6f6f7; --surface: #ffffff;
  --accent: #4f46e5;
  --accent-soft: color-mix(in srgb, var(--accent) 12%, white);
  --accent-2: color-mix(in srgb, var(--accent) 62%, #7c3aed);
  --danger: #d33d3d; --danger-soft: #fbeaea; --success: #1a8f5e;
  --good: #16a34a; --good-soft: #e7f8ee; --warn: #d97706; --warn-soft: #fff4de; --bad: #dc2626; --bad-soft: #fde8e8;
  --stat-1: #4f46e5; --stat-1-soft: #eef0fe;
  --stat-2: #d946ef; --stat-2-soft: #fbe8fc;
  --stat-3: #16a34a; --stat-3-soft: #e7f8ee;
  --stat-4: #ea580c; --stat-4-soft: #fdece1;
  --star: #f5b301; --off: #d9dce2;
  --radius: 14px; --pt-shadow: 0 1px 2px rgba(16,24,40,.04), 0 6px 18px rgba(16,24,40,.05); --shadow: var(--pt-shadow);
}
html[data-theme="dark"] {
  --ink: #eceef1; --ink-soft: #9a9ca6; --line: #2b2d33; --bg: #101114; --surface: #18191d;
  --accent-soft: color-mix(in srgb, var(--accent) 22%, var(--surface));
  --danger: #ef5350; --danger-soft: color-mix(in srgb, var(--danger) 18%, var(--surface)); --success: #34c07c;
  --good: #34c77b; --good-soft: color-mix(in srgb, #34c77b 16%, var(--surface));
  --warn: #f5a524; --warn-soft: color-mix(in srgb, #f5a524 16%, var(--surface));
  --bad: #f06060; --bad-soft: color-mix(in srgb, #f06060 17%, var(--surface));
  --stat-1-soft: color-mix(in srgb, var(--stat-1) 20%, var(--surface)); --stat-2-soft: color-mix(in srgb, var(--stat-2) 20%, var(--surface));
  --stat-3-soft: color-mix(in srgb, var(--stat-3) 20%, var(--surface)); --stat-4-soft: color-mix(in srgb, var(--stat-4) 20%, var(--surface));
  --off: #353943; --pt-shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 22px rgba(0,0,0,.28); --shadow: var(--pt-shadow);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; margin: 0; background: var(--bg); color: var(--ink); display: flex; min-height: 100vh; font-size: 14.5px; line-height: 1.45; }
a { color: var(--accent); }
.muted { color: var(--ink-soft); }
.tnum { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------ Barra lateral */
aside { width: 224px; flex-shrink: 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 24px 16px 100px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 9%, var(--surface)) 0, var(--surface) 280px); border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 10px 20px; font-weight: 700; font-size: 15px; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: #0c0d11; display: flex; align-items: center; justify-content: center; }
.ctx { margin: 0 10px 18px; padding: 10px 12px; background: var(--bg); border-radius: 10px; font-size: 12px; color: var(--ink-soft); line-height: 1.4; }
.ctx label { display: block; font-size: 11px; font-weight: 600; margin: 0 0 3px; color: var(--ink-soft); }
.ctx select { width: 100%; border: 0; background: transparent; color: var(--ink); font: inherit; font-weight: 700; font-size: 14px; padding: 2px 0; cursor: pointer; outline: none; }
.ctx-own { display: flex; align-items: center; gap: 10px; }
.ctx-own img { width: 36px; height: 36px; border-radius: 9px; object-fit: contain; background: #fff; border: 1px solid var(--line); padding: 3px; }
.ctx-own small { display: block; font-size: 11px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.ctx-own strong { font-size: 14px; line-height: 1.2; display: block; }
nav.side a { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-size: 14px; padding: 9px 10px; border-radius: 9px; margin-bottom: 2px; }
nav.side a svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--ink-soft); }
nav.side a:hover { background: var(--bg); }
nav.side a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
nav.side a.active svg { color: var(--accent); }
.nav-section-label { font-size: 11px; font-weight: 800; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .06em; padding: 14px 10px 6px; }
.side-footer { position: fixed; bottom: 0; left: 0; width: 224px; padding: 12px 16px 20px; background: var(--surface); border-top: 1px solid var(--line); }
.theme-toggle { width: 100%; background: none; border: 1px solid var(--line); color: var(--ink-soft); font: inherit; font-size: 13px; padding: 9px 11px; border-radius: 10px; cursor: pointer; display: flex; align-items: center; gap: 9px; margin-bottom: 6px; }
.theme-toggle:hover { background: var(--bg); color: var(--ink); }
.theme-toggle svg, .logout svg { width: 17px; height: 17px; flex-shrink: 0; }
.logout { display: flex; align-items: center; gap: 9px; color: var(--ink-soft); font-size: 13px; text-decoration: none; padding: 8px 11px; border-radius: 10px; }
.logout:hover { color: var(--bad); }

/* ------------------------------------------------ Contenido */
main { flex: 1; min-width: 0; padding: 32px 40px 70px; max-width: 1080px; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
h2 { font-size: 16px; }
p.subtitle { color: inherit; opacity: .86; margin: 0; font-size: 14.5px; }
.hero { background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%); color: #fff; border-radius: 22px; padding: 26px 28px; margin-bottom: 22px; position: relative; overflow: hidden; box-shadow: 0 14px 34px color-mix(in srgb, var(--accent) 30%, transparent); animation: rise .5s both; }
.hero::after { content: ""; position: absolute; right: -60px; top: -80px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.22), transparent 68%); pointer-events: none; }
.hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; flex-wrap: wrap; position: relative; z-index: 1; }
.hero h1 { font-size: 26px; display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.hero h1 svg { width: 30px; height: 30px; flex-shrink: 0; }
.hero-controls { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.seg { display: inline-flex; background: rgba(255,255,255,.18); border-radius: 999px; padding: 4px; gap: 2px; backdrop-filter: blur(4px); }
.seg a { color: #fff; text-decoration: none; padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.seg a:hover { background: rgba(255,255,255,.16); }
.seg a.on { background: #fff; color: var(--accent); }
.ghost { display: inline-flex; align-items: center; gap: 7px; color: #fff; text-decoration: none; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.5); padding: 8px 15px; border-radius: 999px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; }
.ghost:hover { background: rgba(255,255,255,.26); }
.ghost svg { width: 15px; height: 15px; }

.banner { padding: 12px 16px; border-radius: 12px; font-weight: 600; font-size: 14px; margin-bottom: 16px; }
.banner-ok { background: var(--good-soft); color: var(--good); }
.banner-bad { background: var(--bad-soft); color: var(--bad); }
.banner-warn { background: var(--warn-soft); color: var(--warn); }
.banner a { color: inherit; }

/* ------------------------------------------------ Tarjetas, formularios, botones */
.card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; margin-bottom: 18px; box-shadow: var(--shadow); overflow: hidden; }
.card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2 { display: flex; align-items: center; gap: 9px; }
.card-head h2 svg { width: 19px; height: 19px; color: var(--accent); }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 4px 11px; font-size: 12.5px; font-weight: 700; }
.card-toggle-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; user-select: none; margin-bottom: 16px; }
.card-toggle-header .tl { display: flex; align-items: center; gap: 9px; }
.card-toggle-header .tl svg { width: 19px; height: 19px; color: var(--accent); }
.card-chevron { color: var(--ink-soft); display: flex; transition: transform .2s; }
.card-chevron svg { width: 18px; height: 18px; }
.card:not(.open) .card-chevron { transform: rotate(-90deg); }
.card:not(.open) > .card-toggle-header { margin-bottom: 0; }
.card:not(.open) > .card-toggle-header ~ * { display: none; }

label { display: block; font-size: 13px; font-weight: 700; margin: 0 0 6px; }
.help { color: var(--ink-soft); font-size: 12.5px; margin: -8px 0 14px; }
input[type=text], input[type=password], input[type=email], input[type=url], input[type=number], select, textarea {
  width: 100%; padding: 10px 12px; margin: 0 0 16px; border: 1px solid var(--line); border-radius: 9px; font: inherit; background: var(--surface); color: var(--ink);
}
html[data-theme="dark"] input, html[data-theme="dark"] select, html[data-theme="dark"] textarea { color: #fff; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
::placeholder { color: var(--ink-soft); opacity: .8; }
input[type=color] { width: 54px; height: 42px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); cursor: pointer; margin: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.btn, button { background: var(--accent); color: #fff; border: 0; padding: 10px 18px; border-radius: 9px; cursor: pointer; font: inherit; font-weight: 600; font-size: 14px; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; line-height: 1.2; }
.btn:hover, button:hover { opacity: .88; }
.btn svg { width: 16px; height: 16px; }
.btn-muted { background: var(--bg); color: var(--ink); border: 1px solid var(--line); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-good { background: var(--good-soft); color: var(--good); }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.switch { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; font-weight: 600; cursor: pointer; }
.switch input { appearance: none; -webkit-appearance: none; width: 40px; height: 23px; border-radius: 999px; background: var(--off); position: relative; cursor: pointer; margin: 0; flex-shrink: 0; transition: background .18s; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .18s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(17px); }
.switch input:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent); outline-offset: 2px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); background: var(--accent-soft); }
th:first-child { border-radius: 9px 0 0 9px; } th:last-child { border-radius: 0 9px 9px 0; }
.tbl-wrap { overflow-x: auto; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.pill-ok { background: var(--good-soft); color: var(--good); }
.pill-off { background: var(--bad-soft); color: var(--bad); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-grey { background: var(--bg); color: var(--ink-soft); border: 1px solid var(--line); }

/* ------------------------------------------------ KPIs */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.kpis.six { grid-template-columns: repeat(3, 1fr); }
.kpi { --c: var(--accent); position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 16px; box-shadow: var(--shadow); overflow: hidden; animation: rise .5s both; }
.kpi::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--c); }
.kpi .ic { width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--c) 14%, var(--surface)); color: var(--c); margin-bottom: 10px; }
.kpi .ic svg { width: 20px; height: 20px; }
.kpi small { display: block; color: var(--ink-soft); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.kpi b { display: block; font-size: 30px; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -.02em; margin: 3px 0 2px; }
.kpi em { font-style: normal; font-size: 12.5px; color: var(--ink-soft); }
.kpi em.up { color: var(--good); font-weight: 700; } .kpi em.down { color: var(--bad); font-weight: 700; } .kpi em.flat { color: var(--ink-soft); }
.kpi.hot { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; border-color: transparent; }
.kpi.hot::before { background: rgba(255,255,255,.4); }
.kpi.hot .ic { background: rgba(255,255,255,.2); color: #fff; }
.kpi.hot small, .kpi.hot em, .kpi.hot em.up, .kpi.hot em.down, .kpi.hot em.flat { color: rgba(255,255,255,.88); }
.kpi:nth-child(2) { animation-delay: .04s; } .kpi:nth-child(3) { animation-delay: .08s; } .kpi:nth-child(4) { animation-delay: .12s; } .kpi:nth-child(5) { animation-delay: .16s; } .kpi:nth-child(6) { animation-delay: .2s; }

.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.cols.three { grid-template-columns: repeat(3, 1fr); }
.cols .card { margin-bottom: 0; }
.cols.w21 { grid-template-columns: 2fr 1fr; }

/* ------------------------------------------------ Estrellas (ícono del rubro) */
.stars { display: inline-flex; gap: 1px; vertical-align: middle; }
.stars span { width: 17px; height: 17px; color: var(--off); display: inline-flex; }
.stars span.on { color: var(--star); }
.stars svg { width: 100%; height: 100%; }
.meter { display: flex; gap: 3px; margin: 8px 0 4px; }
.meter span { width: 30px; height: 30px; color: var(--off); position: relative; }
.meter span svg { width: 100%; height: 100%; display: block; }
.meter span.on { color: var(--star); }
.meter span.half { color: var(--off); }
.meter span.half i { position: absolute; inset: 0; color: var(--star); clip-path: inset(0 50% 0 0); }
.big-num { font-size: 46px; font-weight: 800; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------ Distribución 5 a 1 */
.dist-row { display: grid; grid-template-columns: 44px 1fr 86px; gap: 10px; align-items: center; margin-bottom: 9px; font-size: 13px; }
.dist-row .n { font-weight: 800; display: flex; align-items: center; gap: 4px; }
.dist-row .n svg { width: 14px; height: 14px; color: var(--star); }
.dist-bar { height: 12px; background: var(--bg); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.dist-bar i { display: block; height: 100%; border-radius: inherit; background: var(--c); width: var(--w); transition: width .8s cubic-bezier(.2,.8,.2,1); }
.dist-row .v { color: var(--ink-soft); text-align: right; font-variant-numeric: tabular-nums; }
.split { display: flex; height: 16px; border-radius: 999px; overflow: hidden; margin: 10px 0 8px; background: var(--bg); }
.split i { display: block; height: 100%; }
.split-legend { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-soft); gap: 8px; flex-wrap: wrap; }
.split-legend b { color: var(--ink); }

/* ------------------------------------------------ Gráfico de barras (estilo "días fuertes") */
.bars-wrap { position: relative; padding-left: 34px; margin-top: 8px; }
.guides { position: absolute; left: 0; right: 0; top: 22px; height: 150px; pointer-events: none; }
.guides div { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--line); }
.guides span { position: absolute; left: 0; top: -9px; font-size: 11px; color: var(--ink-soft); background: var(--surface); padding-right: 4px; }
.bars { position: relative; display: flex; align-items: flex-end; gap: 6px; height: 206px; padding-top: 0; }
.bar { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; cursor: default; }
.bar .val { font-size: 11px; font-weight: 800; color: var(--ink); height: 18px; line-height: 18px; font-variant-numeric: tabular-nums; }
.bar .fill { width: 100%; max-width: 38px; height: calc(var(--h) * 1.5px); min-height: 3px; border-radius: 999px 999px 6px 6px; background: repeating-linear-gradient(45deg, var(--accent) 0 4px, color-mix(in srgb, var(--accent) 45%, var(--surface)) 4px 8px); transform-origin: bottom; animation: grow .7s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i) * 25ms); }
.bar.max .fill { background: linear-gradient(180deg, var(--accent-2), var(--accent)); box-shadow: 0 6px 14px color-mix(in srgb, var(--accent) 35%, transparent); }
.bar.zero .fill { background: var(--line); height: 3px; }
.bar .lbl { height: 34px; font-size: 11px; color: var(--ink-soft); text-align: center; line-height: 1.15; padding-top: 6px; white-space: nowrap; }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.bars.dense { gap: 2px; }
.bars.dense .val { display: none; }
.ix-tip { position: fixed; display: none; z-index: 50; background: #17181c; color: #fff; font-size: 12.5px; padding: 7px 11px; border-radius: 9px; pointer-events: none; box-shadow: 0 8px 20px rgba(0,0,0,.3); white-space: nowrap; }
.chart-note { display: inline-flex; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 12.5px; padding: 4px 11px; border-radius: 999px; }

/* ------------------------------------------------ Embudo */
.funnel { display: grid; gap: 10px; }
.fstep { display: grid; grid-template-columns: 130px 1fr 128px; gap: 12px; align-items: center; font-size: 13.5px; }
.fstep .name { font-weight: 700; display: flex; align-items: center; gap: 7px; }
.fstep .name svg { width: 16px; height: 16px; color: var(--accent); }
.fbar { height: 26px; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.fbar i { display: block; height: 100%; width: var(--w); background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: inherit; transition: width .8s; opacity: var(--o, 1); }
.fstep .num { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.fstep .num small { display: block; font-weight: 600; color: var(--ink-soft); font-size: 11.5px; }

/* ------------------------------------------------ Mapa de calor día x hora */
.heat { display: grid; grid-template-columns: 38px repeat(24, 1fr); gap: 3px; font-size: 10.5px; color: var(--ink-soft); }
.heat .h { text-align: center; }
.heat .d { display: flex; align-items: center; font-weight: 700; }
.heat .c { aspect-ratio: 1; border-radius: 5px; background: color-mix(in srgb, var(--accent) calc(var(--a) * 100%), var(--bg)); border: 1px solid color-mix(in srgb, var(--line) 70%, transparent); min-width: 0; }
.heat .c.z { background: var(--bg); }

/* ------------------------------------------------ Podio y rankings */
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }
.pod { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.pod .medal { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; color: #17181c; margin-bottom: 8px; background: #cbd0d8; }
.pod:nth-child(1) { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; border-color: transparent; }
.pod:nth-child(1) .medal { background: #ffd54a; } .pod:nth-child(3) .medal { background: #e0a56a; }
.pod .pn { font-weight: 800; line-height: 1.2; margin-bottom: 4px; }
.pod .pv { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pod small { opacity: .8; }
.rank-row { display: grid; grid-template-columns: 26px 1fr 110px 54px; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.rank-row:first-of-type { border-top: 0; }
.rank-row .no { color: var(--ink-soft); font-weight: 800; }
.rank-row .rb { height: 8px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.rank-row .rb i { display: block; height: 100%; width: var(--w); background: var(--accent); border-radius: inherit; }
.rank-row .rval { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------ Palabras */
.words { display: flex; flex-wrap: wrap; gap: 8px; }
.words span { background: var(--c-soft, var(--accent-soft)); color: var(--c, var(--accent)); font-weight: 700; padding: 5px 12px; border-radius: 999px; font-size: var(--fs, 13px); }
.words span b { opacity: .7; font-weight: 600; margin-left: 4px; font-size: .85em; }

/* ------------------------------------------------ Reseñas */
.zone { margin-bottom: 20px; }
.zone-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-radius: 14px; margin-bottom: 12px; flex-wrap: wrap; }
.zone-head h2 { display: flex; align-items: center; gap: 10px; font-size: 17px; }
.zone-head h2 svg { width: 22px; height: 22px; }
.zone-head .cnt { background: rgba(255,255,255,.55); padding: 2px 11px; border-radius: 999px; font-size: 13px; margin-left: 4px; }
.zone-good .zone-head { background: var(--good-soft); color: var(--good); }
.zone-bad .zone-head { background: var(--warn-soft); color: var(--warn); }
html[data-theme="dark"] .zone-head .cnt { background: rgba(255,255,255,.12); }
.rv-grid { display: grid; gap: 12px; }
.rv { background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--rc); border-radius: 14px; padding: 16px 18px; box-shadow: var(--shadow); }
.rv.is-attended { opacity: .72; }
.rv-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.rv-badge { min-width: 38px; height: 38px; border-radius: 11px; background: var(--rc); color: #fff; font-weight: 800; font-size: 17px; display: flex; align-items: center; justify-content: center; }
.rv-who { font-weight: 700; }
.rv-when { color: var(--ink-soft); font-size: 12.5px; }
.rv-spacer { flex: 1; }
.rv-text { margin: 4px 0 10px; white-space: pre-wrap; word-break: break-word; }
.rv-text.empty { color: var(--ink-soft); font-style: italic; }
.rv-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.rv-contact { display: inline-flex; align-items: center; gap: 6px; background: var(--bg); border: 1px solid var(--line); padding: 4px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.rv-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.rv-note { display: flex; gap: 8px; flex: 1 1 260px; }
.rv-note input { margin: 0; padding: 7px 10px; font-size: 13px; }
.local-tag { font-size: 12px; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 3px 10px; border-radius: 999px; }
.empty-state { text-align: center; padding: 34px 16px; color: var(--ink-soft); background: var(--surface); border: 1px dashed var(--line); border-radius: 14px; }
.empty-state svg { width: 34px; height: 34px; opacity: .6; margin-bottom: 8px; }

/* ------------------------------------------------ Locales / cards */
.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.tcard { background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--tc, var(--accent)); border-radius: 14px; padding: 16px 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.tcard.paused { opacity: .6; }
.tcard-top { display: flex; align-items: center; gap: 12px; }
.tlogo { width: 46px; height: 46px; border-radius: 12px; background: #fff; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; color: var(--tc, var(--accent)); }
.tlogo img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.tlogo svg { width: 26px; height: 26px; }
.tname { font-weight: 800; line-height: 1.2; }
.tmeta { display: flex; gap: 14px; font-size: 12.5px; color: var(--ink-soft); flex-wrap: wrap; }
.tmeta b { color: var(--ink); }
.alerts { display: flex; gap: 6px; flex-wrap: wrap; }

/* ------------------------------------------------ Logo y paleta (importar logo) */
.dropzone { border: 2px dashed var(--line); border-radius: 16px; padding: 22px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; background: var(--bg); }
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }
.dropzone svg.big { width: 36px; height: 36px; color: var(--accent); margin-bottom: 6px; }
.dropzone p { margin: 4px 0 0; color: var(--ink-soft); font-size: 13px; }
.dropzone img { max-height: 120px; max-width: 100%; border-radius: 10px; display: none; margin: 0 auto 8px; }
.dropzone.has img { display: block; }
.dropzone.has svg.big { display: none; }
.palette { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0 6px; align-items: center; }
.swatch { width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line); cursor: pointer; padding: 0; position: relative; background: var(--sw); }
.swatch.sel { box-shadow: 0 0 0 3px var(--ink); }
.brandprev { display: flex; align-items: center; gap: 16px; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; flex-wrap: wrap; }
.mini-card { width: 118px; border-radius: 14px; padding: 12px 8px; color: #fff; text-align: center; font-weight: 800; font-size: 12px; }
.mini-card .row { display: flex; justify-content: center; gap: 2px; margin-top: 6px; }
.mini-card .row svg { width: 15px; height: 15px; }
.ico-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 8px; }
.ico-opt { position: relative; }
.ico-opt input { position: absolute; opacity: 0; }
.ico-opt span { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; font-size: 12.5px; font-weight: 600; background: var(--surface); line-height: 1.2; }
.ico-opt span svg { width: 26px; height: 26px; flex-shrink: 0; color: var(--ic, var(--accent)); }
.ico-opt input:checked + span { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }

/* ------------------------------------------------ QR */
.qr-layout { display: grid; grid-template-columns: 340px 1fr; gap: 18px; align-items: start; }
.qr-box { background: #fff; border-radius: 20px; padding: 18px; text-align: center; box-shadow: var(--shadow); border: 1px solid var(--line); }
.qr-box canvas, .qr-box svg { width: 100%; height: auto; display: block; }
.qr-box .url { margin-top: 10px; font-size: 12.5px; color: #475467; word-break: break-all; }
.urlbox { display: flex; gap: 8px; align-items: center; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 8px 8px 8px 14px; margin-bottom: 14px; }
.urlbox code { flex: 1; font-size: 13px; word-break: break-all; }
.dest { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; margin-bottom: 8px; background: var(--surface); }
.dest.current { border-color: var(--good); background: var(--good-soft); }
.dest .dl { font-weight: 800; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dest .du { font-size: 12.5px; color: var(--ink-soft); word-break: break-all; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.timeline li:first-child { border-top: 0; }
.timeline .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); margin-top: 6px; flex-shrink: 0; }

/* ------------------------------------------------ Login */
.login-body { display: flex; align-items: center; justify-content: center; padding: 20px; background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 10%, var(--bg)) 0%, var(--bg) 55%); }
.login-wrap { width: 100%; max-width: 340px; text-align: center; }
.login-logo { width: 70px; height: 70px; border-radius: 20px; background: #0c0d11; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; box-shadow: 0 12px 28px rgba(0,0,0,.2); }
.login-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 28px 26px; text-align: left; box-shadow: 0 20px 45px rgba(0,0,0,.08); }
.login-card h1 { font-size: 20px; margin-bottom: 4px; text-align: center; }
.login-card .sub { color: var(--ink-soft); font-size: 13px; text-align: center; margin: 0 0 18px; }
.login-card button[type=submit] { width: 100%; justify-content: center; padding: 12px; border-radius: 999px; background: linear-gradient(135deg, #4f46e5, #a855f7); }
.blocked { text-align: center; }
.blocked .lk { width: 56px; height: 56px; border-radius: 50%; background: var(--bad-soft); color: var(--bad); display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; }
.blocked .lk svg { width: 26px; height: 26px; }

/* ------------------------------------------------ Celular */
@media (max-width: 960px) {
  .kpis, .kpis.six { grid-template-columns: repeat(2, 1fr); }
  .cols, .cols.three, .cols.w21, .qr-layout { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  body { flex-direction: column; }
  aside { width: 100%; height: auto; position: sticky; top: 0; z-index: 30; padding: 10px 12px; display: flex; align-items: center; gap: 10px; border-right: 0; border-bottom: 1px solid var(--line); overflow: visible; }
  .brand { padding: 0; } .brand-name, .nav-section-label, .ctx-own div { display: none; }
  .ctx { margin: 0; padding: 6px 8px; max-width: 150px; } .ctx label { display: none; } .ctx select { font-size: 13px; }
  nav.side { display: flex; gap: 2px; overflow-x: auto; flex: 1; }
  nav.side a { padding: 9px 11px; margin: 0; white-space: nowrap; } nav.side a .nav-text { display: none; }
  .side-footer { position: static; width: auto; padding: 0; border: 0; display: flex; gap: 4px; background: none; }
  .theme-toggle { padding: 9px; margin: 0; width: auto; border: 0; } .theme-toggle .nav-text, .logout .nav-text { display: none; }
  .logout { padding: 9px; }
  main { padding: 16px 14px 48px; }
  .hero { padding: 20px 18px; border-radius: 18px; } .hero h1 { font-size: 22px; }
  .kpi b { font-size: 26px; }
  .grid2 { grid-template-columns: 1fr; }
  .fstep { grid-template-columns: 1fr 76px; } .fstep .name { grid-column: 1 / -1; }
  .podium { grid-template-columns: 1fr; }
  .rank-row { grid-template-columns: 22px 1fr 54px; } .rank-row .rb { display: none; }
  .heat { grid-template-columns: 30px repeat(24, 1fr); gap: 2px; } .heat .h:nth-child(odd) { visibility: hidden; }
  .bars-wrap { padding-left: 26px; } .bar .val { font-size: 10px; }
  table { display: block; overflow-x: auto; white-space: nowrap; }
  .card { padding: 18px 16px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Tamaño base de íconos sueltos dentro de componentes */
.dest svg, .chip svg, .rv-contact svg, .pill svg, .timeline svg, .urlbox svg, .rv-actions svg, .banner svg { width: 16px; height: 16px; flex-shrink: 0; }
.dest .dl svg { color: var(--accent); }
.zone-head h2 svg, .card-head h2 svg, .hero h1 svg { flex-shrink: 0; }
button svg, .btn svg, a.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ================================================ Capa Phi Tap (diseño interior) */
/* Fondo ambiental con el acento del local */
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background: radial-gradient(900px 420px at 85% -90px, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%),
              radial-gradient(700px 360px at -5% 105%, color-mix(in srgb, var(--accent-2) 7%, transparent), transparent 70%); }

/* Barra de salto de secciones (chips por tarjeta) */
.jump { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; margin: -4px 0 8px; scrollbar-width: none; }
.jump::-webkit-scrollbar { display: none; }
.jump button { background: var(--surface); color: var(--ink); border: 1px solid var(--line); padding: 7px 13px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; }
.jump button svg { width: 15px; height: 15px; color: var(--accent); }
.jump button:hover { border-color: var(--accent); opacity: 1; }

/* Barra de guardado fija con estado de cambios */
.savebar { position: sticky; bottom: 14px; z-index: 15; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; box-shadow: 0 12px 32px rgba(0,0,0,.16); margin-top: 18px; }
.savebar .state { color: var(--ink-soft); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.savebar .state::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 4px color-mix(in srgb, var(--good) 22%, transparent); }
.savebar.dirty .state { color: var(--warn); font-weight: 700; }
.savebar.dirty .state::before { background: var(--warn); box-shadow: 0 0 0 4px color-mix(in srgb, var(--warn) 24%, transparent); }

/* Tarjeta resumen oscura con cifras en chips translúcidos */
.sum { position: relative; overflow: hidden; background: linear-gradient(145deg, #17181c 0%, color-mix(in srgb, var(--accent) 38%, #17181c) 140%); color: #fff; border-radius: var(--radius); padding: 22px 24px; margin-bottom: 18px; box-shadow: var(--pt-shadow); }
.sum::after { content: ""; position: absolute; right: -50px; top: -60px; width: 200px; height: 200px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.16), transparent 68%); pointer-events: none; }
.sum h2 { display: flex; align-items: center; gap: 9px; color: #fff; margin-bottom: 14px; position: relative; }
.sum h2 svg { width: 19px; height: 19px; opacity: .85; }
.sum-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; position: relative; }
.sum-chips span { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.16); border-radius: 999px; padding: 6px 13px; font-size: 13px; }
.sum-chips b { font-size: 15px; margin-right: 4px; font-variant-numeric: tabular-nums; }
.sum-actions { display: flex; flex-wrap: wrap; gap: 8px; position: relative; }
.sum .btn-sm, .sum button.btn-sm { background: rgba(255,255,255,.16); color: #fff; }
.sum .btn-wa { background: #16a34a; color: #fff; }
.sum details { margin-top: 12px; position: relative; }
.sum summary { cursor: pointer; font-size: 13px; opacity: .8; }
.sum pre { margin: 10px 0 0; white-space: pre-wrap; font: inherit; font-size: 13.5px; background: rgba(0,0,0,.25); border-radius: 12px; padding: 12px 14px; }

/* Tarjetas de estado (salud de locales): punto con halo y minigráfico de 14 días */
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--dc, var(--good)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--dc, var(--good)) 22%, transparent); flex-shrink: 0; }
.tcard-top .dot { margin-left: auto; }
.spark { display: flex; align-items: flex-end; gap: 2px; height: 28px; }
.spark i { flex: 1; min-height: 2px; height: calc(var(--h) * 1%); background: var(--tc, var(--accent)); opacity: .85; border-radius: 3px 3px 0 0; }
.spark i.z { background: var(--line); opacity: 1; }
.spark-cap { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--ink-soft); margin-top: -4px; }

/* Podio con barra de proporción */
.pod .pb { height: 6px; border-radius: 999px; background: rgba(0,0,0,.08); margin: 9px 0 5px; overflow: hidden; }
.pod .pb i { display: block; height: 100%; width: var(--w); background: var(--accent); border-radius: inherit; }
.pod:nth-child(1) .pb { background: rgba(255,255,255,.28); }
.pod:nth-child(1) .pb i { background: #fff; }
.pod:nth-child(2) .medal { background: #cbd0d8; } .pod:nth-child(1) .medal { background: #ffd54a; } .pod:nth-child(3) .medal { background: #e0a56a; }
html[data-theme="dark"] .pod .pb { background: rgba(255,255,255,.1); }

/* Login: botón de modo noche */
.login-theme { display: flex; align-items: center; gap: 6px; justify-content: center; margin: 16px auto 0; width: fit-content; background: none; border: 0; color: var(--ink-soft); font: inherit; font-size: 12.5px; cursor: pointer; padding: 6px 10px; }
.login-theme:hover { color: var(--ink); opacity: 1; }
.login-theme svg { width: 15px; height: 15px; }
.login-wrap { max-width: 320px; }

@media (max-width: 720px) {
  main { padding: 18px 14px 56px; }
  .savebar { bottom: 8px; padding: 10px 12px; }
  .savebar .state { font-size: 12px; }
  body::before { background: radial-gradient(500px 300px at 90% -60px, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%); }
}

/* ================================================ Capa Phi Tap 2: íconos en cuadro, reseñas, analíticas, locales, color del panel */
/* Íconos de sección dentro de un cuadro (hero y encabezados de tarjeta) */
.hero h1 { font-size: 30px; gap: 14px; align-items: center; }
.hero h1 .hico { width: 46px; height: 46px; border-radius: 14px; background: rgba(255,255,255,.2); box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.hero h1 .hico svg { width: 25px; height: 25px; }
.hero::after { width: 340px; height: 340px; right: -80px; top: -120px; }
.card-head h2, .card-toggle-header .tl { gap: 12px; }
.card-head h2 svg, .card-toggle-header .tl svg { width: 34px; height: 34px; padding: 8px; border-radius: 10px; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 4px 10px color-mix(in srgb, var(--accent) 28%, transparent); }
.card-chevron { width: 30px; height: 30px; border-radius: 50%; background: var(--bg); align-items: center; justify-content: center; }
.card-chevron svg { width: 16px; height: 16px; }
.card-toggle-header .card-chevron svg, .card-head .card-chevron svg { background: none; box-shadow: none; padding: 0; color: var(--ink-soft); width: 16px; height: 16px; }

/* Selector de color del panel */
aside { padding-bottom: 210px; }
.side-colors { padding: 2px 2px 12px; }
.sc-title { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 9px; }
.sc-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.pcol { width: 20px; height: 20px; padding: 0; border-radius: 50%; background: var(--sw, var(--accent)); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); cursor: pointer; position: relative; display: block; }
.pcol:hover { opacity: 1; transform: scale(1.12); }
.pcol.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); }
.pcol-logo::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: rgba(255,255,255,.85); }
.pcol-custom { margin: 0; background: conic-gradient(#ef4444, #f59e0b, #22c55e, #06b6d4, #6366f1, #d946ef, #ef4444); overflow: hidden; }
.pcol-custom input { position: absolute; inset: -6px; opacity: 0; width: 34px; height: 34px; margin: 0; padding: 0; cursor: pointer; border: 0; }
.sc-reset { background: none; color: var(--ink-soft); padding: 0; font-size: 12px; font-weight: 700; text-decoration: underline; border-radius: 0; }
.sc-reset:hover { color: var(--ink); opacity: 1; }

/* Reseñas */
.rtop { display: grid; grid-template-columns: 1fr 1.45fr 1.15fr; gap: 16px; margin-bottom: 18px; }
.rcard { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 20px 22px; box-shadow: var(--shadow); min-width: 0; }
.rcard h3 { font-size: 17px; font-weight: 800; }
.rcard .sub { color: var(--ink-soft); font-size: 13px; margin: 3px 0 16px; }
.avg-card { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.avg-card .lab { color: var(--ink-soft); font-weight: 600; margin-bottom: 4px; }
.avg-row { display: flex; align-items: center; gap: 10px; }
.avg-row .big-num { font-size: 66px; }
.avg-row .bigstar { width: 52px; height: 52px; color: var(--ink); display: inline-flex; }
.avg-row .bigstar svg { width: 100%; height: 100%; }
.avg-card .meter { justify-content: center; margin: 10px 0 8px; }
.avg-card .meter span { width: 26px; height: 26px; }
.rcard .dist-row { grid-template-columns: 40px 1fr 70px; }
.rcard .dist-bar { height: 9px; border: 0; background: color-mix(in srgb, var(--ink-soft) 16%, var(--surface)); }
.lg { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 9px; font-size: 13.5px; }
.lg li { display: flex; align-items: center; gap: 9px; }
.lg .d { width: 9px; height: 9px; border-radius: 50%; background: var(--d); flex-shrink: 0; }
.lg .k { margin-left: auto; font-weight: 800; font-variant-numeric: tabular-nums; }
.rcard .split { height: 14px; margin: 0 0 4px; }

.zones { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.zone { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); min-width: 0; }
.zone-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-radius: 0; margin: 0; flex-wrap: nowrap; color: #fff; }
.zone-good .zone-head { background: linear-gradient(135deg, color-mix(in srgb, var(--good) 72%, #0b3d24), var(--good)); color: #fff; }
.zone-bad .zone-head { background: linear-gradient(135deg, #e8912d, #e5604f); color: #fff; }
.zt-ic { width: 38px; height: 38px; border-radius: 11px; background: rgba(255,255,255,.2); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.zt-ic svg { width: 20px; height: 20px; }
.zt { flex: 1; min-width: 0; }
.zone-head h2 { font-size: 18px; display: block; }
.zt p { margin: 2px 0 0; font-size: 12.5px; opacity: .9; }
.zcnt { min-width: 40px; height: 40px; padding: 0 8px; border-radius: 12px; background: rgba(255,255,255,.22); font-size: 20px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.zone-body { padding: 14px 14px 16px; }
.zone-tools { display: flex; justify-content: flex-end; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.zone-tools .seg { background: var(--bg); backdrop-filter: none; }
.zone-tools .seg a { color: var(--ink-soft); } .zone-tools .seg a:hover { background: color-mix(in srgb, var(--ink-soft) 12%, transparent); }
.zone-tools .seg a.on { background: var(--accent); color: #fff; }
.zone-tools form { margin: 0; }
.rv { display: flex; gap: 14px; align-items: flex-start; border-left: 1px solid var(--line); border-radius: 14px; padding: 14px 14px 12px; box-shadow: none; background: var(--bg); }
.rv-badge { flex-direction: column; gap: 1px; min-width: 46px; width: 46px; height: 46px; border-radius: 13px; font-size: 17px; line-height: 1; flex-shrink: 0; }
.rv-badge b { font-size: 17px; }
.rv-badge svg { width: 11px; height: 11px; fill: currentColor; stroke: none; }
.rv-main { flex: 1; min-width: 0; }
.rv-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin: 0 0 3px; flex-wrap: nowrap; }
.rv-who { font-weight: 800; line-height: 1.3; }
.rv-when { font-size: 12px; white-space: nowrap; }
.rv .stars span { width: 15px; height: 15px; }
.rv-text { margin: 6px 0 8px; font-style: normal; }
.rv-text.empty { font-style: italic; }
.rv-tags .pill-ok { background: color-mix(in srgb, var(--good) 16%, var(--surface)); }
.rv-actions { border-top: 0; padding-top: 0; margin-top: 8px; }
.rv-note { order: 3; flex: 1 1 100%; }
.rv-del { margin-left: auto; }

/* Analíticas */
.kgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.kc { --c: var(--accent); position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px 0; box-shadow: var(--shadow); overflow: hidden; cursor: pointer; display: flex; flex-direction: column; min-height: 170px; transition: transform .15s, border-color .15s; animation: rise .5s both; outline: none; }
.kc:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.kc:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.kc-top { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }
.kc-top .ic { width: 26px; height: 26px; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--c) 16%, var(--surface)); color: var(--c); flex-shrink: 0; }
.kc-top .ic svg { width: 14px; height: 14px; }
.kc-top .kt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dchip { font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.dchip.up { background: var(--good-soft); color: var(--good); } .dchip.down { background: var(--bad-soft); color: var(--bad); } .dchip.flat { background: var(--bg); color: var(--ink-soft); }
.kc b { display: block; font-size: 32px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; margin: 12px 0 2px; font-variant-numeric: tabular-nums; }
.kc em { font-style: normal; font-size: 12.5px; color: var(--ink-soft); }
.kc .sp { margin: auto -16px 0; width: calc(100% + 32px); height: 52px; display: block; }
.kc .sp .l { fill: none; stroke: var(--c); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.kc .sp .a { fill: var(--c); fill-opacity: .16; }
.kc.hot { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; border-color: transparent; box-shadow: 0 12px 28px color-mix(in srgb, var(--accent) 30%, transparent); }
.kc.hot .kc-top, .kc.hot em { color: rgba(255,255,255,.88); }
.kc.hot .kc-top .ic { background: rgba(255,255,255,.2); color: #fff; }
.kc.hot .sp .l { stroke: #fff; } .kc.hot .sp .a { fill: #fff; fill-opacity: .18; }
.kc.hot .dchip { background: rgba(255,255,255,.2); color: #fff; }
.kc:nth-child(2) { animation-delay: .04s; } .kc:nth-child(3) { animation-delay: .08s; } .kc:nth-child(4) { animation-delay: .12s; } .kc:nth-child(5) { animation-delay: .16s; } .kc:nth-child(6) { animation-delay: .2s; }

.lgd { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-soft); font-weight: 600; }
.lgd i { display: inline-block; width: 18px; height: 0; border-top: 3px solid var(--accent); border-radius: 2px; }
.lgd i.l2 { border-top: 2px dashed var(--ink-soft); }
.lc-wrap { position: relative; }
.lc-wrap svg { width: 100%; height: auto; display: block; touch-action: pan-y; }
.lc-tip { position: absolute; display: none; z-index: 5; background: #17181c; color: #fff; font-size: 12.5px; line-height: 1.5; padding: 8px 12px; border-radius: 10px; pointer-events: none; box-shadow: 0 8px 20px rgba(0,0,0,.3); white-space: nowrap; }
.tk { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 7px; }
.tk.a { background: var(--accent); } .tk.b { background: transparent; border: 1.5px dashed #b8bcc6; }
.donut-row { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut { position: relative; width: 150px; height: 150px; flex-shrink: 0; }
.donut svg { width: 100%; height: 100%; display: block; }
.donut .dn { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut .dn b { font-size: 30px; font-weight: 800; line-height: 1; }
.donut .dn small { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); font-weight: 700; margin-top: 3px; }
.dlg { flex: 1; min-width: 150px; display: grid; gap: 8px; }
.dl { display: grid; grid-template-columns: 10px 1fr auto 40px; gap: 9px; align-items: center; font-size: 13px; }
.dl .d { width: 9px; height: 9px; border-radius: 50%; background: var(--d); }
.dl .nm { display: flex; align-items: center; gap: 4px; font-weight: 700; } .dl .nm svg { width: 13px; height: 13px; color: var(--star); }
.dl b { font-variant-numeric: tabular-nums; } .dl .pc { color: var(--ink-soft); text-align: right; font-size: 12px; }
.cols.gh { grid-template-columns: 1fr 2fr; }
.gauge-card { background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 80%, #0c0d11), color-mix(in srgb, var(--accent) 35%, #0c0d11)); color: #fff; border-color: transparent; }
.gauge-card .card-head h2 { color: #fff; } .gauge-card .help { color: rgba(255,255,255,.78); }
.gauge-card::before { background: rgba(255,255,255,.25); }
.gauge { position: relative; width: 210px; max-width: 100%; margin: 6px auto 2px; }
.gauge svg { width: 100%; height: auto; display: block; }
.gauge .gv { position: absolute; left: 0; right: 0; bottom: 2px; text-align: center; }
.gauge .gv b { display: block; font-size: 34px; line-height: 1; font-weight: 800; }
.gauge .gv small { text-transform: uppercase; letter-spacing: .08em; font-size: 10.5px; font-weight: 700; opacity: .85; }
.gauge-card .dchip { display: inline-block; margin-top: 8px; background: rgba(255,255,255,.2); color: #fff; }
.gtxt { margin: 8px 0 0; font-size: 13px; opacity: .9; }
.heat { gap: 4px; }
.heat .c { border-radius: 6px; border: 0; background: color-mix(in srgb, var(--accent) calc(var(--a) * 100%), color-mix(in srgb, var(--ink-soft) 14%, var(--surface))); }
.heat .c.z { background: color-mix(in srgb, var(--ink-soft) 14%, var(--surface)); }
.heat-legend { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 12px; font-size: 11.5px; color: var(--ink-soft); }
.heat-legend i { width: 90px; height: 7px; border-radius: 999px; background: linear-gradient(90deg, color-mix(in srgb, var(--ink-soft) 14%, var(--surface)), var(--accent)); }
.bar .fill { border-radius: 999px 999px 8px 8px; }

/* Locales */
.loc-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; padding-top: 14px; border-top: 1px dashed var(--line); }
.lchip { background: var(--bg); color: var(--ink-soft); border: 1px solid var(--line); border-radius: 12px; padding: 8px 14px; font-size: 14px; font-weight: 600; }
.lchip b { font-size: 18px; color: var(--ink); margin-right: 4px; }
.lchip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.lchip.on b { color: var(--accent); }
.loc-search { flex: 1 1 180px; display: flex; align-items: center; gap: 8px; margin: 0; padding: 0 14px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; font-weight: 400; }
.loc-search svg { width: 16px; height: 16px; color: var(--ink-soft); flex-shrink: 0; }
.loc-search input { border: 0; background: none; margin: 0; padding: 10px 0; box-shadow: none !important; }
.lgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.lcard { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px 14px; display: flex; flex-direction: column; gap: 11px; overflow: hidden; min-width: 0; }
.lcard::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, var(--tc, var(--accent)), color-mix(in srgb, var(--tc, var(--accent)) 50%, var(--accent-2))); }
.lcard.paused { opacity: .62; }
.lcard.here { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.lcard-top { display: flex; align-items: center; gap: 14px; }
.lcard .tlogo { width: 60px; height: 60px; border-radius: 15px; }
.lid { min-width: 0; flex: 1; }
.lid .tname { font-size: 17px; }
.lid .slug { display: block; font-size: 12.5px; color: var(--ink-soft); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.lid .rubro { font-size: 12px; color: var(--ink-soft); }
.spill { font-size: 12.5px; font-weight: 800; padding: 4px 12px; border-radius: 999px; background: var(--bg); color: var(--ink-soft); border: 1px solid var(--line); flex-shrink: 0; align-self: flex-start; }
.spill.on { background: var(--good-soft); color: var(--good); border-color: transparent; }
.lspark { margin-top: 2px; }
.lactions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.lactions form { margin: 0; }
.lsec { margin-top: -2px; padding-top: 10px; border-top: 1px dashed var(--line); }

@media (max-width: 960px) {
  .rtop { grid-template-columns: 1fr 1fr; } .rtop .rcard:first-child { grid-column: 1 / -1; }
  .zones, .lgrid, .cols.gh { grid-template-columns: 1fr; }
  .kgrid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .rtop { grid-template-columns: 1fr; } .kgrid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kc { min-height: 150px; padding: 12px 12px 0; } .kc .sp { margin: auto -12px 0; width: calc(100% + 24px); } .kc b { font-size: 26px; }
  .kc-top .kt { font-size: 11.5px; } .kc-top .dchip { display: none; }
  .side-colors { display: none; } aside { padding-bottom: 10px; }
  .hero h1 { font-size: 23px; } .hero h1 .hico { width: 40px; height: 40px; }
  .avg-row .big-num { font-size: 54px; }
  .zone-head { padding: 14px; } .rv { padding: 12px; gap: 10px; }
}
.lspark .spark-cap { margin-top: 4px; }
.avg-card em { font-style: normal; }

/* Cambio de ícono */
.icon-prev { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; margin-bottom: 16px; }
.icon-prev small { display: block; color: var(--ink-soft); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.icon-prev .meter span.on, .icon-prev .meter span.half i { color: var(--ic, var(--star)); }
.icon-prev .meter span { width: 36px; height: 36px; }

/* Login con el logo del local */
.login-logo.tenant { background: #fff; border: 1px solid var(--line); width: 84px; height: 84px; border-radius: 24px; }
.login-logo.tenant img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }

/* Tarjeta de reseñas: vista previa de la página pública */
.pg-card { gap: 0; }
.pg-stage { position: relative; width: 100%; max-width: 330px; margin: 10px auto 14px; padding: 46px 16px 18px; border-radius: 22px; overflow: hidden; background: radial-gradient(120% 90% at 20% 0%, var(--pg-a) 0%, var(--pg-b) 100%); }
.pg-deco { position: absolute; inset: 0; opacity: .09; pointer-events: none; background: radial-gradient(circle at 12% 14%, #fff 0 38px, transparent 39px), radial-gradient(circle at 90% 45%, #fff 0 26px, transparent 27px), radial-gradient(circle at 22% 96%, #fff 0 44px, transparent 45px); }
.pg-box { position: relative; background: #fff; border-radius: 20px; padding: 40px 12px 14px; text-align: center; box-shadow: 0 16px 34px rgba(0, 0, 0, .28); }
.pg-logo { position: absolute; top: -32px; left: 50%; transform: translateX(-50%); width: 64px; height: 64px; border-radius: 50%; background: #fff; border: 3px solid var(--pg-soft); box-shadow: 0 6px 16px rgba(0, 0, 0, .2); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.pg-logo img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.pg-logo svg { width: 30px; height: 30px; color: var(--pg-deep); }
.pg-name { font-weight: 700; font-size: 14px; color: #17181c; line-height: 1.2; }
.pg-q { font-family: Georgia, 'Times New Roman', serif; font-weight: 700; font-size: 17px; line-height: 1.2; color: var(--pg-deep); margin: 6px 0 10px; }
.pg-box .meter { justify-content: center; margin: 4px 0 0; gap: 4px; }
.pg-box .meter span { width: 30px; height: 30px; color: #d9dce2; }
.pg-box .meter span.on, .pg-box .meter span.half i { color: var(--pg-deep); }
.pg-avg { display: flex; align-items: baseline; justify-content: center; gap: 8px; color: var(--ink-soft); font-size: 13.5px; margin-bottom: 4px; }
.pg-avg .big-num { font-size: 30px; color: var(--ink); }

/* Alta: quién crea el local */
.who-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.who { display: flex; flex-direction: column; gap: 3px; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 14px; cursor: pointer; background: var(--card, transparent); transition: border-color .2s, background .2s, box-shadow .2s; }
.who input { position: absolute; opacity: 0; pointer-events: none; }
.who b { font-size: 15px; } .who span { font-size: 12.5px; color: var(--ink-soft); line-height: 1.35; }
.who.on { border-color: var(--accent, #4f46e5); background: color-mix(in srgb, var(--accent, #4f46e5) 8%, transparent); box-shadow: 0 6px 16px color-mix(in srgb, var(--accent, #4f46e5) 16%, transparent); }
@media (max-width: 640px) { .who-pick { grid-template-columns: 1fr; } }
/* Tarjeta de local pendiente */
.lcard.pend { border-style: dashed; border-color: color-mix(in srgb, #d97706 55%, var(--line)); }
.pend-pill { background: #fef3c7; color: #92400e; }
.pend-body { display: grid; gap: 12px; margin: 14px 0 12px; }
.pend-row small { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 4px; }
.pend-code { font-size: 26px; letter-spacing: .22em; font-variant-numeric: tabular-nums; }

/* ===== Sistema de animación tipo app (se tiñe con el color y el ícono de cada local) ===== */
:root { --ease: cubic-bezier(.22, 1, .36, 1); }
@keyframes fadeUpA { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes slideInA { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
@keyframes markInA { from { opacity: 0; transform: translateY(-36px) scale(.5) rotate(-12deg); } 60% { transform: translateY(5px) scale(1.07) rotate(3deg); } to { opacity: 1; transform: none; } }
@keyframes sheetUpA { from { opacity: 0; transform: translateY(60px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes shakeA { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes spinA { to { transform: rotate(360deg); } }
@keyframes floatA { 50% { transform: translateY(-14px) rotate(6deg); } }
@keyframes pulseA { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }
@keyframes veilOutA { 0%, 38% { clip-path: circle(150% at 50% 44%); } 100% { clip-path: circle(0 at 50% 44%); } }
@keyframes veilInA { 0% { opacity: 0; transform: scale(.7); } 30% { opacity: 1; transform: scale(1.05); } 38% { transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: scale(.9); } }
@keyframes rippleA { to { transform: scale(3.2); opacity: 0; } }

/* Contenido: entra en cascada */
main > * { animation: fadeUpA .6s var(--ease) both; }
main > *:nth-child(1) { animation-delay: .02s; } main > *:nth-child(2) { animation-delay: .09s; } main > *:nth-child(3) { animation-delay: .16s; }
main > *:nth-child(4) { animation-delay: .23s; } main > *:nth-child(5) { animation-delay: .3s; } main > *:nth-child(n+6) { animation-delay: .36s; }
.rtop > *, .kpis > *, .lgrid > *, .grid3 > * { animation: fadeUpA .6s var(--ease) both; }
.rtop > *:nth-child(2), .kpis > *:nth-child(2), .lgrid > *:nth-child(2) { animation-delay: .08s; }
.rtop > *:nth-child(3), .kpis > *:nth-child(3), .lgrid > *:nth-child(3) { animation-delay: .16s; }
.kpis > *:nth-child(4), .lgrid > *:nth-child(4) { animation-delay: .24s; } .kpis > *:nth-child(n+5), .lgrid > *:nth-child(n+5) { animation-delay: .3s; }
aside nav.side a { animation: slideInA .5s var(--ease) both; }
aside nav.side a:nth-child(2) { animation-delay: .06s; } aside nav.side a:nth-child(3) { animation-delay: .12s; } aside nav.side a:nth-child(4) { animation-delay: .18s; }
aside nav.side a:nth-child(5) { animation-delay: .24s; } aside nav.side a:nth-child(n+6) { animation-delay: .3s; }
.pr-entering main > *, .pr-entering .rtop > *, .pr-entering .kpis > *, .pr-entering .lgrid > *, .pr-entering aside nav.side a { animation-delay: calc(var(--dl, 0s) + .85s); }
.pr-entering main > *:nth-child(2) { --dl: .07s; } .pr-entering main > *:nth-child(3) { --dl: .14s; } .pr-entering main > *:nth-child(n+4) { --dl: .2s; }

/* Toque de app: respuesta al presionar y al pasar */
button, .btn, .ghost, a.btn-sm, nav.side a, .seg a, .lchip { transition: transform .18s var(--ease), box-shadow .25s, background .2s, color .2s, border-color .2s; }
button:active, .btn:active, .ghost:active, nav.side a:active, .seg a:active, .lchip:active { transform: scale(.96); }
.lcard, .kpi, .rcard { transition: transform .3s var(--ease), box-shadow .3s; }
.lcard:hover, .kpi:hover { transform: translateY(-3px); box-shadow: 0 18px 38px color-mix(in srgb, var(--accent) 16%, transparent); }
.rv { transition: transform .25s var(--ease); } .rv:hover { transform: translateX(3px); }
.ripple { position: relative; overflow: hidden; }
.ripple > .rp { position: absolute; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; background: currentColor; opacity: .22; transform: scale(0); animation: rippleA .6s ease-out forwards; pointer-events: none; }

/* Encabezado con el ícono de calificación del local flotando */
.hero-fx { position: absolute; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.hero-fx span { position: absolute; left: var(--x); top: var(--y); width: 40px; height: 40px; color: #fff; opacity: .13; animation: floatA 7s var(--d, 0s) ease-in-out infinite; }
.hero-fx span:nth-child(odd) { width: 54px; height: 54px; opacity: .09; }
.hero-fx svg { width: 100%; height: 100%; display: block; }
@media (max-width: 700px) { .hero-fx span:nth-child(n+4) { display: none; } }

/* Bienvenida al entrar: cortina con el logo y el color del local */
.pr-veil { position: fixed; inset: 0; z-index: 9999; background: radial-gradient(120% 90% at 20% 0%, var(--accent) 0%, color-mix(in srgb, var(--accent) 55%, #000) 100%); display: flex; align-items: center; justify-content: center; pointer-events: none; clip-path: circle(150% at 50% 44%); animation: veilOutA 1.35s .1s cubic-bezier(.65, 0, .35, 1) forwards; }
.pr-veil-in { display: flex; flex-direction: column; align-items: center; gap: 16px; color: #fff; animation: veilInA 1.3s .1s var(--ease) both; }
.pr-veil-in b { font-size: 22px; letter-spacing: -.01em; }
.pr-veil-logo { width: 104px; height: 104px; border-radius: 30px; background: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 24px 50px rgba(0, 0, 0, .3); animation: pulseA 1.4s ease-in-out infinite; }
.pr-veil-logo.dark { background: #0c0d11; } .pr-veil-logo img { width: 100%; height: 100%; object-fit: contain; padding: 14px; } .pr-veil-logo.dark img { width: 46px; height: auto; padding: 0; }

/* Login con aire de app */
.app-login .login-logo { animation: markInA .9s var(--ease) both; }
.app-login .login-card { animation: sheetUpA .8s .2s var(--ease) both; }
.app-login .login-card > * { animation: fadeUpA .55s var(--ease) both; }
.app-login .login-card > *:nth-child(1) { animation-delay: .45s; } .app-login .login-card > *:nth-child(2) { animation-delay: .5s; } .app-login .login-card > *:nth-child(3) { animation-delay: .55s; }
.app-login .login-card > *:nth-child(4) { animation-delay: .6s; } .app-login .login-card > *:nth-child(5) { animation-delay: .65s; } .app-login .login-card > *:nth-child(n+6) { animation-delay: .7s; }
.app-login .login-theme { animation: fadeUpA .6s .9s var(--ease) both; }
.app-login .login-card.shake { animation: shakeA .45s; }
.login-card input:focus { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); border-color: var(--accent); transform: translateY(-1px); }
.login-card input { transition: box-shadow .2s, border-color .2s, transform .2s var(--ease); }
.login-card button[type=submit] { position: relative; }
.login-card button[type=submit].busy span { opacity: 0; }
.login-card button[type=submit].busy::after { content: ""; position: absolute; left: 50%; top: 50%; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .45); border-top-color: #fff; animation: spinA .7s linear infinite; }
@media (prefers-reduced-motion: reduce) {
  main > *, .rtop > *, .kpis > *, .lgrid > *, aside nav.side a, .app-login *, .hero-fx span { animation-duration: .01ms !important; animation-delay: 0s !important; }
  .pr-veil { display: none; }
}

/* ===== Relieve suave: tarjetas con volumen ===== */
:root {
  --relief: inset 0 1.5px 0 rgba(255,255,255,.95), inset 0 -2px 0 rgba(16,24,40,.035), 0 0 0 1px rgba(16,24,40,.055), 0 2px 4px rgba(16,24,40,.04), 0 16px 32px -14px rgba(16,24,40,.18), 0 44px 70px -38px color-mix(in srgb, var(--accent) 38%, transparent);
  --relief-hover: inset 0 1.5px 0 rgba(255,255,255,.95), inset 0 -2px 0 rgba(16,24,40,.035), 0 0 0 1px color-mix(in srgb, var(--accent) 22%, rgba(16,24,40,.06)), 0 4px 8px rgba(16,24,40,.05), 0 26px 44px -16px rgba(16,24,40,.24), 0 56px 80px -36px color-mix(in srgb, var(--accent) 48%, transparent);
  --surface-relief: linear-gradient(180deg, #ffffff 0%, #f6f7fa 100%);
}
html[data-theme="dark"] {
  --relief: inset 0 1px 0 rgba(255,255,255,.07), inset 0 -2px 0 rgba(0,0,0,.25), 0 0 0 1px rgba(255,255,255,.05), 0 2px 4px rgba(0,0,0,.3), 0 18px 34px -14px rgba(0,0,0,.6), 0 44px 70px -38px color-mix(in srgb, var(--accent) 45%, transparent);
  --relief-hover: inset 0 1px 0 rgba(255,255,255,.09), inset 0 -2px 0 rgba(0,0,0,.25), 0 0 0 1px color-mix(in srgb, var(--accent) 38%, transparent), 0 4px 8px rgba(0,0,0,.35), 0 28px 46px -16px rgba(0,0,0,.7), 0 56px 80px -36px color-mix(in srgb, var(--accent) 55%, transparent);
  --surface-relief: linear-gradient(180deg, #1d1f24 0%, #16171b 100%);
}
.card, .kpi, .rcard, .lcard, .pg-card { border-color: transparent; border-radius: 20px; background-image: var(--surface-relief); box-shadow: var(--relief); }
.lcard.here { box-shadow: var(--relief), 0 0 0 3px color-mix(in srgb, var(--accent) 24%, transparent); }
.kpi.hot { background-image: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: inset 0 1.5px 0 rgba(255,255,255,.35), inset 0 -3px 0 rgba(0,0,0,.12), 0 18px 34px -12px color-mix(in srgb, var(--accent) 60%, transparent); }
/* Sube al pasar el mouse con "translate" (no choca con la animación de entrada) */
.card, .kpi, .rcard, .lcard { transition: translate .45s var(--ease), box-shadow .45s var(--ease); }
.card:hover, .kpi:hover, .rcard:hover, .lcard:hover { translate: 0 -5px; transform: none; box-shadow: var(--relief-hover); }
.kpi.hot:hover { box-shadow: inset 0 1.5px 0 rgba(255,255,255,.35), inset 0 -3px 0 rgba(0,0,0,.12), 0 28px 46px -12px color-mix(in srgb, var(--accent) 70%, transparent); }
/* Barra de color superior más fina y con brillo */
.card::before { height: 3px; background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent)); background-size: 200% 100%; animation: edgeA 6s linear infinite; }
@keyframes edgeA { to { background-position: -200% 0; } }
/* Íconos de las cifras como chips con bisel */
.kpi .ic { width: 42px; height: 42px; border-radius: 15px; box-shadow: inset 0 1.5px 0 rgba(255,255,255,.9), inset 0 -4px 8px rgba(16,24,40,.09), 0 8px 14px -6px color-mix(in srgb, var(--c) 55%, rgba(16,24,40,.4)); }
.kpi.hot .ic { box-shadow: inset 0 1.5px 0 rgba(255,255,255,.4), inset 0 -4px 8px rgba(0,0,0,.14), 0 8px 14px -6px rgba(0,0,0,.3); }
.kpi b { font-family: Georgia, "Times New Roman", serif; font-weight: 700; }
html[data-theme="dark"] .kpi .ic { box-shadow: inset 0 1px 0 rgba(255,255,255,.12), inset 0 -4px 8px rgba(0,0,0,.25), 0 8px 14px -6px rgba(0,0,0,.5); }
/* Una pasada de luz sobre las cifras al entrar */
.kpi::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.55) 50%, transparent 65%); transform: translateX(-130%); animation: sheenA 1.4s 1s var(--ease) 1 both; }
.pr-entering .kpi::after { animation-delay: 2s; }
@keyframes sheenA { to { transform: translateX(130%); } }
html[data-theme="dark"] .kpi::after { background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.12) 50%, transparent 65%); }
@media (prefers-reduced-motion: reduce) { .card::before { animation: none; } .kpi::after { display: none; } .card, .kpi, .rcard, .lcard { transition: none; } }

/* ===== Relieve en todo el panel: botones, campos, chips, tablas, listas =====
   Todo cuelga de variables y de clases genéricas (.card, .btn, .chip, input, table, .rv),
   así que cualquier sección nueva que use esas piezas hereda el efecto sin código extra. */
:root {
  --btn-bevel: inset 0 1.5px 0 rgba(255,255,255,.38), inset 0 -2px 0 rgba(0,0,0,.15), 0 1px 2px rgba(16,24,40,.14);
  --raise-sm: inset 0 1.5px 0 rgba(255,255,255,.95), inset 0 -1.5px 0 rgba(16,24,40,.04), 0 0 0 1px rgba(16,24,40,.07), 0 6px 12px -6px rgba(16,24,40,.18);
  --inset: inset 0 2px 4px rgba(16,24,40,.07), inset 0 0 0 1px rgba(16,24,40,.05), 0 1px 0 rgba(255,255,255,.9);
}
html[data-theme="dark"] {
  --btn-bevel: inset 0 1.5px 0 rgba(255,255,255,.22), inset 0 -2px 0 rgba(0,0,0,.3), 0 1px 2px rgba(0,0,0,.4);
  --raise-sm: inset 0 1px 0 rgba(255,255,255,.08), inset 0 -1.5px 0 rgba(0,0,0,.3), 0 0 0 1px rgba(255,255,255,.06), 0 6px 12px -6px rgba(0,0,0,.6);
  --inset: inset 0 2px 5px rgba(0,0,0,.4), inset 0 0 0 1px rgba(255,255,255,.05), 0 1px 0 rgba(255,255,255,.04);
}
/* Botón principal */
:where(.btn:not(.btn-muted):not(.btn-danger):not(.btn-good),
button:not(.btn-muted):not(.btn-danger):not(.btn-good):not(.swatch):not(.pcol):not(.sc-reset):not(.theme-toggle):not(.login-theme):not(.lchip):not(.ghost):not(.card-chevron):not(.key)) {
  background-image: linear-gradient(180deg, color-mix(in srgb, var(--accent) 84%, #fff) 0%, var(--accent) 52%, color-mix(in srgb, var(--accent) 88%, #000) 100%);
  box-shadow: var(--btn-bevel), 0 10px 18px -10px color-mix(in srgb, var(--accent) 80%, transparent);
  text-shadow: 0 1px 0 rgba(0,0,0,.16);
}
/* Variantes */
.btn-muted { background-image: var(--surface-relief); border-color: transparent; box-shadow: var(--raise-sm); }
.btn-danger { background-image: linear-gradient(180deg, color-mix(in srgb, var(--danger-soft) 70%, #fff), var(--danger-soft)); box-shadow: inset 0 1.5px 0 rgba(255,255,255,.8), inset 0 -1.5px 0 color-mix(in srgb, var(--danger) 18%, transparent), 0 0 0 1px color-mix(in srgb, var(--danger) 18%, transparent), 0 6px 12px -7px color-mix(in srgb, var(--danger) 50%, transparent); }
.btn-good { background-image: linear-gradient(180deg, color-mix(in srgb, var(--good-soft) 70%, #fff), var(--good-soft)); box-shadow: inset 0 1.5px 0 rgba(255,255,255,.8), inset 0 -1.5px 0 color-mix(in srgb, var(--good) 18%, transparent), 0 0 0 1px color-mix(in srgb, var(--good) 18%, transparent), 0 6px 12px -7px color-mix(in srgb, var(--good) 50%, transparent); }
html[data-theme="dark"] .btn-danger, html[data-theme="dark"] .btn-good { background-image: none; }
/* Botones sobre el encabezado de color */
.ghost { box-shadow: inset 0 1.5px 0 rgba(255,255,255,.35), inset 0 -2px 0 rgba(0,0,0,.12), 0 8px 16px -8px rgba(0,0,0,.35); }
.seg { box-shadow: inset 0 2px 5px rgba(0,0,0,.16), inset 0 0 0 1px rgba(255,255,255,.14); }
.seg a.on { box-shadow: inset 0 1.5px 0 #fff, 0 6px 12px -4px rgba(0,0,0,.3); }
/* Respuesta al tocar: sube al pasar, se hunde al presionar */
.btn, button, .ghost { transition: translate .25s var(--ease), box-shadow .25s var(--ease), filter .25s, background .2s, color .2s; }
.btn:hover, button:hover { opacity: 1; filter: brightness(1.05); translate: 0 -2px; }
.btn:active, button:active { translate: 0 1px; filter: brightness(.97); }
.swatch:hover, .pcol:hover, .theme-toggle:hover { translate: none; filter: none; }
/* Campos hundidos */
input[type=text], input[type=password], input[type=email], input[type=url], input[type=number], select, textarea { box-shadow: var(--inset); transition: box-shadow .25s var(--ease), border-color .2s; }
input:focus, select:focus, textarea:focus { box-shadow: var(--inset), 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent); }
.ctx { box-shadow: var(--inset); }
/* Chips y etiquetas con volumen */
.chip { box-shadow: inset 0 1.5px 0 rgba(255,255,255,.7), 0 0 0 1px color-mix(in srgb, var(--accent) 16%, transparent), 0 4px 8px -4px color-mix(in srgb, var(--accent) 40%, transparent); }
.lchip, .rv-contact { background-image: var(--surface-relief); box-shadow: var(--raise-sm); border-color: transparent; }
.lchip.on { background-image: linear-gradient(180deg, color-mix(in srgb, var(--accent) 84%, #fff), var(--accent)); box-shadow: var(--btn-bevel); }
/* Interruptores */
.switch input { box-shadow: inset 0 2px 4px rgba(0,0,0,.2); }
.switch input::after { box-shadow: 0 1px 2px rgba(0,0,0,.35), 0 3px 6px rgba(0,0,0,.2), inset 0 -1px 0 rgba(0,0,0,.08); }
.switch input:checked { box-shadow: inset 0 2px 4px rgba(0,0,0,.25), 0 0 14px color-mix(in srgb, var(--accent) 45%, transparent); }
/* Menú lateral: opción activa elevada */
nav.side a { transition: background .2s, color .2s, translate .25s var(--ease), box-shadow .25s; }
nav.side a:hover { translate: 3px 0; }
nav.side a.active { background-image: linear-gradient(180deg, color-mix(in srgb, var(--accent) 12%, #fff), color-mix(in srgb, var(--accent) 20%, #fff)); box-shadow: inset 0 1.5px 0 rgba(255,255,255,.9), 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent), 0 8px 16px -8px color-mix(in srgb, var(--accent) 50%, transparent); }
html[data-theme="dark"] nav.side a.active { background-image: none; box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent), 0 8px 16px -8px color-mix(in srgb, var(--accent) 55%, transparent); }
/* Reseñas, tablas y barras */
.rv { border-color: transparent; border-left-width: 5px; border-radius: 18px; background-image: var(--surface-relief); box-shadow: var(--relief); transition: translate .4s var(--ease), box-shadow .4s var(--ease); }
.rv:hover { transform: none; translate: 0 -3px; box-shadow: var(--relief-hover); }
.rv-badge { box-shadow: inset 0 1.5px 0 rgba(255,255,255,.4), inset 0 -3px 6px rgba(0,0,0,.16), 0 8px 14px -6px var(--rc); }
th { box-shadow: inset 0 1.5px 0 rgba(255,255,255,.7); }
tbody tr { transition: background .2s; } tbody tr:hover td { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.dist-bar, .split { box-shadow: var(--inset); }
.banner { box-shadow: inset 0 1.5px 0 rgba(255,255,255,.7), 0 8px 16px -10px rgba(16,24,40,.25); }
html[data-theme="dark"] .banner { box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 8px 16px -10px rgba(0,0,0,.6); }
.swatch { box-shadow: 0 0 0 1px var(--line), 0 6px 10px -4px rgba(16,24,40,.35), inset 0 -3px 5px rgba(0,0,0,.14), inset 0 2px 3px rgba(255,255,255,.4); }
.swatch.sel { box-shadow: 0 0 0 3px var(--ink), 0 6px 10px -4px rgba(16,24,40,.35); }
@media (prefers-reduced-motion: reduce) { .btn, button, .ghost, nav.side a, .rv { transition: none; } .btn:hover, button:hover, nav.side a:hover { translate: none; } }
.lchip.on, .lchip.on b, .lchip.on span { color: #fff; }
.jump button { background-image: var(--surface-relief); color: var(--ink); border-color: transparent; box-shadow: var(--raise-sm); text-shadow: none; }
.jump button:hover { box-shadow: var(--relief); }
.sum .btn-sm, .sum button.btn-sm { background-image: none; text-shadow: none; box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 0 0 1px rgba(255,255,255,.14); }
.sum .btn-good { background-image: none; }
/* Otras piezas con volumen: tarjetas de analítica (.kc), de locales (.tcard), QR y zonas */
.kc, .tcard, .qr-box, .zone { border-color: transparent; background-image: var(--surface-relief); box-shadow: var(--relief); transition: translate .45s var(--ease), box-shadow .45s var(--ease); }
.tcard { border-left: 6px solid var(--tc, var(--accent)); border-radius: 18px; }
.kc:hover, .tcard:hover { translate: 0 -4px; box-shadow: var(--relief-hover); }
.kc.hot, .kc.on { background-image: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.urlbox { box-shadow: var(--inset); }
.pill { box-shadow: inset 0 1.5px 0 rgba(255,255,255,.6), 0 3px 6px -3px rgba(16,24,40,.25); }
.rank-row .rb { box-shadow: var(--inset); }
.dchip { box-shadow: inset 0 1px 0 rgba(255,255,255,.6); }

/* ===== Ícono propio (vectorizador) ===== */
.vec-grid { display: block; }
.vec-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 170px; border: 2px dashed color-mix(in srgb, var(--accent) 40%, var(--line)); border-radius: 18px; cursor: pointer; text-align: center; color: var(--ink-soft); background: color-mix(in srgb, var(--accent) 4%, transparent); transition: border-color .25s, background .25s, translate .3s var(--ease); }
.vec-drop svg { width: 30px; height: 30px; color: var(--accent); }
.vec-drop b { color: var(--ink); font-size: 15px; }
.vec-drop:hover, .vec-drop.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, transparent); translate: 0 -2px; }
.vec-out { display: flex; flex-wrap: wrap; gap: 22px; align-items: center; }
.vec-out[hidden], .vec-drop[hidden], #vecBtns[hidden] { display: none; }
.vec-big { width: 132px; height: 132px; border-radius: 26px; display: flex; align-items: center; justify-content: center; color: var(--ic); background-image: var(--surface-relief); box-shadow: var(--relief); }
.vec-big svg { width: 84px; height: 84px; display: block; }
#vecCard .meter span.on { color: var(--ic); }
#vecCard .meter span.half i { color: var(--ic); }
.vec-ctl { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 8px 0 10px; }
.vec-modes { display: inline-flex; background: var(--bg); border-radius: 999px; padding: 3px; box-shadow: var(--inset); }
.vec-modes .vm { background: transparent; background-image: none; color: var(--ink-soft); border: 0; padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; box-shadow: none; text-shadow: none; }
.vec-modes .vm.on { background-image: var(--surface-relief); color: var(--ink); box-shadow: var(--raise-sm); }
#vecInv.on { outline: 2px solid var(--accent); }
.vec-lbl { display: block; font-size: 12px; font-weight: 700; color: var(--ink-soft); margin: 6px 0 2px; }
#vecTh { width: 100%; max-width: 280px; accent-color: var(--accent); }

/* Enlace secundario en locales por activar */
.pend-alt { margin-top: 10px; }
.pend-alt summary { cursor: pointer; font-size: 13px; font-weight: 600; opacity: .75; padding: 4px 0; }
.pend-alt summary:hover { opacity: 1; }
.pend-alt[open] summary { margin-bottom: 6px; }

/* ================================================ Navegación clara: barra lateral con grupos, barra inferior y menú "Más" */

.nav-section-label { padding: 16px 10px 6px; font-size: 10.5px; letter-spacing: .09em; }
.nav-section-label:first-child { padding-top: 4px; }
nav.side a { position: relative; font-weight: 500; padding: 10px 12px; }
nav.side a.active { font-weight: 700; }
nav.side a.active::before { content: ""; position: absolute; left: -16px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--accent); }
nav.side a:focus-visible, .tab:focus-visible, .sheet-tile:focus-visible, .kpi.is-link:focus-visible, .rank-row.is-link:focus-visible, .sum-chips a:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; }

/* Solo celular */
.tabbar, .sheet, .sheet-back { display: none; }

/* Tarjetas y fichas que llevan a su sección */
.is-link { cursor: pointer; }
.kpi.is-link { transition: transform .25s var(--ease), box-shadow .25s; }
.kpi.is-link:hover { translate: 0 -3px; }
.kpi.is-link:active { translate: 0 0; scale: .985; }
.kpi-go { position: absolute; top: 14px; right: 14px; width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-style: normal; font-size: 20px; line-height: 1; padding-bottom: 2px; background: color-mix(in srgb, var(--c) 14%, var(--surface)); color: var(--c); transition: transform .25s var(--ease), background .2s; z-index: 2; }
.kpi.hot .kpi-go { background: rgba(255,255,255,.22); color: #fff; }
.kpi.is-link:hover .kpi-go { transform: translateX(3px); }
.kpi em a { position: relative; z-index: 2; }
.rank-row.is-link { border-radius: 12px; transition: background .2s; }
.rank-row.is-link:hover { background: var(--bg); }
.sum-chips a { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.16); border-radius: 999px; padding: 6px 13px; font-size: 13px; color: inherit; text-decoration: none; transition: background .2s, translate .2s var(--ease); }
.sum-chips a:hover { background: rgba(255,255,255,.24); translate: 0 -2px; }
.sum-chips a b { font-size: 15px; margin-right: 4px; font-variant-numeric: tabular-nums; }

@media (max-width: 720px) {
  /* Barra superior: marca + local activo, sin menú apretado */
  aside { padding: 10px 14px; gap: 12px; padding-bottom: 10px; }
  aside nav.side, aside .side-footer { display: none; }
  .ctx { flex: 1; max-width: none; min-width: 0; padding: 6px 12px; border-radius: 12px; }
  .ctx label { display: block; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; margin: 0; }
  .ctx select { font-size: 15px; text-overflow: ellipsis; }
  .ctx-own div { display: block; min-width: 0; } .ctx-own strong { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .brand-mark { flex-shrink: 0; }
  main { padding-bottom: calc(104px + env(safe-area-inset-bottom)); }
  .savebar { bottom: calc(84px + env(safe-area-inset-bottom)); }

  /* Barra inferior */
  .tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; align-items: stretch; gap: 2px;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 90%, transparent); -webkit-backdrop-filter: saturate(1.6) blur(16px); backdrop-filter: saturate(1.6) blur(16px);
    border-top: 1px solid var(--line); box-shadow: 0 -10px 30px -12px rgba(16,24,40,.25); }
  .tab { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 54px; padding: 6px 2px; border: 0; background: none; border-radius: 14px;
    color: var(--ink-soft); font: inherit; font-size: 11px; font-weight: 600; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: color .2s, background .2s, scale .15s; }
  .tab svg { width: 23px; height: 23px; transition: transform .35s var(--ease); }
  .tab:active { scale: .94; }
  .tab.active { color: var(--accent); font-weight: 800; background: var(--accent-soft); }
  .tab.active svg { transform: translateY(-1px) scale(1.08); }
  .tab.active::after { content: ""; position: absolute; top: 2px; width: 18px; height: 3px; border-radius: 3px; background: var(--accent); }
  .tab-more svg { fill: currentColor; }

  /* Menú "Más" */
  .sheet-back { display: block; position: fixed; inset: 0; z-index: 50; background: rgba(8,10,20,.5); opacity: 0; transition: opacity .28s; -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
  .sheet-back.on { opacity: 1; }
  .sheet-back[hidden], .sheet[hidden] { display: none; }
  .sheet { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; max-height: 88vh; overflow-y: auto; overscroll-behavior: contain; padding: 8px 18px calc(22px + env(safe-area-inset-bottom));
    background: var(--surface); border-radius: 26px 26px 0 0; box-shadow: 0 -20px 50px rgba(0,0,0,.3); transform: translateY(105%); transition: transform .32s var(--ease); }
  .sheet.on { transform: none; }
  .sheet-grab { width: 42px; height: 5px; border-radius: 5px; background: var(--line); margin: 4px auto 10px; }
  .sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; font-size: 17px; }
  .sheet-x { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--bg); color: var(--ink); display: flex; align-items: center; justify-content: center; padding: 0; }
  .sheet-x svg { width: 18px; height: 18px; }
  .sheet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
  .sheet-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--ink); font-weight: 700; font-size: 14.5px; text-decoration: none; box-shadow: var(--shadow); transition: scale .15s, background .2s; }
  .sheet-tile svg { width: 38px; height: 38px; padding: 9px; border-radius: 12px; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
  .sheet-tile:active { scale: .97; }
  .sheet-tile.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
  .sheet-sec { border-top: 1px solid var(--line); padding-top: 14px; }
  .sheet .side-colors { display: block; padding: 0 0 10px; }
  .sheet .pcol { width: 30px; height: 30px; }
  .sheet .sc-row { gap: 10px; }
  .sheet-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; }
  .sheet-row .theme-toggle { width: auto; flex: 1; margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; font-size: 14px; }
  .sheet-row .theme-toggle .nav-text, .sheet-row .logout .nav-text { display: inline; }
  .sheet-row .logout { padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; font-size: 14px; }
  body.sheet-open { overflow: hidden; }
  .kpi-go { top: 10px; right: 10px; }
}
@media (prefers-reduced-motion: reduce) { .sheet, .sheet-back, .tab, .tab svg { transition: none; } }

/* Ajustes finos: los botones de la barra inferior y del menú no heredan el relieve de los botones normales */
.tabbar button.tab, .sheet button.sheet-x { background-image: none !important; box-shadow: none !important; border: 0 !important; translate: none !important; }
.tabbar button.tab { background-color: transparent !important; }
.tabbar button.tab.active { background-color: var(--accent-soft) !important; }
.sheet button.sheet-x { background-color: var(--bg) !important; color: var(--ink) !important; }
@media (max-width: 720px) {
  .ctx { display: flex; flex-direction: column; justify-content: center; min-height: 52px; }
  .ctx select { padding: 0; height: 24px; background-image: none; box-shadow: none; border: 0; }
  .ctx-own { flex-direction: row; }
}
@media (max-width: 720px) { .ctx { min-height: 0; padding: 7px 12px; } .ctx select { min-height: 0; height: 22px; } }


/* ===== Logo de la esquina lleva a Personalizar ===== */
a.brand { color: inherit; text-decoration: none; border-radius: 12px; transition: background .2s, transform .2s; }
a.brand:hover, a.brand:focus-visible { background: color-mix(in srgb, var(--accent) 10%, transparent); outline: none; }
a.brand:active { transform: scale(.98); }
.brand-edit { margin-left: auto; width: 26px; height: 26px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); opacity: 0; transform: scale(.8); transition: opacity .2s, transform .25s var(--ease); }
.brand-edit svg { width: 14px; height: 14px; }
a.brand:hover .brand-edit, a.brand:focus-visible .brand-edit { opacity: 1; transform: none; }
@media (hover: none) { .brand-edit { display: none; } }

/* ===== Panel de un local: solo "Estás viendo X", sin caja de selección ===== */
.ctx.ctx-own { background: transparent; box-shadow: none; padding: 2px 12px 14px; margin-bottom: 8px; }
.ctx.ctx-own small { text-transform: uppercase; letter-spacing: .06em; font-size: 10.5px; font-weight: 700; color: var(--ink-soft); }
.ctx.ctx-own strong { font-size: 17px; line-height: 1.2; }

/* ===== Enlace del panel de cada local (Locales) ===== */
.plink { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 7px 8px 7px 12px; border: 1px dashed var(--line); border-radius: 12px; background: var(--bg); min-width: 0; }
.plink > span { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); flex: none; }
.plink code { flex: 1; min-width: 0; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.plink .btn-sm { flex: none; }

/* ===== Explicación del QR ===== */
.qr-how { position: relative; }
.qr-how h2 { margin-bottom: 4px; }
.qr-how .lead { margin: 0 0 14px; color: var(--ink-soft); font-size: 14px; line-height: 1.5; }
.how-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: hs; }
.how-steps li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); counter-increment: hs; line-height: 1.45; font-size: 14px; }
.how-steps li::before { content: counter(hs); flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 800; font-size: 13px; display: flex; align-items: center; justify-content: center; margin-top: 1px; }
.how-steps b { color: var(--ink); }
.how-more { margin-top: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; }
.how-more summary { cursor: pointer; padding: 12px 14px; font-weight: 700; font-size: 14px; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.how-more summary::-webkit-details-marker { display: none; }
.how-more summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--ink-soft); border-bottom: 2px solid var(--ink-soft); transform: rotate(45deg); transition: transform .25s var(--ease); margin-right: 4px; }
.how-more[open] summary::after { transform: rotate(-135deg); }
.how-more .how-body { padding: 0 14px 14px; font-size: 13.5px; line-height: 1.55; color: var(--ink-soft); }
.how-more .how-body ol { margin: 8px 0 0; padding-left: 20px; } .how-more .how-body li { margin: 4px 0; }
.how-tip { margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 9%, transparent); font-size: 13px; line-height: 1.45; }

/* ===== Transiciones fluidas entre pantallas, cambios y modo noche ===== */
html { background: var(--bg); }
html.leaving::after { content: ""; position: fixed; z-index: 10000; top: 0; left: 0; height: 3px; width: 0; border-radius: 0 3px 3px 0; background: linear-gradient(90deg, var(--accent), var(--accent-2, var(--accent))); box-shadow: 0 0 10px var(--accent); animation: navBarA 1.6s cubic-bezier(.2,.7,.2,1) forwards; }
@keyframes navBarA { to { width: 88%; } }
html.theme-anim *, html.theme-anim *::before, html.theme-anim *::after { transition: background-color .38s ease, color .38s ease, border-color .38s ease, box-shadow .38s ease, fill .38s ease, stroke .38s ease !important; }
aside nav.side a, .tabbar .tab, .seg a { transition: background-color .28s ease, color .28s ease, box-shadow .28s ease, transform .2s var(--ease); }
.btn, button, .ghost, .btn-sm { transition: background-color .22s ease, color .22s ease, border-color .22s ease, box-shadow .22s ease, transform .2s var(--ease), opacity .2s ease; }
.btn:active, button:active, .ghost:active, .btn-sm:active { transform: scale(.97); }
.switch input + *, .switch input { transition: all .25s var(--ease); }
@media (prefers-reduced-motion: reduce) { html.leaving::after { animation: none; width: 60%; } }

.busy-soft { opacity: .65; }

/* Borrar reseña: icono visible arriba a la derecha de cada tarjeta */
.rv-side { display: flex; align-items: center; gap: 8px; flex: none; }
.rv-x { margin: 0; }
.rv-x button { width: 34px; height: 34px; padding: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: color-mix(in srgb, #dc2626 10%, transparent); color: #dc2626; border: 1px solid color-mix(in srgb, #dc2626 28%, transparent); box-shadow: none; }
.rv-x button svg { width: 16px; height: 16px; }
.rv-x button:hover, .rv-x button:focus-visible { background: #dc2626; color: #fff; outline: none; transform: scale(1.06); }
@media (max-width: 520px) { .rv-side { flex-direction: column-reverse; align-items: flex-end; gap: 6px; } }


/* =========================================================
   Transición profesional entre pantallas + indicador que se desliza
   ========================================================= */
:root { --spring: cubic-bezier(.34, 1.32, .5, 1); }
@view-transition { navigation: auto; }
/* La página nueva aparece encima de la vieja (sin pasar por negro). Menú lateral y barra inferior se quedan quietos */
aside { view-transition-name: side; }
.tabbar { view-transition-name: tabbar; }
::view-transition-old(side), ::view-transition-old(tabbar) { display: none; }
::view-transition-new(side), ::view-transition-new(tabbar) { animation: none; }
::view-transition { background: var(--bg); }
::view-transition-old(root) { animation: vtOutA .17s cubic-bezier(.4, 0, 1, 1) both; mix-blend-mode: normal; }
::view-transition-new(root) { animation: vtInA .42s .1s cubic-bezier(.22, 1, .36, 1) both; mix-blend-mode: normal; }
::view-transition-group(root) { animation-duration: .55s; }
@keyframes vtOutA { to { opacity: 0; transform: translateY(-4px); } }
@keyframes vtInA { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
/* Si ya se estaba navegando dentro del panel, no repetir la entrada escalonada: la transición ya hace el trabajo */
html.vt body:not(.pr-entering) :is(main > *, .rtop > *, .kpis > *, .lgrid > *, .grid3 > *, aside nav.side a) { animation: none !important; }

.ind { position: absolute; left: 0; top: 0; z-index: 0; width: 0; height: 0; opacity: 0; pointer-events: none; will-change: transform, width, height;
  transition: transform .55s var(--spring), width .55s var(--spring), height .55s var(--spring), opacity .2s ease; }
.ind.no-anim { transition: none; }
nav.side.has-ind, .seg.has-ind, .seg2.has-ind { position: relative; }
nav.side.has-ind a, .seg.has-ind a, .seg2.has-ind button, .tabbar.has-ind .tab { position: relative; z-index: 1; }
nav.side.has-ind a.active { background: none !important; box-shadow: none !important; translate: none; }
nav.side.has-ind a.active::before { display: none; }
.seg.has-ind a.on { background: transparent !important; box-shadow: none !important; }
.seg2.has-ind button.on { background: transparent !important; }
.tabbar.has-ind .tab.active, .tabbar.has-ind button.tab.active { background: transparent !important; background-color: transparent !important; }
nav.side .ind { border-radius: 9px; background-color: var(--accent-soft); background-image: linear-gradient(180deg, color-mix(in srgb, var(--accent) 12%, #fff), color-mix(in srgb, var(--accent) 20%, #fff));
  box-shadow: inset 0 1.5px 0 rgba(255,255,255,.9), 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent), 0 8px 16px -8px color-mix(in srgb, var(--accent) 50%, transparent); }
html[data-theme="dark"] nav.side .ind { background-image: none; box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent), 0 8px 16px -8px color-mix(in srgb, var(--accent) 55%, transparent); }
nav.side .ind::before { content: ""; position: absolute; left: -16px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--accent); }
.seg .ind { border-radius: 999px; background: #fff; box-shadow: inset 0 1.5px 0 #fff, 0 6px 12px -4px rgba(0,0,0,.3); }
.zone-tools .seg .ind { background: var(--accent); box-shadow: 0 6px 12px -4px color-mix(in srgb, var(--accent) 60%, transparent); }
.tabbar .ind { border-radius: 14px; background: var(--accent-soft); }
.seg2 .ind { border-radius: 9px; background: var(--deep, var(--accent)); }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  .ind { transition: none; }
}

/* ===== Entrada unificada: la misma "rise" de las tarjetas de analíticas, en todo el panel ===== */
:root { --rise: rise .5s cubic-bezier(.22, 1, .36, 1) backwards; }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
main > *, .kgrid > *, .kpis > *, .lgrid > *, .rtop > *, .grid3 > *, .zones > *, .rv-list > *, .rcard, aside nav.side a { animation: var(--rise); animation-delay: calc(.06s + var(--i, 0) * .045s); }
main > :is(.kgrid, .kpis, .lgrid, .rtop, .grid3, .zones, .rv-list) { animation: none; }
main > :nth-child(1), .kgrid > :nth-child(1), .kpis > :nth-child(1), .lgrid > :nth-child(1), .rtop > :nth-child(1), .grid3 > :nth-child(1), .zones > :nth-child(1) { --i: 0; }
main > :nth-child(2), .kgrid > :nth-child(2), .kpis > :nth-child(2), .lgrid > :nth-child(2), .rtop > :nth-child(2), .grid3 > :nth-child(2), .zones > :nth-child(2) { --i: 1; }
main > :nth-child(3), .kgrid > :nth-child(3), .kpis > :nth-child(3), .lgrid > :nth-child(3), .rtop > :nth-child(3), .grid3 > :nth-child(3) { --i: 2; }
main > :nth-child(4), .kgrid > :nth-child(4), .kpis > :nth-child(4), .lgrid > :nth-child(4) { --i: 3; }
main > :nth-child(5), .kgrid > :nth-child(5), .kpis > :nth-child(5), .lgrid > :nth-child(5) { --i: 4; }
main > :nth-child(n+6), .kgrid > :nth-child(n+6), .kpis > :nth-child(n+6), .lgrid > :nth-child(n+6), .rv-list > :nth-child(n+6) { --i: 5; }
.rv-list > :nth-child(2), .rcard:nth-child(2) { --i: 1; } .rv-list > :nth-child(3), .rcard:nth-child(3) { --i: 2; } .rv-list > :nth-child(4), .rcard:nth-child(4) { --i: 3; } .rv-list > :nth-child(5), .rcard:nth-child(5) { --i: 4; }
.kc:nth-child(n) { animation-delay: calc(.06s + var(--i, 0) * .045s); }
html.vt body:not(.pr-entering) :is(main > *, .rtop > *, .kpis > *, .lgrid > *, .grid3 > *, aside nav.side a) { animation: var(--rise) !important; animation-delay: calc(.06s + var(--i, 0) * .045s) !important; }
html.vt body:not(.pr-entering) main > :is(.kgrid, .kpis, .lgrid, .rtop, .grid3, .zones, .rv-list), html.vt body:not(.pr-entering) aside nav.side a { animation: none !important; }
@keyframes vtInA { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { main > *, .kgrid > *, .kpis > *, .lgrid > *, .rtop > *, .grid3 > *, .zones > *, .rv-list > *, .rcard, html.vt body main > * { animation: none !important; } }
