/* ============ Tipografía (servida por el propio servidor) ============ */
/* Marca Dobletic: Archivo (texto y títulos anchos) + Chivo Mono (números). Omnibus-Type, licencia OFL. */
@font-face {
  font-family: "Archivo";
  src: url("/app/fonts/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Chivo Mono";
  src: url("/app/fonts/chivo-mono.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ============ Tokens ============ */
:root {
  /* color de marca: lo setea app.js según el negocio (paleta validada). Por defecto, cobalto Dobletic */
  --brand-light: #1f3dd6;
  --brand-dark: #7a91ff;
  --brand-ink-light: #ffffff;
  --brand-ink-dark: #04201c;

  --bg: #f3f4f7;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --surface-3: #eceef3;
  --ink: #0f1222;
  --ink-2: #2e3247;
  --muted: #565b70;
  --line: #e1e3ea;
  --accent: var(--brand-light);
  --accent-ink: var(--brand-ink-light);
  --accent-soft: color-mix(in srgb, var(--accent) 12%, var(--surface));
  --danger: #b91c1c;
  --danger-soft: #fef2f2;
  --warn: #92400e;
  --warn-soft: #fffbeb;
  --ok: #15803d;
  --ok-soft: #f0fdf4;
  --focus: #1f3dd6;
  /* Mandarina Dobletic: solo para crecimiento (metas, números que suben) */
  --growth: #e8571f;
  --growth-soft: #fff0e8;
  --dob-cobalto: #1f3dd6;
  --dob-tinta: #0f1222;
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-num: "Chivo Mono", ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(17, 24, 39, .04), 0 2px 8px rgba(17, 24, 39, .04);
  --shadow-lg: 0 12px 40px rgba(17, 24, 39, .14);
  --sidebar: 264px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0e1a;
    --surface: #151827;
    --surface-2: #1b1f31;
    --surface-3: #23283c;
    --ink: #edeff6;
    --ink-2: #cdd1e0;
    --muted: #a0a5ba;
    --line: #262a3d;
    --accent: var(--brand-dark);
    --accent-ink: var(--brand-ink-dark);
    --danger: #f87171;
    --danger-soft: #2a1515;
    --warn: #fbbf24;
    --warn-soft: #2a2110;
    --ok: #4ade80;
    --ok-soft: #10241a;
    --focus: #7a91ff;
    --growth: #ff8a5c;
    --growth-soft: #3a2218;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c0e1a;
  --surface: #151827;
  --surface-2: #1b1f31;
  --surface-3: #23283c;
  --ink: #edeff6;
  --ink-2: #cdd1e0;
  --muted: #a0a5ba;
  --line: #262a3d;
  --accent: var(--brand-dark);
  --accent-ink: var(--brand-ink-dark);
  --danger: #f87171;
  --danger-soft: #2a1515;
  --warn: #fbbf24;
  --warn-soft: #2a2110;
  --ok: #4ade80;
  --ok-soft: #10241a;
  --focus: #7a91ff;
  --growth: #ff8a5c;
  --growth-soft: #3a2218;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

/* ============ Base ============ */
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
.boot { display: grid; place-items: center; min-height: 100vh; color: var(--muted); }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 26px; font-weight: 800; font-stretch: 112%; }
h2 { font-size: 16px; font-weight: 700; }
h3 { font-size: 14px; font-weight: 650; }
p { margin: 0; }
a { color: var(--accent); }
img { max-width: 100%; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }
.mono { font-family: var(--font-num); font-size: 12.5px; word-break: break-all; }
.num { font-variant-numeric: tabular-nums; }

/* ============ Controles ============ */
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 8px 16px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; font-weight: 600; font-size: 14.5px; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s;
}
a.btn { text-decoration: none; color: var(--ink); }
a.btn.primary { color: var(--accent-ink); }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.btn.danger.solid { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { min-height: 34px; padding: 4px 12px; font-size: 13.5px; }
.btn.icon { width: 42px; padding: 0; }
.btn.block { width: 100%; }
.btn svg { width: 20px; height: 20px; flex: none; }

label.field, div.field { display: grid; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); align-content: start; }
.field .hint { font-weight: 400; color: var(--muted); font-size: 12.5px; }
input[type=text], input[type=search], input[type=email], input[type=password], input[type=tel], input[type=number],
input[type=date], input[type=time], input[type=datetime-local], select, textarea {
  width: 100%; min-height: 44px; padding: 9px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface); font-weight: 400; font-size: 15px; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
input[readonly] { background: var(--surface-2); }
.check { display: flex; align-items: center; gap: 10px; font-size: 14.5px; font-weight: 400; color: var(--ink); cursor: pointer; min-height: 32px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; margin: 0; }

.segmented { display: inline-flex; background: var(--surface-3); border-radius: 12px; padding: 3px; gap: 2px; }
.segmented button { border: 0; background: transparent; padding: 6px 14px; border-radius: 9px; font-weight: 600; font-size: 13.5px; cursor: pointer; color: var(--muted); min-height: 34px; }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

.grid { display: grid; gap: 14px; align-items: start; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 14px; }

/* ============ Layout ============ */
.layout { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  background: var(--surface); border-right: 1px solid var(--line); padding: 18px 14px;
  display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 6px 8px 18px; min-width: 0; }
.brand .grow { min-width: 0; }
.brand b { display: block; font-size: 15.5px; font-weight: 700; font-stretch: 105%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand small { color: var(--muted); font-size: 12.5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo {
  width: 42px; height: 42px; border-radius: 12px; flex: none; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 17px; overflow: hidden;
}
.logo.img { background: #fff; border: 1px solid var(--line); }
.logo img { width: 100%; height: 100%; object-fit: contain; }
.logo.lg { width: 64px; height: 64px; border-radius: 18px; font-size: 26px; }
.nav-group { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 14px 12px 6px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 11px;
  color: var(--ink-2); text-decoration: none; font-weight: 550; font-size: 14.5px;
}
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.nav svg { width: 20px; height: 20px; flex: none; }
.user-card {
  margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface-2); text-decoration: none; color: var(--ink);
}
.user-card:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--surface-3); color: var(--ink-2); font-weight: 700; font-size: 13.5px; text-decoration: none;
}
.user-card .grow { min-width: 0; flex: 1; }
.user-card b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-card small { color: var(--muted); font-size: 12px; }

.main { padding: 32px clamp(16px, 4vw, 48px) 64px; max-width: 1180px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head p { margin-top: 4px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; min-width: 0; }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card .desc { color: var(--muted); font-size: 13.5px; margin-top: 2px; }

.topbar, .tabbar { display: none; }

@media (max-width: 1023px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar {
    display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 20;
    background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line); padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  }
  .topbar .logo { width: 34px; height: 34px; border-radius: 10px; font-size: 14px; }
  .topbar b { font-size: 16px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px);
    border-top: 1px solid var(--line); padding: 6px 6px max(6px, env(safe-area-inset-bottom));
  }
  .tabbar.four { grid-template-columns: repeat(4, 1fr); }
  .tabbar a, .tabbar button {
    display: grid; justify-items: center; gap: 2px; padding: 6px 2px; border: 0; background: none; cursor: pointer;
    color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 600;
  }
  .tabbar svg { width: 24px; height: 24px; }
  .tabbar .active { color: var(--accent); }
  .tabbar .fab .circle {
    width: 50px; height: 50px; border-radius: 16px; background: var(--accent); color: var(--accent-ink);
    display: grid; place-items: center; margin-top: -20px; box-shadow: var(--shadow-lg);
  }
  .main { padding: 20px 16px calc(100px + env(safe-area-inset-bottom)); }
  h1 { font-size: 22px; }
  .page-head { align-items: flex-start; margin-bottom: 18px; }
}

/* ============ Inicio (dashboard) ============ */
.dash { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.dash > * { margin: 0 !important; min-width: 0; }
.w-12 { grid-column: span 12; }
.w-8 { grid-column: span 8; }
.w-6 { grid-column: span 6; }
.w-4 { grid-column: span 4; }
@media (max-width: 1023px) { .w-8, .w-6, .w-4 { grid-column: span 12; } }

.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (min-width: 1400px) { .kpis { grid-template-columns: repeat(6, 1fr); } }
@media (max-width: 600px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.kpi .label { color: var(--muted); font-size: 13px; font-weight: 600; }
.kpi .value { font-family: var(--font-num); font-size: 27px; font-weight: 600; letter-spacing: -.03em; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .delta { font-size: 12.5px; font-weight: 600; margin-top: 2px; color: var(--muted); }
.kpi .delta.up { color: var(--ok); }
.kpi .delta.down { color: var(--danger); }
@media (max-width: 600px) { .kpi { padding: 14px; } .kpi .value { font-size: 23px; } }
.meter { height: 8px; border-radius: 99px; background: color-mix(in srgb, var(--accent) 16%, var(--surface-2)); overflow: hidden; margin-top: 10px; }
.meter > i { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.hero { font-family: var(--font-num); font-size: 50px; font-weight: 600; letter-spacing: -.02em; line-height: 1; }
.banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--radius); background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 25%, transparent); margin-bottom: 16px; flex-wrap: wrap; }
.banner .grow { flex: 1; min-width: 180px; }

/* gráfico de columnas */
.chart { position: relative; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; shape-rendering: crispEdges; }
.chart .baseline { stroke: var(--muted); stroke-width: 1; opacity: .5; shape-rendering: crispEdges; }
.chart .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .bar { fill: var(--accent); transition: opacity .1s; }
.chart .bar.dim { opacity: .45; }
.chart .hit { fill: transparent; cursor: pointer; }
.tooltip {
  position: absolute; pointer-events: none; background: var(--ink); color: var(--bg); padding: 6px 10px; border-radius: 8px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap; transform: translate(-50%, calc(-100% - 8px)); box-shadow: var(--shadow-lg); z-index: 5;
}
details.data-table { margin-top: 12px; font-size: 13px; }
details.data-table summary { cursor: pointer; color: var(--muted); font-weight: 600; }
details.data-table table { margin-top: 8px; }

/* barras horizontales */
.hbars { display: grid; gap: 14px; }
.hbar { display: grid; grid-template-columns: minmax(70px, 36%) 1fr auto; gap: 12px; align-items: center; font-size: 14px; }
.hbar .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
.hbar .track { height: 12px; position: relative; }
.hbar .track i { position: absolute; inset: 0 auto 0 0; border-radius: 0 4px 4px 0; background: var(--accent); min-width: 3px; }
.hbar .val { font-weight: 650; font-variant-numeric: tabular-nums; color: var(--ink); text-align: right; }
.hbar .val small { display: block; color: var(--muted); font-weight: 500; font-size: 11.5px; }

.today-list { display: grid; }
.today-item { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.today-item:first-child { border-top: 0; }
.today-item .t { font-weight: 750; font-variant-numeric: tabular-nums; }
.today-item .w { min-width: 0; }
.today-item .w b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 650; }
.today-item .w span { color: var(--muted); font-size: 13px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.widget-list { display: grid; gap: 8px; }
.widget-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; }
.widget-row .check { flex: 1; }

/* ============ Agenda ============ */
.datebar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.datebar .day-title { font-weight: 700; font-size: 17px; }
.datebar input[type=date], .datebar select { width: auto; min-width: 150px; }
.appt { display: grid; grid-template-columns: 70px 1fr auto; gap: 14px; align-items: start; padding: 16px 0; border-top: 1px solid var(--line); }
.appt:first-child { border-top: 0; padding-top: 4px; }
.appt .time { font-weight: 750; font-size: 17px; font-variant-numeric: tabular-nums; }
.appt .time small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
.appt .who { font-weight: 650; font-size: 15.5px; }
.appt .meta { color: var(--muted); font-size: 13.5px; margin-top: 4px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.appt .note { font-size: 13.5px; margin-top: 8px; padding: 8px 12px; background: var(--surface-2); border-radius: 10px; color: var(--ink-2); }
.appt.off { opacity: .55; }
.appt .actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 600px) {
  .appt { grid-template-columns: 56px 1fr; }
  .appt .actions { grid-column: 1 / -1; justify-content: flex-start; }
  .datebar input[type=date], .datebar select { flex: 1; }
  .datebar .day-title { width: 100%; order: -1; }
}
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 650; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.chip.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.chip.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chip.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
/* Los 4 contadores entran siempre en la tarjeta: columnas que se achican y texto que puede bajar de renglón */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
@media (max-width: 600px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; min-width: 0; }
.stats .stat { padding: 10px 8px; text-align: center; }
.stats .stat span { display: block; font-size: 11.5px; line-height: 1.25; }
/* En una tarjeta angosta (media columna en tablet), 2 x 2 en vez de cortar las palabras */
.stats-wrap { container-type: inline-size; }
@container (max-width: 380px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat b { display: block; font-family: var(--font-num); font-size: 21px; font-weight: 600; letter-spacing: -.02em; }
.stat span { color: var(--muted); font-size: 12.5px; }
.empty { text-align: center; padding: 36px 12px; color: var(--muted); display: grid; justify-items: center; gap: 6px; }
.empty svg { width: 40px; height: 40px; opacity: .45; }

/* ============ Listas ============ */
.list-item { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.list-item:first-child { border-top: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 650; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
@media (max-width: 600px) { .list-item { flex-wrap: wrap; } .list-item > .row:last-child { width: 100%; } }

/* ============ Equipo ============ */
.hours { display: grid; gap: 10px; }
.hours-row { display: grid; grid-template-columns: 96px 1fr; gap: 10px; align-items: start; }
.hours-row .dayname { font-weight: 600; padding-top: 10px; }
.ranges { display: grid; gap: 6px; }
.range { display: flex; gap: 6px; align-items: center; }
.range input { width: 124px; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 4px 12px; }
@media (max-width: 600px) {
  .hours-row { grid-template-columns: 1fr; gap: 4px; }
  .hours-row .dayname { padding-top: 0; }
  .range input { flex: 1; width: auto; min-width: 0; }
}
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; max-height: 220px; overflow: auto; padding: 2px; }
.slots > span { grid-column: 1 / -1; }
.slot { min-height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-variant-numeric: tabular-nums; font-weight: 650; }
.slot[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* ============ Marca ============ */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.swatch { display: flex; align-items: center; gap: 10px; text-align: left; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--ink); }
.swatch i { width: 22px; height: 22px; border-radius: 7px; flex: none; }
.swatch[aria-checked="true"] { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.logo-edit { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.logo-preview { width: 96px; height: 96px; border-radius: 22px; border: 1px dashed var(--line); background: #fff; display: grid; place-items: center; overflow: hidden; font-size: 34px; font-weight: 800; color: var(--accent); }
.logo-preview img { width: 100%; height: 100%; object-fit: contain; }

/* ============ WhatsApp ============ */
.wa-status { display: flex; gap: 16px; align-items: center; }
.wa-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--muted); flex: none; }
.wa-dot.on { background: var(--ok); box-shadow: 0 0 0 5px var(--ok-soft); }
.wa-dot.wait { background: var(--warn); box-shadow: 0 0 0 5px var(--warn-soft); }
.qr { display: grid; justify-items: center; gap: 14px; padding: 10px 0; }
.qr img { width: 264px; height: 264px; border-radius: 16px; background: #fff; padding: 10px; }
.pair { display: grid; justify-items: center; gap: 14px; padding: 10px 0; }
.pair-code { font-size: 40px; font-weight: 700; letter-spacing: .14em; padding: 14px 22px; border-radius: 14px; background: var(--surface-2); user-select: all; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.notice { padding: 12px 14px; border-radius: 12px; background: var(--warn-soft); color: var(--ink); font-size: 13.5px; }
.notice.info { background: var(--accent-soft); }

/* ============ Login ============ */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-side {
  background:
    radial-gradient(900px 500px at 10% 0%, color-mix(in srgb, var(--brand-light) 90%, #fff 10%) 0%, transparent 60%),
    linear-gradient(160deg, color-mix(in srgb, var(--brand-light) 80%, #000) 0%, #0f1222 100%);
  color: #fff; padding: 48px clamp(32px, 5vw, 72px); display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
}
.auth-side .logo { background: rgba(255, 255, 255, .16); color: #fff; }
.auth-side .logo.img { background: #fff; border: 0; }
.auth-side h2 { font-size: clamp(28px, 3vw, 40px); line-height: 1.1; font-weight: 800; font-stretch: 120%; letter-spacing: -.02em; max-width: 540px; }
.auth-side ul { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 16px; max-width: 460px; }
.auth-side li { display: flex; gap: 12px; align-items: flex-start; color: rgba(255, 255, 255, .9); }
.auth-side li svg { width: 22px; height: 22px; flex: none; }
.auth-side small { color: rgba(255, 255, 255, .6); }
.auth-main { display: grid; place-items: center; padding: 32px 20px; background: var(--surface); }
.auth-box { width: 100%; max-width: 400px; }
.auth-box h1 { font-size: 28px; }
.auth-box .sub { color: var(--muted); margin-top: 6px; }
.auth-mobile-brand { display: none; }
.error { color: var(--danger); font-size: 13.5px; min-height: 1em; }
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-main { place-items: start center; padding-top: max(48px, env(safe-area-inset-top)); }
  .auth-mobile-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 32px; }
}

/* ============ Diálogos ============ */
dialog {
  border: 0; border-radius: 20px; padding: 0; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg);
}
dialog::backdrop { background: rgba(8, 12, 16, .5); backdrop-filter: blur(2px); }
dialog .d-head { padding: 20px 22px 0; }
dialog .d-body { padding: 16px 22px; max-height: calc(100vh - 220px); overflow: auto; }
dialog .d-foot { padding: 12px 22px 20px; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
@media (max-width: 600px) {
  dialog { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 22px 22px 0 0; max-height: 92vh; }
  dialog .d-body { max-height: calc(92vh - 150px); }
  dialog .d-foot { padding-bottom: max(20px, env(safe-area-inset-bottom)); }
  dialog .d-foot .btn { flex: 1; }
}
.sheet-menu { display: grid; gap: 4px; }
.sheet-menu a { display: flex; align-items: center; gap: 14px; padding: 14px 12px; border-radius: 12px; text-decoration: none; color: var(--ink); font-weight: 600; }
.sheet-menu a:hover, .sheet-menu a.active { background: var(--surface-2); }
.sheet-menu svg { width: 22px; height: 22px; color: var(--muted); }

#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 100; width: min(440px, calc(100vw - 32px)); }
@media (max-width: 1023px) { #toasts { bottom: calc(88px + env(safe-area-inset-bottom)); } }
.toast { background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 500; animation: rise .2s ease-out; }
.toast.error { background: var(--danger); color: #fff; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ============ Tablas ============ */
table.log { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.log td, table.log th { text-align: left; padding: 10px 8px; border-top: 1px solid var(--line); vertical-align: top; }
table.log th { color: var(--muted); font-weight: 600; border-top: 0; font-size: 12.5px; }
@media (max-width: 700px) {
  table.log thead { display: none; }
  table.log tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 12px 0; border-top: 1px solid var(--line); }
  table.log td { border: 0; padding: 0; }
  table.log td:nth-child(2) { grid-column: 1 / -1; order: -1; }
  table.log td:nth-child(1) { color: var(--muted); font-size: 12.5px; }
  table.log td:nth-child(4) { text-align: right; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* =====================================================================
   v0.5 — terminación visual
   ===================================================================== */

/* Colores por profesional: paleta categórica validada (orden fijo, nunca se recicla) */
:root {
  --c0: #2a78d6; --c1: #eb6834; --c2: #1baf7a; --c3: #eda100;
  --c4: #e87ba4; --c5: #008300; --c6: #4a3aa7; --c7: #e34948;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --c0: #3987e5; --c1: #d95926; --c2: #199e70; --c3: #c98500;
    --c4: #d55181; --c5: #008300; --c6: #9085e9; --c7: #e66767;
  }
}
:root[data-theme="dark"] {
  --c0: #3987e5; --c1: #d95926; --c2: #199e70; --c3: #c98500;
  --c4: #d55181; --c5: #008300; --c6: #9085e9; --c7: #e66767;
}

h1 { letter-spacing: -.02em; }

/* Iconos de línea */
svg.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tabbar svg.i { width: 24px; height: 24px; }

/* Arranque */
.boot-dot { width: 42px; height: 42px; border-radius: 14px; background: var(--accent); animation: breathe 1.2s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(.85); opacity: .6; } }

/* Entrada de cada sección */
.main.enter > * { animation: enter .28s cubic-bezier(.2, .7, .2, 1) both; }
.main.enter > *:nth-child(2) { animation-delay: .03s; }
.main.enter > *:nth-child(3) { animation-delay: .06s; }
.main.enter > *:nth-child(n+4) { animation-delay: .09s; }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Esqueletos de carga */
.skel { position: relative; overflow: hidden; background: var(--surface-3); border-radius: 10px; }
.skel::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface) 70%, transparent), transparent);
  animation: shimmer 1.3s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }
.skel-page { display: grid; gap: 16px; }
.skel-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }

/* Botón cargando */
.btn.loading { color: transparent !important; position: relative; pointer-events: none; }
.btn.loading > * { visibility: hidden; }
.btn.loading::after {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid var(--ink); border-right-color: transparent; border-left-color: transparent; animation: spin .7s linear infinite;
}
.btn.primary.loading::after { border-color: var(--accent-ink); border-right-color: transparent; border-left-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Avisos con icono */
.toast { display: flex; align-items: center; gap: 10px; }

/* Interruptor tipo iOS */
input.switch {
  appearance: none; -webkit-appearance: none; width: 46px; height: 28px; border-radius: 99px; flex: none; margin: 0;
  background: var(--surface-3); border: 1px solid var(--line); position: relative; cursor: pointer; transition: background .2s, border-color .2s;
}
input.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s cubic-bezier(.3, .7, .3, 1);
}
input.switch:checked { background: var(--accent); border-color: var(--accent); }
input.switch:checked::after { transform: translateX(18px); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); cursor: pointer; font-weight: 500; color: var(--ink); font-size: 14.5px; }
.switch-row:first-child { border-top: 0; padding-top: 4px; }
.switch-row small { display: block; color: var(--muted); font-weight: 400; font-size: 12.5px; margin-top: 2px; }
.switch-group { display: grid; }

/* Barra de guardar fija */
.savebar {
  position: sticky; bottom: 12px; z-index: 15; margin-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px 12px 18px; border-radius: 16px; background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(12px); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
}
.savebar > span { color: var(--muted); font-size: 13.5px; }
@media (max-width: 1023px) { .savebar { bottom: calc(80px + env(safe-area-inset-bottom)); } }

/* Chips de días */
.daychips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 6px; scroll-snap-type: x proximity; }
.daychips::-webkit-scrollbar { display: none; }
.daychip {
  flex: none; display: grid; justify-items: center; min-width: 58px; padding: 8px 10px; border-radius: 14px; cursor: pointer; position: relative;
  border: 1px solid var(--line); background: var(--surface); scroll-snap-align: center; color: var(--ink); font: inherit;
}
.daychip small { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: capitalize; }
.daychip b { font-size: 18px; font-weight: 750; line-height: 1.2; }
.daychip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.daychip[aria-pressed="true"] small { color: inherit; opacity: .85; }
.daychip.today:not([aria-pressed="true"]) b { color: var(--accent); }
.daychip.pick { align-content: center; color: var(--muted); }
.daychip input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; bottom: 0; left: 50%; }

/* Avatares */
.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 60px; height: 60px; font-size: 19px; }
.avatar.sm { width: 26px; height: 26px; font-size: 11px; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block; }

/* Selector de color del profesional */
.colorpick { display: flex; gap: 8px; flex-wrap: wrap; }
.colorpick button { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line); cursor: pointer; padding: 0; }
.colorpick button[aria-checked="true"] { box-shadow: 0 0 0 2px var(--ink); }

/* ============ Agenda: vista calendario ============ */
.agenda-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 6px 0 14px; }
.cal-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.cal-scroll { overflow: auto; max-height: calc(100vh - 300px); min-height: 380px; overscroll-behavior-x: contain; }
@media (max-width: 1023px) { .cal-scroll { max-height: calc(100vh - 340px); } }
.cal { display: grid; position: relative; min-width: 100%; }
.cal-head { position: sticky; top: 0; z-index: 4; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); padding: 10px 8px; display: flex; align-items: center; gap: 8px; min-width: 0; }
.cal-head .grow { min-width: 0; }
.cal-head b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-head small { color: var(--muted); font-size: 12px; }
.cal-corner { position: sticky; left: 0; top: 0; z-index: 6; background: var(--surface); border-bottom: 1px solid var(--line); }
.cal-times { position: sticky; left: 0; z-index: 3; background: var(--surface); }
.cal-times span { position: absolute; right: 8px; transform: translateY(-50%); font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cal-col { position: relative; border-left: 1px solid var(--line); cursor: copy; }
.cal-hour { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); pointer-events: none; }
.cal-hour.half { border-top-style: dashed; opacity: .55; }
.cal-off { position: absolute; left: 0; right: 0; pointer-events: none;
  background: repeating-linear-gradient(135deg, transparent 0 7px, color-mix(in srgb, var(--ink) 6%, transparent) 7px 8px), color-mix(in srgb, var(--surface-2) 75%, transparent); }
.cal-timeoff { position: absolute; left: 4px; right: 4px; border-radius: 10px; padding: 6px 8px; font-size: 12px; color: var(--muted); font-weight: 600; pointer-events: none; overflow: hidden;
  background: repeating-linear-gradient(45deg, var(--surface-2) 0 8px, var(--surface-3) 8px 16px); border: 1px dashed var(--line); }
.cal-ev {
  position: absolute; left: 4px; right: 4px; border-radius: 10px; padding: 5px 8px 5px 10px; overflow: hidden; cursor: pointer; text-align: left;
  background: color-mix(in srgb, var(--ev) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--ev) 30%, var(--line));
  border-left: 4px solid var(--ev); color: var(--ink); font: inherit; box-shadow: 0 1px 2px rgba(0, 0, 0, .04); transition: transform .1s, box-shadow .15s; z-index: 1;
}
.cal-ev:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); z-index: 2; }
.cal-ev b { display: block; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev span { display: block; font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev .t { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cal-ev.compact { padding-top: 1px; padding-bottom: 1px; }
.cal-ev.compact span { display: none; }
.cal-ev.completed { background: color-mix(in srgb, var(--ev) 7%, var(--surface)); }
.cal-ev.completed b::before { content: "✓ "; color: var(--ok); }
.cal-ev.no_show { opacity: .7; background: repeating-linear-gradient(45deg, var(--danger-soft) 0 6px, var(--surface) 6px 12px); border-left-color: var(--danger); }
.cal-ev.no_show b { text-decoration: line-through; }
.cal-ev.cancelled { opacity: .45; border-style: dashed; }
.cal-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); z-index: 3; pointer-events: none; }
.cal-now::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }

/* Detalle de turno */
.detail-head { display: flex; gap: 14px; align-items: center; }
.detail-grid { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; font-size: 14.5px; margin: 0; }
.detail-grid dt { color: var(--muted); }
.detail-grid dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }

/* Tirar para actualizar */
.ptr { position: fixed; top: 8px; left: 50%; z-index: 30; width: 40px; height: 40px; margin-left: -20px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-lg); display: grid; place-items: center; color: var(--accent); transform: translateY(-70px); }
.ptr.spin svg { animation: spin .7s linear infinite; }

/* Mini gráfico de tendencia */
.spark { display: block; width: 100%; height: 30px; margin-top: 8px; overflow: visible; }
.spark polyline { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark path { fill: var(--accent); opacity: .1; stroke: none; }
.spark circle { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.chart .bar.past { opacity: .5; }

/* Próximo turno */
.next-up {
  display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-radius: var(--radius); margin-bottom: 16px; flex-wrap: wrap;
  background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 16%, var(--surface)), var(--surface) 70%);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line));
}
.next-up .clock { width: 48px; height: 48px; border-radius: 14px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; flex: none; }
.next-up .clock svg.i { width: 26px; height: 26px; }
.next-up .grow { flex: 1; min-width: 180px; }
.next-up small { color: var(--muted); font-weight: 650; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.next-up b { display: block; font-size: 18px; font-weight: 750; }
.next-up .in { font-weight: 700; color: var(--accent); white-space: nowrap; font-size: 15px; }

/* Ilustraciones */
.illus { width: 132px; height: 100px; display: block; }
.illus .bg { fill: var(--accent-soft); }
.illus .st { fill: none; stroke: var(--ink-2); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.illus .ac { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.illus .fl { fill: var(--surface); }
.empty b { color: var(--ink); font-size: 15.5px; }

/* Login: vista previa del panel */
.mock { margin-top: 36px; max-width: 440px; display: grid; gap: 10px; transform: perspective(900px) rotateY(-7deg) rotateX(3deg); transform-origin: left center; }
.mock-card { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16); border-radius: 16px; padding: 14px 16px; backdrop-filter: blur(6px); }
.mock-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mock-kpi small { display: block; font-size: 11px; color: rgba(255, 255, 255, .72); }
.mock-kpi b { font-family: var(--font-num); font-size: 21px; font-weight: 600; color: #fff; }
.mock-bars { display: flex; align-items: flex-end; gap: 6px; height: 64px; margin-top: 8px; }
.mock-bars i { flex: 1; background: rgba(255, 255, 255, .85); border-radius: 4px 4px 0 0; }
.mock-bars i.dim { opacity: .5; }
.mock-ev { display: flex; align-items: center; gap: 10px; font-size: 13px; color: rgba(255, 255, 255, .92); }
.mock-ev i { width: 4px; height: 32px; border-radius: 4px; background: #fff; flex: none; }
.mock-ev small { display: block; color: rgba(255, 255, 255, .65); font-size: 11.5px; }
@media (max-height: 780px) { .mock { display: none; } }

/* Instalar app */
.install-card { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.install-card .grow { flex: 1; min-width: 200px; }

.grow { min-width: 0; }
.widget-row .grow { flex: 1; font-weight: 600; }
.chip svg.i { width: 13px; height: 13px; stroke-width: 2.2; }
.btn svg.i { width: 19px; height: 19px; }
.banner svg.i { color: var(--warn); }
.segmented button { display: inline-flex; align-items: center; gap: 6px; }
.segmented svg.i { width: 16px; height: 16px; }

/* Las columnas del layout no se estiran por contenido ancho (tira de días, grilla): scrollean adentro */
.layout > div, .main { min-width: 0; }
.today-item .w span.dot { display: inline-block; vertical-align: middle; }

@media (max-width: 600px) {
  .stats { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .stats .stat { padding: 8px 6px; text-align: center; border-radius: 12px; }
  .stats .stat b { font-size: 18px; }
  .stats .stat span { font-size: 10.5px; line-height: 1.2; display: block; }
}

/* Aviso fijo del shell (WhatsApp desconectado) */
.shell-alert:empty { display: none; }
.shell-alert { padding: 16px clamp(16px, 4vw, 48px) 0; max-width: 1180px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.shell-alert > :empty { display: none; }
.shell-alert .banner { margin: 0; }
.banner.danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.banner.danger svg.i { color: var(--danger); }
@media (max-width: 1023px) { .shell-alert { padding: 12px 16px 0; } }

/* Mini columnas (consola: mensajes por día). Una sola serie, punta redondeada, hoy destacado. */
.mini-cols { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; align-items: end; height: 70px; margin-top: 8px; border-bottom: 1px solid var(--line); }
.mini-cols span { height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.mini-cols i { display: block; width: 100%; max-width: 18px; background: var(--accent); border-radius: 4px 4px 0 0; }
.mini-cols i.past { opacity: .5; }
a.list-item { text-decoration: none; color: inherit; border-radius: 10px; }
a.list-item:hover { background: var(--surface-2); }

/* Consola: 4 indicadores por fila */
.kpis.four { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .kpis.four { grid-template-columns: repeat(2, 1fr); } }

/* Consola: lista de negocios como tarjetas en el celular */
@media (max-width: 700px) {
  table.log.tenants tr { grid-template-columns: 1fr 1fr; gap: 8px 14px; padding: 14px 0; }
  table.log.tenants td:nth-child(1) { grid-column: 1 / -1; order: 0; color: var(--ink); font-size: 14px; }
  table.log.tenants td:nth-child(2) { order: 0; grid-column: auto; }
  table.log.tenants td[data-label] { justify-items: start; }
  table.log.tenants td[data-label] { display: grid; gap: 2px; text-align: left; color: var(--ink); font-size: 13.5px; }
  table.log.tenants td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: 11.5px; font-weight: 600; }
}

/* Clientes */
.list-item .val { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.list-item .time { min-width: 76px; }
a.stat { text-decoration: none; color: inherit; }
a.stat:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
button.chip { cursor: pointer; font: inherit; font-size: 12px; font-weight: 650; }
.agenda-tools select { width: auto; min-width: 170px; }

/* ============ Ayuda ============ */
.help-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 18px;
  padding: 26px 26px; border-radius: 20px; border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line));
  background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 16%, var(--surface)), var(--surface) 75%);
}
.help-hero > div { max-width: 640px; }
.help-hero p { margin-top: 8px; color: var(--ink-2); font-size: 15.5px; }
.section-title { margin: 28px 0 12px; font-size: 18px; }
.benefits { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.benefit { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.benefit h3 { font-size: 15px; margin-bottom: 4px; }
.benefit p { color: var(--muted); font-size: 13.5px; }
.benefit-ic { width: 40px; height: 40px; border-radius: 12px; flex: none; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.benefit-ic.sm { width: 32px; height: 32px; border-radius: 10px; }
.benefit-ic.sm svg.i { width: 18px; height: 18px; }
.steps-list { display: grid; gap: 4px; }
.step { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.step:first-child { border-top: 0; }
.step-n { width: 32px; height: 32px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 750; background: var(--surface-3); color: var(--ink-2); }
.step.done .step-n { background: var(--ok); color: #fff; }
.step.done b { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 60%, transparent); color: var(--muted); }
.step .grow { flex: 1; min-width: 200px; }
.help-split { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: center; margin-top: 24px; }
@media (max-width: 860px) { .help-split { grid-template-columns: 1fr; } }
.chat-demo { background: #efeae2; border-radius: 18px; padding: 16px; display: grid; gap: 6px; }
:root[data-theme="dark"] .chat-demo { background: #0b141a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chat-demo { background: #0b141a; } }
.cd-msg { max-width: 85%; padding: 7px 10px; border-radius: 10px; font-size: 14px; color: #111b21; box-shadow: 0 1px .5px rgba(0, 0, 0, .13); }
.cd-msg.in { justify-self: start; background: #fff; border-top-left-radius: 2px; }
.cd-msg.out { justify-self: end; background: #d9fdd3; border-top-right-radius: 2px; }
.cd-card { width: 230px; margin: -2px -4px 6px; border-radius: 8px; overflow: hidden; background: #fff; border: 1px solid rgba(0, 0, 0, .06); }
.cd-card-top { display: flex; gap: 10px; align-items: center; padding: 10px; background: var(--brand-light); color: var(--brand-ink-light); }
.cd-card-top .logo { width: 30px; height: 30px; border-radius: 8px; font-size: 13px; }
.cd-card-top b { display: block; font-size: 13px; }
.cd-card-top small { font-size: 11.5px; opacity: .9; }
.cd-card-body { display: grid; padding: 10px; gap: 1px; }
.cd-card-body small { font-size: 9.5px; letter-spacing: .08em; color: #6b7280; font-weight: 600; margin-top: 4px; }
.cd-card-body b { font-size: 14px; color: #111827; }
.guides { display: grid; gap: 10px; }
details.guide { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
details.guide summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; }
details.guide summary::-webkit-details-marker { display: none; }
details.guide summary > svg.i { color: var(--muted); transition: transform .2s; }
details.guide[open] summary > svg.i { transform: rotate(180deg); }
details.guide .guide-body { padding: 0 16px 16px 60px; color: var(--ink-2); font-size: 14.5px; display: grid; gap: 8px; }
details.faq .guide-body { padding-left: 16px; }
details.guide ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
@media (max-width: 600px) { details.guide .guide-body { padding-left: 16px; } }
.help-contact { display: flex; gap: 14px; align-items: center; margin-top: 24px; }
.banner.info { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 25%, transparent); }
.banner.info svg.i { color: var(--accent); }

/* ---------- v0.8: VIP, horas tranquilas, invitación de ejemplo ---------- */
.chip.vip { background: color-mix(in srgb, #c9971c 20%, var(--surface)); color: var(--ink); border-color: color-mix(in srgb, #c9971c 45%, var(--line)); }
.heat { display: grid; gap: 4px; align-items: center; font-size: 12px; }
.heat-h { text-align: center; color: var(--muted); font-weight: 600; }
.heat-r { color: var(--muted); padding-right: 6px; white-space: nowrap; }
.heat-c { text-align: center; padding: 10px 2px; border-radius: 6px; font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; }
.heat-c.off { color: var(--muted); font-weight: 400; background: transparent; }
.heat-c.low { outline: 2px solid var(--ink); outline-offset: -2px; }
.chat-demo.mini { padding: 12px; max-width: 520px; }
.chat-demo.mini .cd-msg { max-width: 100%; white-space: pre-line; }
@media (max-width: 560px) { .heat-r { font-size: 11px; } .heat-c { padding: 8px 0; font-size: 11px; } }

/* ---------- v0.9: seña pendiente ---------- */
.cal-ev.pending_deposit { border-style: dashed; background: color-mix(in srgb, var(--ev) 8%, var(--surface)); }
.banner.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.banner.warn svg.i { color: var(--warn); }

/* ---------- v0.10: portada, fotos, todo clickeable, meta del mes ---------- */
/* Portadas: tono oscuro de la marca (texto blanco legible en los dos temas) + un dibujo */
.cover { color: #fff; background-color: var(--brand-light); background-size: cover; background-position: center; position: relative; isolation: isolate; }
.cover-aurora {
  background-image:
    radial-gradient(60% 120% at 85% 10%, color-mix(in srgb, var(--brand-light) 55%, #fff) 0%, transparent 60%),
    radial-gradient(50% 90% at 10% 100%, color-mix(in srgb, var(--brand-light) 70%, #000) 0%, transparent 70%),
    linear-gradient(120deg, color-mix(in srgb, var(--brand-light) 85%, #000), var(--brand-light));
}
.cover-rayas {
  background-image:
    repeating-linear-gradient(135deg, rgba(255,255,255,.10) 0 14px, transparent 14px 34px),
    linear-gradient(120deg, color-mix(in srgb, var(--brand-light) 80%, #000), var(--brand-light));
}
.cover-puntos {
  background-image:
    radial-gradient(rgba(255,255,255,.22) 1.4px, transparent 1.6px),
    linear-gradient(135deg, var(--brand-light), color-mix(in srgb, var(--brand-light) 70%, #000));
  background-size: 18px 18px, auto;
}
.cover-ondas {
  background-image:
    repeating-radial-gradient(circle at 100% 0%, transparent 0 22px, rgba(255,255,255,.09) 22px 24px),
    linear-gradient(160deg, color-mix(in srgb, var(--brand-light) 75%, #000), var(--brand-light));
}
.cover-liso { background-image: linear-gradient(135deg, var(--brand-light), color-mix(in srgb, var(--brand-light) 78%, #000)); }

.hero-cover { border-radius: var(--radius); min-height: 168px; display: flex; align-items: flex-end; padding: 22px; box-shadow: var(--shadow); overflow: hidden; }
.hero-cover .hero-in { display: flex; align-items: center; gap: 16px; width: 100%; }
.hero-cover h1 { color: #fff; font-size: clamp(24px, 3vw, 32px); line-height: 1.1; text-shadow: 0 1px 12px rgba(0,0,0,.25); }
.hero-cover small { color: rgba(255,255,255,.82); font-weight: 600; letter-spacing: .02em; }
.hero-cover .hero-line { color: rgba(255,255,255,.9); margin-top: 6px; font-size: 14.5px; }
.hero-cover .logo { background: rgba(255,255,255,.18); color: #fff; box-shadow: 0 6px 20px rgba(0,0,0,.18); }
.hero-cover .logo.img { background: #fff; }
.hero-cover { position: relative; }
.hero-edit { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: rgba(0,0,0,.22); backdrop-filter: blur(6px); transition: background .15s; }
.hero-edit:hover { background: rgba(0,0,0,.4); }
.hero-tools { display: flex; justify-content: flex-end; align-items: center; gap: 10px; flex-wrap: wrap; margin: 14px 0 18px; }
.hero-cover.preview { min-height: 140px; box-shadow: none; }
@media (max-width: 600px) {
  .hero-cover { min-height: 150px; padding: 18px; }
  .hero-cover .logo.lg { width: 48px; height: 48px; }
  .hero-tools { justify-content: space-between; }
}

/* Todo lo que lleva a otra sección se levanta al pasar el mouse */
a.go, .go { cursor: pointer; text-decoration: none; color: inherit; }
.kpi.go, .benefit.go { transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.kpi.go:hover, .benefit.go:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(15, 23, 42, .10); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.kpi.go:focus-visible, .benefit.go:focus-visible, .today-item.go:focus-visible, .hbar.go:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.today-item.go { border-radius: 10px; margin: 0 -8px; padding-left: 8px; padding-right: 8px; transition: background .12s; }
.today-item.go:hover { background: var(--surface-2, color-mix(in srgb, var(--ink) 4%, transparent)); }
.hbar.go { border-radius: 8px; margin: -4px -6px; padding: 4px 6px; transition: background .12s; }
.hbar.go:hover { background: color-mix(in srgb, var(--ink) 4%, transparent); }
.heat-c.go { text-decoration: none; transition: transform .12s; }
.heat-c.go:hover { transform: scale(1.06); }
.chart .hit.go { cursor: pointer; }
.benefit.go { position: relative; }
.benefit.go > svg.i:last-child { position: absolute; top: 14px; right: 12px; width: 16px; height: 16px; color: var(--muted); transition: transform .15s; }
.benefit.go:hover > svg.i:last-child { transform: translateX(3px); color: var(--accent); }
.guide-body .btn { margin-top: 4px; }
.list-item .rank { width: 18px; color: var(--muted); font-weight: 700; font-size: 12.5px; text-align: center; }

/* Ficha del cliente: encabezado de perfil */
.profile { padding: 0; overflow: hidden; margin: 12px 0 16px; }
.profile-band { height: 110px; }
.profile-body { display: flex; align-items: flex-end; gap: 16px; padding: 12px 20px 18px; flex-wrap: wrap; }
.profile-photo { position: relative; margin-top: -60px; }
.profile-photo .avatar { border: 4px solid var(--surface); box-shadow: var(--shadow); }
.profile-id h1 { font-size: 24px; margin-bottom: 6px; }
.profile-actions { margin-left: auto; }
.avatar.xl { width: 96px; height: 96px; font-size: 30px; }
.photo-btn { position: absolute; right: 2px; bottom: 2px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); border: 3px solid var(--surface); cursor: pointer; }
.photo-btn svg.i { width: 15px; height: 15px; }
@media (max-width: 600px) { .profile-actions { margin-left: 0; width: 100%; } .profile-band { height: 84px; } }

/* Foto en el bloque del calendario */
.cal-ev .ev-ph { float: right; width: 22px; height: 22px; border-radius: 50%; object-fit: cover; margin: 0 0 2px 6px; }

/* Portadas en Marca */
.cover-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.cover-tile { display: grid; gap: 6px; padding: 6px; border-radius: 12px; border: 2px solid transparent; background: none; color: var(--ink); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; text-align: left; }
.cover-tile[aria-checked="true"] { border-color: var(--accent); }
.cover-tile:hover { background: color-mix(in srgb, var(--ink) 4%, transparent); }
.cover-prev { height: 54px; border-radius: 8px; display: grid; place-items: center; }
.cover-tile.add .cover-prev { border: 1.5px dashed var(--line); color: var(--muted); background: none; }

/* Login con la portada del negocio */
.auth-side.cover-foto { background-size: cover; }
.auth-cover { display: none; }
@media (max-width: 900px) {
  .auth-cover { display: block; height: 132px; margin: 0 -20px; width: calc(100% + 40px) !important; }
  .auth-main:has(.auth-cover) { display: block; padding: 0 20px 32px; }
  .auth-main:has(.auth-cover) .auth-box { margin: 28px auto 0; }
}

/* Meta del mes */
.goal { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.ring-box { position: relative; width: 128px; height: 128px; flex: none; }
.ring { width: 128px; height: 128px; }
.ring circle { fill: none; stroke-width: 12; stroke-linecap: round; }
.ring .ring-track { stroke: color-mix(in srgb, var(--ink) 8%, transparent); stroke-linecap: butt; }
.ring .ring-done { stroke: var(--accent); }
.ring .ring-booked { stroke: color-mix(in srgb, var(--accent) 35%, transparent); }
.ring-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-center b { font-family: var(--font-num); font-size: 23px; font-weight: 600; letter-spacing: -.03em; }
.ring-center small { color: var(--muted); font-size: 11.5px; }
.goal-facts { gap: 6px; min-width: 0; flex: 1; }
.goal-facts b { font-size: 18px; }
.goal-facts .delta { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.goal-facts .delta.up { color: var(--ok); }
.goal-facts .delta.down { color: var(--danger); }
.legend-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.legend-dot.booked { background: color-mix(in srgb, var(--accent) 35%, transparent); }
@media (max-width: 420px) { .hide-xs { display: none; } }

/* ---------- v0.11: deshacer, en vivo, mover, respuestas del bot ---------- */
.toast { align-items: center; }
.toast .grow { flex: 1; min-width: 0; }
.toast.info svg.i { color: var(--accent); }
.toast-btn { margin-left: 8px; background: none; border: 0; color: var(--accent); font: inherit; font-weight: 700; cursor: pointer; padding: 6px 8px; border-radius: 8px; white-space: nowrap; }
.toast-btn:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.cal-ev { touch-action: pan-y; }
.cal-ev.dragging { z-index: 5; box-shadow: 0 12px 28px rgba(15, 23, 42, .25); opacity: .92; cursor: grabbing; transition: none; }
@media (hover: hover) and (pointer: fine) { .cal-ev.confirmed, .cal-ev.pending_deposit { cursor: grab; } }
.faq-row { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.faq-row textarea { min-height: 64px; }
.faq-row > .grow { flex: 1; min-width: 0; }
.faq-row .field input, .faq-row .field textarea { width: 100%; }

/* ---------- v0.12: bandeja de conversaciones ---------- */
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-size: 11.5px; font-weight: 700; display: inline-grid; place-items: center; }
.nav-badge.hidden { display: none; }
.inbox { display: grid; grid-template-columns: minmax(280px, 360px) 1fr; gap: 16px; align-items: start; }
.chat-side { padding: 14px; display: flex; flex-direction: column; gap: 12px; max-height: calc(100vh - 170px); position: sticky; top: 16px; }
.chat-filters { flex-wrap: wrap; gap: 6px; }
.chat-filters .daychip { padding: 6px 10px; min-width: 0; }
.chat-list { overflow-y: auto; margin: 0 -14px; }
.chat-item { display: flex; gap: 10px; align-items: center; padding: 10px 14px; color: inherit; text-decoration: none; border-top: 1px solid var(--line); }
.chat-item:hover { background: color-mix(in srgb, var(--ink) 4%, transparent); }
.chat-item.active { background: var(--accent-soft); }
.chat-item .grow { flex: 1; min-width: 0; display: grid; gap: 2px; }
.chat-item b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.chat-item.unread b { font-weight: 800; }
.chat-item .preview { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
.chat-item .chip { font-size: 11px; padding: 1px 7px; }
.chat-pane { padding: 0; display: flex; flex-direction: column; height: calc(100vh - 170px); min-height: 420px; overflow: hidden; }
.chat-pane > .empty { margin: auto; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.chat-head .grow { flex: 1; min-width: 0; display: grid; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 6px;
  background: color-mix(in srgb, var(--accent) 3%, var(--bg, var(--surface))); }
.chat-day { align-self: center; font-size: 12px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 2px 10px; margin: 8px 0; }
.bubble { max-width: min(78%, 520px); padding: 7px 10px 5px; border-radius: 12px; display: grid; gap: 2px; box-shadow: 0 1px 1px rgba(0,0,0,.06); }
.bubble.in { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-top-left-radius: 4px; }
.bubble.out { align-self: flex-end; background: color-mix(in srgb, #25d366 18%, var(--surface)); border-top-right-radius: 4px; }
.bubble.out.owner, .bubble.out.panel { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); }
.bubble.huh { border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--warn) 20%, transparent); }
.bubble .txt { white-space: pre-wrap; word-break: break-word; font-size: 14.5px; }
.bubble .who { font-weight: 700; font-size: 11.5px; color: var(--accent); }
.bubble .at { justify-self: end; color: var(--muted); font-size: 11px; }
.bubble.huh .at { color: var(--warn); font-weight: 600; }
.chat-compose { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; border-top: 1px solid var(--line); }
.chat-compose textarea { flex: 1; resize: none; min-height: 42px; max-height: 140px; }
.compose-hint { padding: 0 14px 10px; margin: 0; }
@media (max-width: 900px) {
  .inbox { grid-template-columns: 1fr; }
  .chat-side { max-height: none; position: static; }
  .chat-pane { height: calc(100vh - 230px); }
}

/* ---------- buscador y cerrar el día ---------- */
.search-btn { display: flex; align-items: center; gap: 8px; width: calc(100% - 8px); margin: 0 4px 14px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--muted); font: inherit; font-size: 14px; cursor: pointer; }
.search-btn:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); color: var(--ink); }
.search-btn .grow { flex: 1; text-align: left; }
.search-btn kbd { font: inherit; font-size: 11px; border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
dialog.search-dlg { width: min(560px, calc(100vw - 32px)); align-self: start; margin-top: 10vh; }
dialog.search-dlg .d-foot { display: none; }
.search-box { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; }
.search-box input { border: 0; outline: 0; box-shadow: none; padding: 12px 0; flex: 1; font-size: 16px; background: transparent; }
.search-results { max-height: 50vh; overflow-y: auto; display: grid; gap: 2px; }
.sr { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: inherit; text-decoration: none; }
.sr .grow { flex: 1; min-width: 0; display: grid; }
.sr small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr.sel, .sr:hover { background: var(--accent-soft); }
.sr-ic { width: 26px; height: 26px; display: grid; place-items: center; color: var(--accent); }
.sr .chip { cursor: pointer; }
.sr-empty { padding: 10px; }
.cd-list { display: grid; gap: 4px; max-height: 55vh; overflow-y: auto; }
.cd-day { font-weight: 700; font-size: 13px; color: var(--muted); margin-top: 8px; }
.cd-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.cd-row .t { font-weight: 700; font-variant-numeric: tabular-nums; width: 44px; }
.cd-row .grow { flex: 1; min-width: 0; display: grid; }
.cd-row small { color: var(--muted); }
.cd-row.no { background: color-mix(in srgb, var(--danger) 6%, var(--surface)); }
.cd-row .segmented { flex: none; }
@media (max-width: 600px) { .cd-row { flex-wrap: wrap; } .cd-row .segmented { width: 100%; } }

/* ---------- página pública de reservas ---------- */
body.book-page { background: var(--bg, var(--surface)); }
/* La reserva es una conversación con el negocio: globos del negocio a la izquierda, las elecciones del cliente
   como mensajes enviados con su ✓✓ a la derecha (tocándolos se cambian) y el turno llega como un ticket. */
.book { max-width: 560px; margin: 0 auto; padding: 0 0 32px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; overflow-x: clip; min-height: 100dvh; align-content: start; }
.book > .boot-dot { margin: 40vh auto; }
.bk-head { position: sticky; top: 0; z-index: 5; padding: 14px 16px 16px; border-radius: 0 0 22px 22px; }
.bk-head-in { display: flex; align-items: center; gap: 12px; }
.bk-head h1 { font-size: 19px; line-height: 1.15; margin: 0; letter-spacing: -.01em; }
.bk-head p { margin: 3px 0 0; font-size: 13px; opacity: .85; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.bk-av { width: 46px; height: 46px; flex: none; border-radius: 15px 15px 4px 15px; display: grid; place-items: center; background: rgba(255,255,255,.18); font-weight: 800; font-size: 20px; overflow: hidden; }
.bk-av.img { background: #fff; }
.bk-av img { width: 100%; height: 100%; object-fit: contain; }
.bk-live { width: 8px; height: 8px; border-radius: 50%; background: #5ee39a; box-shadow: 0 0 0 3px rgba(94,227,154,.25); }

.bk-chat { padding: 18px 14px 8px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.bk-day-chip { align-self: center; margin: 0 0 6px; padding: 4px 12px; border-radius: 8px; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 600; }
.bk-row { display: flex; flex-direction: column; min-width: 0; max-width: 100%; }
.bk-row.them { align-items: flex-start; }
.bk-row.me { align-items: flex-end; }
.bk-msg { max-width: min(88%, 440px); padding: 10px 14px; font: inherit; font-size: 15.5px; line-height: 1.4; text-align: left; }
.bk-msg p { margin: 0; }
.bk-msg p + p, .bk-msg p + div, .bk-msg div + p { margin-top: 8px; }
.them .bk-msg { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 4px 18px 18px 18px; width: fit-content; }
.them .bk-msg:has(.bk-opts, .bk-days, .bk-ticket) { width: min(88%, 440px); }
.me .bk-msg { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 18px 4px 18px 18px; cursor: pointer; display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.me .bk-msg:disabled { cursor: default; }
.bk-txt { font-weight: 600; }
.bk-meta { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; opacity: .8; margin-left: auto; }
.bk-edit { text-decoration: underline; text-underline-offset: 2px; margin-right: 4px; opacity: .85; }
.me .bk-msg:disabled .bk-edit { display: none; }
.bk-ticks { width: 17px; height: 11px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Opciones para responder: van dentro del globo del negocio */
.bk-opts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.bk-opts.list { flex-direction: column; flex-wrap: nowrap; }
.bk-opt { font: inherit; cursor: pointer; color: var(--ink); background: var(--surface-2); border: 1.5px solid var(--line); border-radius: 14px 14px 4px 14px; transition: border-color .15s, background .15s, transform .1s; }
.bk-opt:hover { border-color: var(--accent); }
.bk-opt:active { transform: scale(.98); }
.bk-opt:focus-visible, .bk-day:focus-visible, .me .bk-msg:focus-visible, .bk-send:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.bk-opt.svc { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 12px 14px; text-align: left; }
.bk-opt.svc b { font-weight: 700; }
.bk-opt.svc small { color: var(--muted); white-space: nowrap; font-size: 13px; }
.bk-opt.pro { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; font-weight: 600; border-radius: 999px; }
.bk-opt.pro .avatar { width: 30px; height: 30px; font-size: 12px; }
.bk-opt.slot { padding: 9px 14px; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 70px; text-align: center; }
.bk-days-wrap { position: relative; margin-top: 10px; }
.bk-days { position: relative; display: flex; gap: 6px; overflow-x: auto; margin: 0 -4px; padding: 2px 4px 4px; scrollbar-width: none; scroll-snap-type: x proximity; overscroll-behavior-x: contain; }
.bk-day { scroll-snap-align: start; }
/* Hay más días a un costado: el borde se difumina */
.bk-days-wrap.more-right .bk-days { -webkit-mask-image: linear-gradient(90deg, #000 82%, transparent); mask-image: linear-gradient(90deg, #000 82%, transparent); }
.bk-days-wrap.more-left .bk-days { -webkit-mask-image: linear-gradient(90deg, transparent, #000 18%); mask-image: linear-gradient(90deg, transparent, #000 18%); }
.bk-days-wrap.more-left.more-right .bk-days { -webkit-mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent); mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent); }
.bk-arrow { position: absolute; top: 50%; z-index: 2; width: 34px; height: 34px; margin-top: -17px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.bk-arrow.prev { left: -6px; }
.bk-arrow.next { right: -6px; }
.bk-arrow[hidden] { display: none; }
.bk-arrow svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.bk-arrow:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* En pantallas táctiles se desliza con el dedo: sin flechas */
@media (pointer: coarse) { .bk-arrow { display: none; } }
.bk-days::-webkit-scrollbar { display: none; }
.bk-day { flex: none; display: grid; justify-items: center; gap: 1px; width: 50px; padding: 7px 0; font: inherit; cursor: pointer; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface-2); color: var(--ink); }
.bk-day small { font-size: 11px; color: var(--muted); text-transform: capitalize; }
.bk-day b { font-size: 18px; font-variant-numeric: tabular-nums; }
.bk-day[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.bk-day[aria-pressed="true"] small { color: inherit; opacity: .85; }
.bk-sub { color: var(--muted); font-size: 13.5px; margin-top: 10px; }
.bk-wait { color: var(--muted); font-size: 13px; }

/* "Escribiendo…" y entrada de los mensajes nuevos */
.bk-typing { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .bk-row.fresh .bk-typing { display: flex; gap: 4px; padding: 13px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 4px 18px 18px 18px; animation: bk-gone 0s .55s forwards; }
  .bk-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: bk-dot 1s infinite ease-in-out; }
  .bk-typing i:nth-child(2) { animation-delay: .15s; }
  .bk-typing i:nth-child(3) { animation-delay: .3s; }
  .bk-row.fresh .bk-msg { animation: bk-in .32s cubic-bezier(.2,.8,.2,1) .55s both; }
  .bk-row.me .bk-msg { animation: bk-in .25s cubic-bezier(.2,.8,.2,1) both; }
}
@keyframes bk-dot { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-4px); opacity: 1; } }
@keyframes bk-gone { to { visibility: hidden; height: 0; padding: 0; margin: 0; border-width: 0; } }
@keyframes bk-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

/* Barra de escribir: nombre y WhatsApp, fija abajo como en un chat */
.bk-compose { position: sticky; bottom: 0; z-index: 4; margin: 6px 0 0; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--bg) 94%, transparent); border-top: 1px solid var(--line); display: grid; gap: 8px; }
.bk-recap { margin: 0; font-size: 13px; color: var(--muted); }
.bk-recap b { color: var(--ink); }
.bk-compose > input, .bk-compose .tel input, .bk-compose .tel select { border-radius: 22px; }
.bk-hint { margin: 0; font-size: 12px; color: var(--muted); }
.bk-send { justify-self: end; display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px 12px 22px; font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; border: 0; color: var(--accent-ink); background: var(--accent); border-radius: 22px 22px 6px 22px; }
.bk-send svg { width: 18px; height: 18px; fill: currentColor; }
.bk-send.loading { opacity: .6; pointer-events: none; }

/* El turno llega como un ticket */
.bk-ticket { border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.bk-ticket-top { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 14px; }
.bk-ticket.pending .bk-ticket-top { background: var(--warn, #b7791f); color: #fff; }
.bk-check { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.bk-msg .bk-ticket-time { margin: 14px 14px 0; font-size: 52px; line-height: 1; font-weight: 800; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.bk-msg .bk-ticket-day { margin: 4px 14px 0; font-weight: 600; }
.bk-ticket dl { margin: 12px 0 0; padding: 12px 14px 14px; border-top: 1.5px dashed var(--line); display: grid; gap: 8px; }
.bk-ticket dl div { display: flex; justify-content: space-between; gap: 12px; }
.bk-ticket dt { color: var(--muted); font-size: 13px; }
.bk-ticket dd { margin: 0; font-weight: 600; text-align: right; }
.bk-deposit { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--warn-soft, var(--surface-2)); font-size: 14px; }
.bk-deposit p { margin: 4px 0 0; }
.bk-actions { display: grid; gap: 8px; margin-top: 12px; }
.bk-btn { display: block; text-align: center; padding: 11px 14px; border-radius: 14px 14px 4px 14px; border: 1.5px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 700; font-size: 14.5px; }
.bk-btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
@media (prefers-reduced-motion: no-preference) {
  .bk-row.fresh .bk-check polyline { stroke-dasharray: 40; stroke-dashoffset: 40; animation: bk-draw .35s ease-out .8s forwards; }
  .bk-row.fresh .bk-check polyline + polyline { animation-delay: 1.05s; }
}
@keyframes bk-draw { to { stroke-dashoffset: 0; } }
.book-ts { justify-self: start; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.templates { flex-wrap: wrap; justify-content: center; gap: 8px; padding-bottom: 8px; }
.chat-item .grow { grid-template-columns: minmax(0, 1fr); }
.chat-item .grow > .row { min-width: 0; flex-wrap: nowrap; gap: 8px; }
.chat-item .grow > .row > b { min-width: 0; flex: 1; }
.chat-item .grow > .row > small, .chat-item .grow > .row > .row { flex: none; }
.search-box input[type=search] { border: 0; box-shadow: none; padding-left: 0; }
.chat-head b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 900px) { .inbox.has-open ~ *, .chat-pane { height: calc(100dvh - 300px); min-height: 360px; } .chat-head { padding: 10px 12px; gap: 8px; } .chat-head .avatar { width: 34px; height: 34px; } }

/* ============ Marca Dobletic (la plataforma; el negocio conserva su logo y su color) ============ */
.dob-iso { width: 100%; height: 100%; display: block; }
.dob-iso .bub { fill: var(--dob-cobalto); }
.dob-iso .tic { fill: none; stroke: #fff; stroke-width: 5.2; stroke-linecap: round; stroke-linejoin: round; }
.logo.dob { background: transparent; padding: 0; }
.auth-side .logo.dob { background: transparent; }
.auth-side .dob-iso .bub { fill: #fff; }
.auth-side .dob-iso .tic { stroke: var(--dob-cobalto); }
.dob-word { font-weight: 800; font-stretch: 125%; letter-spacing: -.03em; }
.dob-lockup { display: inline-flex; align-items: center; gap: 7px; text-decoration: none; color: inherit; }
.dob-lockup .dob-iso { width: 20px; height: 20px; }
.dob-lockup .dob-word { font-size: 14px; }
.dob-by { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 12px 8px 0; font-size: 12px; color: var(--muted); text-decoration: none; }
.dob-by:hover { color: var(--ink); }
.dob-by .dob-iso { width: 16px; height: 16px; }
.dob-by .dob-word { font-size: 12.5px; color: var(--ink-2); }
.auth-side .dob-foot { display: flex; align-items: center; gap: 10px; color: rgba(255, 255, 255, .65); font-size: 13px; flex-wrap: wrap; }
.auth-side .dob-foot .dob-lockup { color: #fff; }
.auth-side .dob-foot .dob-iso .bub { fill: #fff; }
.auth-side .dob-foot .dob-iso .tic { stroke: var(--dob-cobalto); }
.book-foot { display: flex; justify-content: center; padding: 18px 0 4px; }
.book-foot .seal { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px 7px 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 13px; text-decoration: none; }
.book-foot .dob-iso { width: 20px; height: 20px; }
.book-foot .dob-word { color: var(--ink); font-size: 13.5px; }
.growth { color: var(--growth); }

/* Consola: interesados de la landing */
a.kpi { color: inherit; text-decoration: none; }
.lead .lead-msg { margin-top: 6px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.lead .lead-actions { margin-top: 8px; }
.lead select { min-height: 34px; padding: 4px 10px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); font-size: 13.5px; }

/* Prueba gratis: aviso de días restantes y elección de plan */
.banner.trial { align-items: flex-start; }
.banner.trial.info { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 25%, transparent); }
.banner.trial.danger { background: var(--danger-soft, color-mix(in srgb, var(--danger) 12%, var(--surface))); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.trial-meter { height: 6px; margin-top: 8px; max-width: 360px; }
.plan-pick { display: grid; gap: 8px; }
.plan-opt { display: grid; gap: 2px; text-align: left; padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; font: inherit; }
.plan-opt.on { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
.plan-opt b { font-size: 16px; }

/* Tutorial de primeros pasos (pantalla completa) */
.ob { min-height: 100dvh; display: grid; grid-template-rows: auto auto 1fr auto; background: var(--bg); }
.ob-top { display: flex; align-items: center; gap: 12px; padding: 14px clamp(16px, 4vw, 32px); padding-top: calc(14px + env(safe-area-inset-top, 0px)); }
.ob-track { padding: 0 clamp(16px, 4vw, 32px) 8px; max-width: 820px; width: 100%; margin: 0 auto; }
.ob-progress { height: 6px; border-radius: 99px; background: color-mix(in srgb, var(--accent) 14%, var(--surface-2)); overflow: hidden; }
.ob-progress::after { content: ""; display: block; height: 100%; width: calc(var(--p, 0) * 100%); min-width: 6px; border-radius: 99px; background: var(--accent); transition: width .35s cubic-bezier(.2, .7, .2, 1); }
.ob-crumbs { list-style: none; margin: 10px 0 0; padding: 0; display: flex; justify-content: space-between; gap: 6px; font-size: 12.5px; color: var(--muted); }
.ob-crumbs li.on { color: var(--accent); font-weight: 700; }
.ob-crumbs li.done { color: var(--ink-2, var(--ink)); }
.ob-main { padding: 18px clamp(16px, 4vw, 32px) 32px; }
.ob-body { max-width: 760px; margin: 0 auto; display: grid; gap: 16px; }
.ob-body.enter > * { animation: enter .28s cubic-bezier(.2, .7, .2, 1) both; }
.ob-head, .ob-hero { display: grid; gap: 8px; margin-bottom: 4px; }
.ob-hero { padding-top: clamp(8px, 4vh, 40px); }
.ob-head h1, .ob-hero h1 { font-size: clamp(26px, 4vw, 36px); line-height: 1.1; }
.ob-step { font-size: 13px; font-weight: 700; color: var(--accent); }
.ob-lead { color: var(--muted); font-size: 16.5px; max-width: 60ch; }
.ob-preview { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 8px; }
.ob-preview li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); font-weight: 600; }
.ob-preview .n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 14px; font-weight: 800; flex: none; }
.ob-services { display: grid; gap: 8px; }
.ob-srv { display: grid; grid-template-columns: 22px minmax(0, 1fr) 118px 132px; gap: 10px; align-items: center; }
.ob-srv > input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--accent); margin: 0; }
.ob-srv.off > input[type="text"], .ob-srv.off .ob-unit { opacity: .45; }
.ob-srv-head { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.ob-unit { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); }
.ob-unit input { min-width: 0; width: 100%; }
.ob-days { display: grid; gap: 8px; }
.ob-day { display: grid; grid-template-columns: minmax(130px, 1fr) 120px auto 120px; gap: 10px; align-items: center; }
.ob-day.off input[type="time"] { opacity: .4; }
.ob-day-name { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.ob-ok { display: flex; align-items: center; gap: 14px; }
.ob-ok-ic { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft, color-mix(in srgb, var(--ok, #1a7f4b) 15%, var(--surface))); color: var(--ok, #1a7f4b); flex: none; }
.ob-ok-ic svg { width: 28px; height: 28px; }
.ob-foot { position: sticky; bottom: 0; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--line); padding: 12px clamp(16px, 4vw, 32px) calc(12px + env(safe-area-inset-bottom, 0px)); }
.ob-foot-in { max-width: 760px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
@media (max-width: 640px) {
  .ob-crumbs { display: none; }
  .ob-srv { grid-template-columns: 22px minmax(0, 1fr); }
  .ob-srv .ob-unit { grid-column: 2; }
  .ob-srv-head { display: none; }
  .ob-day { grid-template-columns: 1fr 1fr auto 1fr; }
  .ob-day-name { grid-column: 1 / -1; }
  .ob-foot .btn { flex: 1; }
  .ob-foot .spacer { display: none; }
}
.ob-top .grow { flex: 1; min-width: 0; }
.auth > .auth-main:only-child { grid-column: 1 / -1; }

/* ---- Recorridos guiados (tour): capa superior, resaltado y tarjeta que explica ---- */
.tour { position: fixed; inset: 0; width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; overflow: visible; pointer-events: none; color: var(--ink); }
.tour.no-popover { z-index: 2147483000; }
.tour-spot { position: fixed; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(8, 10, 20, .55); outline: 2px solid var(--accent); outline-offset: 2px; transition: left .25s, top .25s, width .25s, height .25s; pointer-events: none; }
.tour-spot.off { left: 50% !important; top: 50% !important; width: 0 !important; height: 0 !important; outline: 0; }
.tour-card { position: fixed; width: min(340px, calc(100vw - 24px)); background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 16px 16px 16px 4px; box-shadow: var(--shadow-lg); padding: 14px 16px 14px; pointer-events: auto; display: grid; gap: 8px; }
.tour-card.center { left: 50%; top: 50%; transform: translate(-50%, -50%); }
.tour-top { display: flex; align-items: center; justify-content: space-between; }
.tour-count { font: 600 12px var(--font-num); color: var(--accent); }
.tour-x { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 4px; display: grid; border-radius: 8px; }
.tour-x:hover { background: var(--surface-3); color: var(--ink); }
.tour-x svg { width: 18px; height: 18px; }
.tour-card h3 { font-size: 17px; margin: 0; }
.tour-card p { color: var(--ink-2); font-size: 14.5px; line-height: 1.5; margin: 0; }
.tour-card .tour-hint { color: var(--warn); font-size: 13px; }
.tour-btns { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.tour-wait { margin-right: auto; font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.tour-wait::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: tourpulse 1.2s infinite; }
@keyframes tourpulse { 50% { opacity: .25; } }
.tour-help { position: fixed; right: 20px; bottom: 20px; z-index: 30; width: 48px; height: 48px; border-radius: 16px 16px 4px 16px; border: 1px solid var(--line); background: var(--surface); color: var(--accent); box-shadow: var(--shadow-lg); display: grid; place-items: center; cursor: pointer; }
.tour-help:hover { border-color: var(--accent); }
.tour-help svg { width: 24px; height: 24px; }
@media (max-width: 1023px) { .tour-help { bottom: calc(84px + env(safe-area-inset-bottom)); right: 14px; width: 44px; height: 44px; } }
.tour-menu { display: grid; gap: 8px; }
.tour-menu.two { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.tour-menu-lab { font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 0; }
.tour-item { display: flex; align-items: center; gap: 12px; text-align: left; width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); cursor: pointer; font: inherit; }
.tour-item:hover { border-color: var(--accent); }
.tour-item b { display: block; }
.tour-item small { color: var(--muted); font-size: 13px; }
.tour-item svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
@media (prefers-reduced-motion: reduce) { .tour-spot { transition: none; } .tour-wait::before { animation: none; } }

/* Ficha del cliente: aire parejo entre perfil, números, tarjetas e historial */
.profile-page { display: grid; gap: 16px; }
.profile-page > * { margin: 0 !important; }
.profile-page > .btn { justify-self: start; }
.profile-page > .profile-seg { margin-bottom: -6px !important; }
.profile-page .card > h2 { margin-bottom: 4px; }
/* La lista de datos (Frecuencia, Última visita…) respeta el espacio debajo del título de la tarjeta */
.stack > .detail-grid { margin-top: 14px; }
.profile-page > .dash { align-items: start; }

/* Teléfono con país (phone.js): selector con bandera y prefijo + número local */
.tel { display: flex; gap: 8px; width: 100%; }
.tel select.tel-cc { flex: 0 0 auto; width: auto; max-width: 9.5em; }
.tel input { flex: 1 1 auto; min-width: 0; }

/* Modo prueba */
.tel-add { align-items: center; flex-wrap: nowrap; }
.tel-add .tel { flex: 1 1 auto; min-width: 0; }
.test-msgs { max-height: 420px; overflow-y: auto; }

/* Cambiar el link de reservas (Marca) */
.slug-edit summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.slug-edit[open] summary { margin-bottom: 12px; }
.slug-row { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); overflow: hidden; }
.slug-base { padding: 0 4px 0 12px; color: var(--muted); font-size: 14px; white-space: nowrap; }
.slug-row input { border: 0; background: transparent; flex: 1; min-width: 0; padding-left: 0; }
.slug-row:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
/* Banderas de países: Windows no dibuja los emojis de bandera (muestra "AR"). Esta fuente solo trae banderas
   (unicode-range): el resto del texto sigue con la tipografía de siempre. Twemoji (CC-BY 4.0, Twitter) vía
   country-flag-emoji-polyfill (MIT), servida desde el propio servidor. */
@font-face {
  font-family: "Banderas";
  src: url("/app/fonts/banderas.woff2") format("woff2");
  unicode-range: U+1F1E6-1F1FF, U+1F3F4, U+E0062-E0063, U+E0065, U+E0067, U+E006C, U+E006E, U+E0073-E0074, U+E0077, U+E007F;
  font-display: swap;
}
.tel select.tel-cc, .tel select.tel-cc option { font-family: "Banderas", var(--font); }

/* Agenda › Próximos: todos los turnos que vienen, agrupados por día */
.upcoming { display: grid; gap: 18px; }
.upcoming-day { display: grid; gap: 8px; }
.upcoming-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0; font-size: 15px; font-weight: 600; color: var(--ink); }
.upcoming-head b { color: var(--accent); }
.upcoming-head small { color: var(--muted); font-weight: 500; font-size: 13px; }
.upcoming-day .card > .appt:first-child { border-top: 0; padding-top: 4px; }
.appt.clickable { cursor: pointer; }
.appt.clickable:hover .who { color: var(--accent); }

/* ============ Fidelidad ============ */
.stamps { display: flex; flex-wrap: wrap; gap: 6px; }
.stamp { width: 22px; height: 22px; border-radius: 50%; border: 1.5px dashed color-mix(in srgb, var(--accent) 45%, var(--line)); display: grid; place-items: center; }
.stamp.on { background: var(--accent); border: 1.5px solid var(--accent); }
.stamp .i { width: 13px; height: 13px; color: var(--accent); }
.stamp.last.on .i { color: var(--accent-ink, #fff); }
.stamps-bar { max-width: 320px; }
.loyalty-info { display: grid; gap: 6px; }
.loyalty-info .title { color: var(--ink); text-decoration: none; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-weight: 650; }
.loyalty-actions { justify-content: flex-end; }
.loyalty-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.loyalty-preview { max-width: 420px; }
@media (max-width: 600px) {
  .loyalty-item { flex-wrap: wrap; }
  .loyalty-actions { width: 100%; justify-content: flex-start; }
}

/* ---------- el socio: caja, stock, regalos, liquidación, ficha técnica ---------- */
.num.neg { color: var(--danger); }
.list-item.dim { opacity: .6; }
.stock-qty { display: flex; flex-direction: column; align-items: flex-end; min-width: 64px; }
.stock-qty b { font-size: 22px; line-height: 1.1; }
.title .mono { font-size: 13px; font-weight: 700; letter-spacing: .06em; margin-right: 2px; }
.aftercare-step { padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.aftercare-step textarea { width: 100%; }
.records { display: flex; flex-direction: column; }
.record { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); }
.record img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; display: block; }
.record p { margin: 0 0 4px; white-space: pre-wrap; }
.pay-item select { max-width: 260px; }
@media (max-width: 600px) {
  .pay-item .row { flex-wrap: wrap; width: 100%; }
  .pay-item select { max-width: none; flex: 1; }
}
.socio-demo .cd-msg span { white-space: pre-line; }
@media (max-width: 600px) { .stats.cash-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stats.cash-stats .stat b { font-size: 17px; } }

/* Tutorial: elegir a quién le contesta el bot */
.ob-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.ob-choice { display: grid; gap: 6px; align-content: start; text-align: left; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1.5px solid var(--line); color: inherit; font: inherit; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.ob-choice:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.ob-choice:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ob-choice[aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.ob-choice b { font-size: 17px; }
.ob-choice-q { font-size: 13px; font-weight: 700; color: var(--accent); }
.ob-exs, .ob-says { display: grid; gap: 8px; }
.ob-ex { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ob-ex .chip { flex: none; }
/* Mensajes de ejemplo como burbujas de WhatsApp: el del cliente a la izquierda, el del dueño en el color de la marca */
.ob-ex-msg, .ob-say-msg { padding: 7px 11px; border-radius: 10px; font-size: 14px; border: 1px solid var(--line); }
.ob-ex-msg { border-top-left-radius: 2px; background: var(--surface-2); }
.ob-say { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: center; }
.ob-say-msg { justify-self: start; border-top-right-radius: 2px; background: color-mix(in srgb, var(--accent) 14%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 25%, var(--line)); }
@media (max-width: 600px) { .ob-say { grid-template-columns: 1fr; gap: 4px; } }

/* ============ Tutorial inmersivo ============ */
/* Pantalla oscura propia (no depende del tema del panel), ondas de fondo, una pregunta por pantalla
   y un celular al costado que muestra en vivo cómo contesta el bot. En el cierre, todo pasa al azul de marca. */
.ob.imm {
  --bg: #080b18; --surface: #10142a; --surface-2: #151a33; --surface-3: #1d2340;
  --ink: #eef0f8; --ink-2: #c9cde2; --muted: #8d93b3; --line: #232946;
  --accent: var(--brand-dark); --accent-ink: var(--brand-ink-dark);
  --accent-soft: color-mix(in srgb, var(--accent) 16%, var(--surface));
  --danger: #f87171; --danger-soft: #2a1515; --warn: #fbbf24; --warn-soft: #2a2110; --ok: #4ade80; --ok-soft: #10241a;
  --focus: #7a91ff; --shadow: none; --shadow-lg: 0 16px 48px rgba(0, 0, 0, .55);
  --wa-bg: #0b141a; --wa-head: #1f2c34; --wa-in: #1f2c34; --wa-out: #005c4b; --wa-ink: #e9edef; --wa-mute: #8696a0; --wa-green: #25d366;
  color-scheme: dark; color: var(--ink); background: var(--bg);
  position: relative; isolation: isolate; overflow-x: clip; grid-template-rows: auto 1fr auto; transition: background .9s ease;
}
/* Cierre: mismo fondo oscuro del tutorial, con el color de marca que eligió el negocio (nada de saltar a otro color) */
.ob.imm.done {
  --ok: var(--accent); --ok-soft: color-mix(in srgb, var(--accent) 16%, var(--surface));
  background: radial-gradient(90% 70% at 15% 0%, color-mix(in srgb, var(--accent) 14%, var(--bg)) 0%, var(--bg) 70%);
}
.ob.imm.done .step.done .step-n { color: var(--accent-ink); }
.ob-waves { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.ob.imm .ob-top { padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px)); max-width: 1220px; width: 100%; margin: 0 auto; gap: 20px; }
.ob-lockup { display: inline-flex; align-items: center; gap: 9px; }
.ob-lockup .dob-iso { width: 28px; height: 28px; }
.ob-lockup .dob-iso .bub { fill: var(--ink); }
.ob-lockup .dob-iso .tic { stroke: var(--dob-cobalto); }
.ob-lockup .dob-word { font-size: 17px; }
.ob.imm .ob-track { padding: 0; margin: 0; max-width: 360px; flex: 1; }
.ob.imm .ob-progress { height: 3px; background: var(--line); }
.ob.imm .ob-progress::after { background: var(--accent); min-width: 0; transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.ob.imm .ob-main { padding: 12px max(16px, env(safe-area-inset-right, 0px)) 40px max(16px, env(safe-area-inset-left, 0px)); display: grid; }
.ob-stage { max-width: 1160px; width: 100%; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: clamp(32px, 6vw, 96px); align-items: start; }
.ob.solo .ob-stage { grid-template-columns: minmax(0, 1fr); align-items: center; }
.ob.solo .obp { display: none; }
.ob.imm .ob-body { max-width: 640px; margin: 0; width: 100%; gap: 20px; padding-top: clamp(8px, 4vh, 48px); }
.ob.solo .ob-body { max-width: 780px; }
.ob.imm .ob-body.enter > * { animation: ob-rise .6s cubic-bezier(.2, .8, .2, 1) both; }
.ob.imm .ob-body.enter > :nth-child(2) { animation-delay: .06s; }
.ob.imm .ob-body.enter > :nth-child(3) { animation-delay: .12s; }
.ob.imm .ob-body.enter > :nth-child(n+4) { animation-delay: .18s; }
@keyframes ob-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.ob.imm .ob-head { gap: 12px; margin-bottom: 8px; }
.ob.imm .ob-step, .ob-eyebrow, .ob-label { font-family: var(--font-num); font-size: 12px; font-weight: 500; letter-spacing: .07em; text-transform: uppercase; color: var(--accent); }
.ob-label { color: var(--muted); }
.ob.imm .ob-head h1 { font-size: clamp(30px, 4.2vw, 52px); line-height: 1.04; font-weight: 750; letter-spacing: -.035em; text-wrap: balance; }
.ob.imm .ob-lead { font-size: clamp(16px, 1.5vw, 18.5px); max-width: 54ch; }
.ob.imm .ob-hero { gap: 18px; }
.ob.imm .ob-hero h1 { font-size: clamp(42px, 7.6vw, 100px); line-height: .98; font-weight: 760; font-stretch: 118%; letter-spacing: -.045em; text-wrap: balance; }
.ob-hero h1 .w { display: inline-block; animation: ob-rise .9s cubic-bezier(.2, .8, .2, 1) both; }
.ob-hero h1 .name { color: var(--accent); }
.ob-meta { font-family: var(--font-num); font-size: 12.5px; color: var(--muted); }
.ob-trial { color: var(--ink-2); font-size: 14.5px; }
.ob-field { display: grid; gap: 10px; }
.ob.imm input.ob-big { width: 100%; background: transparent; border: 0; border-bottom: 2px solid var(--line); border-radius: 0; box-shadow: none; padding: 4px 0 10px;
  font: 650 clamp(24px, 3vw, 34px)/1.2 var(--font); font-stretch: 108%; letter-spacing: -.02em; color: var(--ink); }
.ob.imm input.ob-big:focus { border-color: var(--accent); }
.ob.imm .card { background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: blur(6px); }
.chip-btn { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 8px 15px; font: 500 14.5px var(--font); cursor: pointer; transition: border-color .2s, background .2s; }
.chip-btn:hover { border-color: var(--muted); }
.chip-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.ob.imm .templates { flex-wrap: wrap; gap: 8px; justify-content: flex-start; padding-bottom: 0; }
.ob.imm .ob-choices { grid-template-columns: 1fr; }
.ob.imm .ob-choice { padding: 20px 22px; border-radius: 18px; transition: border-color .2s, transform .2s, background .2s; }
.ob.imm .ob-choice:hover { transform: translateY(-1px); }
.ob.imm .ob-choice[aria-checked="true"] { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); box-shadow: none; }
.ob.imm .ob-choice-q { font-family: var(--font-num); font-weight: 500; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; }
.ob.imm .ob-say { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: center; text-align: left; background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; }
.ob.imm .ob-say-msg { background: color-mix(in srgb, var(--wa-out) 70%, var(--surface)); border: 1px solid transparent; color: var(--wa-ink); font-size: 15px; padding: 10px 14px; transition: transform .15s, border-color .2s; }
.ob.imm .ob-say:hover .ob-say-msg { transform: translateX(3px); border-color: var(--wa-green); }
.ob.imm .ob-say:disabled { opacity: .55; cursor: default; }
.ob.imm .ob-say:disabled .ob-say-msg { transform: none; }
.ob.imm .ob-foot { background: color-mix(in srgb, var(--bg) 80%, transparent); border-top-color: var(--line); }
.ob.imm .ob-foot-in { max-width: 1160px; }
.ob-kbd { font-family: var(--font-num); font-size: 12px; color: var(--muted); }
.ob.imm .ob-next { border-radius: 999px; padding-inline: 22px; background: var(--ink); border-color: var(--ink); color: var(--bg); }
.ob.done .ob-next { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.ob.imm .logo-preview { border-color: var(--line); }
.ob.imm .swatch[aria-checked="true"] { border-color: var(--ink); }
/* Cierre */
.ob-end .ob-iso { width: clamp(84px, 11vw, 124px); height: auto; }
.ob-end .ob-iso .bub { fill: var(--accent); }
.ob-end .ob-iso .tic { stroke: var(--accent-ink); stroke-dasharray: 60; stroke-dashoffset: 60; animation: ob-draw .5s .45s ease-out forwards; }
.ob-end .ob-iso .tic + .tic { animation-delay: .75s; }
@keyframes ob-draw { to { stroke-dashoffset: 0; } }

/* Celular de muestra */
.obp { position: sticky; top: 20px; justify-self: center; padding-top: clamp(8px, 4vh, 48px); }
.obp-phone { width: 320px; height: 620px; border-radius: 46px; background: var(--wa-bg); border: 9px solid #03040a; position: relative; overflow: hidden; display: flex; flex-direction: column;
  box-shadow: 0 0 0 1px #2a3055, 0 40px 120px -30px color-mix(in srgb, var(--dob-cobalto) 70%, transparent), 0 20px 60px -20px rgba(0, 0, 0, .8); }
.obp-notch { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); width: 90px; height: 24px; border-radius: 14px; background: #03040a; z-index: 2; }
.obp-screen { display: contents; }
.obp-top { background: var(--wa-head); padding: 40px 14px 10px; display: flex; align-items: center; gap: 10px; color: var(--wa-ink); flex: none; }
.obp-top b { display: block; font-size: 15px; font-weight: 600; line-height: 1.2; }
.obp-top small { display: block; color: var(--wa-mute); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.obp-top .grow { min-width: 0; flex: 1; }
.obp-ava { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-light); color: var(--brand-ink-light); font-weight: 800; font-size: 15px; flex: none; overflow: hidden; }
.obp-ava.img { background: #fff; }
.obp-ava img { width: 100%; height: 100%; object-fit: cover; }
.obp-ava.own { background: #3b4a54; color: #fff; }
.obp-ava.client { background: #2a7d5f; color: #fff; }
.obp-ava.friend { background: #5b4b8a; color: #fff; }
.obp-body { flex: 1; overflow: hidden; padding: 14px 10px; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px;
  background-color: var(--wa-bg); background-image: radial-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px); background-size: 14px 14px; }
.obp-msg { max-width: 86%; padding: 7px 10px 6px; border-radius: 10px; font-size: 13.5px; line-height: 1.38; color: var(--wa-ink); white-space: pre-line; overflow-wrap: anywhere; animation: obp-pop .35s cubic-bezier(.2, .9, .3, 1.2) both; }
.obp-msg.in { background: var(--wa-in); align-self: flex-start; border-top-left-radius: 3px; }
.obp-msg.out { background: var(--wa-out); align-self: flex-end; border-top-right-radius: 3px; }
.obp-msg .who { display: block; font-size: 12px; font-weight: 700; color: #7a91ff; margin-bottom: 1px; }
.obp-msg .meta { display: block; text-align: right; font-size: 10.5px; color: rgba(233, 237, 239, .55); margin-top: 2px; font-family: var(--font-num); }
.obp-msg .tk { color: #53bdeb; }
.obp-msg.sys { align-self: center; background: rgba(31, 44, 52, .92); color: var(--wa-mute); font-size: 12px; text-align: center; border-radius: 8px; max-width: 92%; }
.obp-typing { border-radius: 10px; padding: 10px 12px; display: flex; gap: 4px; }
.obp-typing.out { align-self: flex-end; background: var(--wa-out); }
.obp-typing.in { align-self: flex-start; background: var(--wa-in); }
.obp-typing i { width: 6px; height: 6px; border-radius: 50%; background: rgba(233, 237, 239, .6); animation: obp-blink 1.1s infinite; }
.obp-typing i:nth-child(2) { animation-delay: .15s; }
.obp-typing i:nth-child(3) { animation-delay: .3s; }
.obp-list { flex: 1; background: var(--wa-bg); overflow: hidden; }
.obp-row { display: flex; gap: 12px; padding: 12px 14px; align-items: center; border-bottom: 1px solid rgba(134, 150, 160, .12); }
.obp-row.in { animation: obp-pop .4s both; }
.obp-row .grow { min-width: 0; flex: 1; }
.obp-row b { display: block; font-size: 14.5px; font-weight: 600; color: var(--wa-ink); }
.obp-row .last { display: block; font-size: 13px; color: var(--wa-mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.obp-tag { display: inline-block; margin-top: 4px; font-family: var(--font-num); font-size: 10.5px; padding: 2px 7px; border-radius: 6px; }
.obp-tag.bot { background: rgba(37, 211, 102, .15); color: var(--wa-green); }
.obp-tag.you { background: rgba(134, 150, 160, .16); color: #c0cad0; }
.obp-tag.wait { background: rgba(122, 145, 255, .14); color: #7a91ff; }
.obp-linked { flex: 1; display: grid; place-content: center; justify-items: center; gap: 10px; text-align: center; padding: 24px; color: var(--wa-ink); background: var(--wa-bg); }
.obp-linked-ic { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; border: 2px dashed var(--wa-mute); color: var(--wa-mute); }
.obp-linked.on .obp-linked-ic { border: 0; background: var(--wa-green); color: var(--wa-bg); }
.obp-linked-ic svg { width: 32px; height: 32px; }
.obp-linked b { font-size: 17px; }
.obp-linked small { color: var(--wa-mute); font-size: 13.5px; }
@keyframes obp-pop { from { opacity: 0; transform: translateY(8px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes obp-blink { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }

@media (max-width: 960px) {
  .ob-stage { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .obp { position: static; padding-top: 0; }
  .obp-phone { width: min(300px, 100%); height: 480px; }
  .ob-kbd { display: none; }
}
@media (max-width: 600px) {
  .ob.imm .ob-track { max-width: none; }
  .ob-lockup .dob-word { display: none; }
  .ob.imm .ob-say { grid-template-columns: 1fr; gap: 4px; }
  .ob.imm .ob-srv { grid-template-columns: 22px minmax(0, 1fr) minmax(0, 1fr); row-gap: 6px; }
  .ob.imm .ob-srv > input[type="text"] { grid-column: 2 / -1; }
  .ob.imm .ob-srv .ob-unit { grid-column: auto; }
  .ob.imm .ob-srv .ob-unit:first-of-type { grid-column: 2; }
}
@media (prefers-reduced-motion: reduce) {
  .ob.imm *, .ob.imm *::before, .ob.imm *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
  .ob-end .ob-iso .tic { stroke-dashoffset: 0; }
}

/* Bienvenida con voz */
.ob-listen { justify-self: start; display: inline-flex; align-items: center; gap: 12px; padding: 8px 18px 8px 8px; border-radius: 999px; border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 80%, transparent); color: var(--ink); font: 600 15px var(--font); cursor: pointer; transition: border-color .2s; }
.ob-listen:hover, .ob-listen[aria-pressed="true"] { border-color: var(--accent); }
.ob-listen-ic { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); }
.ob-listen-ic svg { width: 16px; height: 16px; fill: currentColor; }
.ob-listen-t { font-family: var(--font-num); font-size: 12px; color: var(--muted); font-weight: 400; }
/* Si el navegador no dejó sonar solo, el botón titila hasta que lo toquen */
.ob-listen.nudge .ob-listen-ic { animation: ob-nudge 1.6s ease-in-out infinite; }
@keyframes ob-nudge { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); } 50% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--accent) 0%, transparent); } }
/* Botón de música del tutorial: tachado cuando está apagada */
.ob-music[aria-pressed="false"] { color: var(--muted); }
.ob-music[aria-pressed="false"] span { text-decoration: line-through; }
@media (max-width: 600px) { .ob-music span { display: none; } }
/* Tutorial: servicios y personas que se editan o se quitan */
.ob-srv2 { display: grid; grid-template-columns: minmax(0, 1fr) 118px 132px 92px; gap: 10px; align-items: center; }
.ob-srv2.ob-srv-head { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.ob-person { display: grid; grid-template-columns: 36px minmax(0, 1fr) 92px; gap: 10px; align-items: center; }
.ob-person .avatar, .ob-person-new { width: 36px; height: 36px; }
.ob-person-new { border-radius: 50%; display: grid; place-items: center; border: 1.5px dashed var(--line); color: var(--muted); }
.ob-person-new svg { width: 16px; height: 16px; }
.ob-del { justify-self: end; }
.ob-del.icon { color: var(--muted); }
.ob-del.icon:hover { color: var(--danger); }
.ob-srv2.gone input, .ob-srv2.gone .ob-unit, .ob-person.gone input, .ob-person.gone .avatar { opacity: .45; }
.ob-srv2.gone input[type="text"], .ob-person.gone input { text-decoration: line-through; }
@media (max-width: 600px) {
  .ob-srv2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; row-gap: 6px; }
  .ob-srv2 > input[type="text"] { grid-column: 1 / 3; }
  .ob-srv2 .ob-del { grid-column: 3; grid-row: 1; }
  .ob-srv2.ob-srv-head { display: none; }
}
/* Eliminar en los diálogos: a la izquierda, lejos de Guardar */
dialog .d-foot .d-del { margin-right: auto; }

/* Modo laboratorio: el beat del tutorial en el panel */
.lab-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-2); font: 600 13.5px var(--font); cursor: pointer; text-align: left; transition: border-color .2s, background .2s; }
.lab-btn:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.lab-btn svg { width: 18px; height: 18px; flex: none; }
.lab-btn[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: var(--accent); }
.lab-btn.compact { width: auto; padding: 0; border: 0; background: none; }
.lab-btn.compact[aria-pressed="true"] { background: none; }
.lab-eq { display: none; align-items: flex-end; gap: 2px; height: 12px; }
.lab-btn[aria-pressed="true"] .lab-eq { display: inline-flex; }
.lab-btn.compact .lab-eq { display: none; }
.lab-eq i { width: 3px; border-radius: 2px; background: currentColor; animation: lab-eq .9s ease-in-out infinite; }
.lab-eq i:nth-child(1) { height: 6px; }
.lab-eq i:nth-child(2) { height: 12px; animation-delay: .2s; }
.lab-eq i:nth-child(3) { height: 8px; animation-delay: .4s; }
@keyframes lab-eq { 0%, 100% { transform: scaleY(.4); } 50% { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) { .lab-eq i { animation: none; } }

/* Tutorial en el celular: el teléfono de muestra centrado y sin pasarse del ancho */
@media (max-width: 960px) {
  .obp { justify-self: stretch; display: flex; justify-content: center; }
  .obp-phone { width: min(300px, 100%); }
}
.sidebar .lab-btn { margin-top: auto; margin-bottom: 8px; }
.sidebar .lab-btn + .user-card { margin-top: 0; }
.range-del:hover { color: var(--danger); }

/* Historias: vista previa con el formato vertical del estado de WhatsApp */
.story-preview { width: 100%; max-width: 240px; aspect-ratio: 9 / 16; margin-inline: auto; border-radius: var(--radius); overflow: hidden; background: #0b0d12; position: relative; display: flex; align-items: center; justify-content: center; }
.story-preview img, .story-preview video { width: 100%; height: 100%; object-fit: contain; }
.story-text { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; padding: 24px; text-align: center; color: #fff; font-size: 1.15rem; font-weight: 600; line-height: 1.35; white-space: pre-wrap; overflow-wrap: anywhere; }
.story-caption { position: absolute; left: 0; right: 0; bottom: 0; padding: 12px; background: linear-gradient(transparent, rgba(0, 0, 0, .7)); color: #fff; font-size: .85rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.story-empty { color: #cbd5e1; padding: 16px; text-align: center; }
.color-dot { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; }
.color-dot.on { border-color: var(--ink); box-shadow: 0 0 0 2px var(--surface) inset; }
.color-dot:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ============ Aviso de versión nueva ============ */
/* Tarjeta flotante (no bloquea): se puede terminar lo que se está haciendo y actualizar después. */
.upd {
  position: fixed; right: 20px; bottom: 84px; z-index: 90; width: min(400px, calc(100vw - 32px));
  display: grid; grid-template-columns: auto 1fr; gap: 14px; padding: 18px 18px 16px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 18px 18px 4px 18px;
  box-shadow: var(--shadow-lg), 0 0 0 4px color-mix(in srgb, var(--accent) 10%, transparent);
  overflow: hidden; animation: upd-in .35s cubic-bezier(.2, .9, .3, 1.2);
}
.upd::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 35%, var(--growth))); }
.upd.out { animation: upd-out .2s ease-in forwards; }
.upd-badge {
  width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.upd-badge svg.i { width: 22px; height: 22px; animation: upd-spin 2.4s cubic-bezier(.6, 0, .3, 1) infinite; }
.upd-body { min-width: 0; display: grid; gap: 4px; }
.upd-kicker { margin: 0; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.upd-t { margin: 0; font-size: 16.5px; font-weight: 700; font-stretch: 112%; line-height: 1.25; }
.upd-d { margin: 2px 0 0; font-size: 14px; line-height: 1.45; color: var(--muted); }
.upd-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
@keyframes upd-in { from { transform: translateY(16px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes upd-out { to { transform: translateY(10px); opacity: 0; } }
@keyframes upd-spin { 0%, 55% { transform: rotate(0); } 100% { transform: rotate(360deg); } }
/* Celular: arriba, para no tapar la barra de abajo ni el botón de ayuda */
@media (max-width: 1023px) {
  .upd { left: 12px; right: 12px; bottom: auto; top: calc(12px + env(safe-area-inset-top)); width: auto; padding: 16px 14px 14px; }
  .upd-foot .btn { flex: 1; }
}

/* ============ Planes: insignias, candados y tarjeta del plan ============ */
.plan-badge { --pb: linear-gradient(120deg, #1f3dd6, #4f6bff 55%, #8ea2ff); position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px 2px 7px; border-radius: 999px; background: var(--pb); color: #fff; font-size: 11px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; line-height: 1.5; white-space: nowrap; box-shadow: 0 1px 8px rgba(31, 61, 214, .32); vertical-align: middle; }
.plan-badge.full { --pb: linear-gradient(120deg, #0b1020, #1f3dd6 58%, #a58bff); box-shadow: 0 1px 10px rgba(80, 60, 220, .38), inset 0 0 0 1px rgba(255, 255, 255, .22); }
.plan-badge svg.i { width: 11px; height: 11px; fill: currentColor; stroke-width: 1.5; }
.plan-badge.sm { font-size: 10px; padding: 1px 7px 1px 6px; }
.plan-badge.lg { font-size: 13px; padding: 5px 14px 5px 11px; gap: 6px; }
.plan-badge.lg svg.i { width: 14px; height: 14px; }
.plan-badge::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .55) 50%, transparent 65%); transform: translateX(-120%); }
@media (prefers-reduced-motion: no-preference) { .plan-badge::after { animation: pb-shine 5s ease-in-out 1.2s infinite; } }
@keyframes pb-shine { 0%, 70% { transform: translateX(-120%); } 85%, 100% { transform: translateX(120%); } }
.brand-plan { margin-top: 3px; }
.topbar .plan-badge { margin-left: -4px; }
.layout.tier-pro .sidebar, .layout.tier-full .sidebar { background-image: linear-gradient(180deg, color-mix(in srgb, #4f6bff 9%, transparent), transparent 140px); }
.layout.tier-full .sidebar { background-image: linear-gradient(180deg, color-mix(in srgb, #a58bff 12%, transparent), transparent 160px); }
.layout.tier-pro .sidebar::before, .layout.tier-full .sidebar::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, #1f3dd6, #8ea2ff); }
.layout.tier-full .sidebar::before { background: linear-gradient(90deg, #0b1020, #1f3dd6, #a58bff); }

.nav-lock { margin-left: auto; display: inline-flex; color: var(--muted); opacity: .7; }
.nav-lock svg.i { width: 14px; height: 14px; }
.lock-chip { display: inline-flex; align-items: center; gap: 3px; margin-left: 4px; padding: 1px 8px; border-radius: 999px; border: 1px solid color-mix(in srgb, #4f6bff 45%, transparent); background: color-mix(in srgb, #4f6bff 10%, transparent); color: var(--accent); font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; vertical-align: middle; }
.lock-chip.full { border-color: color-mix(in srgb, #a58bff 55%, transparent); background: color-mix(in srgb, #a58bff 12%, transparent); }
.lock-chip svg.i { width: 11px; height: 11px; }
.switch-row.locked > span { color: var(--muted); }
.lock-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: var(--radius); background: linear-gradient(120deg, color-mix(in srgb, #4f6bff 12%, var(--surface)), var(--surface)); border: 1px solid color-mix(in srgb, #4f6bff 30%, transparent); }
.lock-banner.full { background: linear-gradient(120deg, color-mix(in srgb, #a58bff 14%, var(--surface)), var(--surface)); border-color: color-mix(in srgb, #a58bff 35%, transparent); }
.lock-banner .grow { flex: 1; min-width: 180px; }
.lock-banner > svg.i { color: var(--accent); }
.card.locked > :not(.lock-banner) { opacity: .5; pointer-events: none; }

.perks { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.perks li { display: flex; gap: 8px; align-items: flex-start; }
.perks svg.i { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--accent); }
.locked-hero { display: grid; grid-template-columns: auto 1fr; gap: 22px; padding: 28px; background: linear-gradient(135deg, color-mix(in srgb, #4f6bff 10%, var(--surface)), var(--surface) 60%); }
.locked-hero.full { background: linear-gradient(135deg, color-mix(in srgb, #a58bff 13%, var(--surface)), var(--surface) 60%); }
.lh-icon { width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #1f3dd6, #8ea2ff); box-shadow: 0 8px 24px rgba(31, 61, 214, .3); }
.locked-hero.full .lh-icon { background: linear-gradient(135deg, #0b1020, #1f3dd6 60%, #a58bff); }
.lh-icon svg.i { width: 28px; height: 28px; }
.lh-plan { margin: 0; }
@media (max-width: 600px) { .locked-hero { grid-template-columns: 1fr; padding: 22px; } }

.plan-hero { position: relative; overflow: hidden; }
.plan-hero.basico { border: 1px solid color-mix(in srgb, #4f6bff 35%, var(--line)); }
.plan-hero.pro, .plan-hero.full { color: #fff; border: 0; background: linear-gradient(135deg, #1630b8, #1f3dd6 45%, #5b78ff); box-shadow: 0 12px 36px rgba(31, 61, 214, .28); }
.plan-hero.full { background: linear-gradient(135deg, #0b1020, #19288f 50%, #6d55e0); box-shadow: 0 12px 36px rgba(60, 40, 180, .32); }
.plan-hero.pro h2, .plan-hero.full h2 { color: #fff; font-size: 26px; letter-spacing: -.01em; }
.plan-hero.pro .perks svg.i, .plan-hero.full .perks svg.i { color: #b9c6ff; }
.plan-hero .plan-badge { background: rgba(255, 255, 255, .16); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35); }
.plan-hero.basico .plan-badge { background: var(--pb); }
.plan-hero .btn:not(.primary) { background: rgba(255, 255, 255, .14); color: #fff; border-color: rgba(255, 255, 255, .35); }
.plan-hero.basico .btn:not(.primary) { background: var(--surface); color: var(--ink); border-color: var(--line); }
.ph-note { font-size: 12.5px; opacity: .85; }
.ph-shine { position: absolute; right: -80px; top: -80px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .22), transparent 65%); pointer-events: none; }
.plan-welcome { display: grid; gap: 14px; }
.pw-badge { display: grid; place-items: center; padding: 18px 0 6px; }
.pw-badge .plan-badge { transform: scale(1.35); }
@media (prefers-reduced-motion: no-preference) { .pw-badge .plan-badge { animation: pw-in .6s cubic-bezier(.2, 1.4, .4, 1) both; } }
@keyframes pw-in { from { transform: scale(.6); opacity: 0; } to { transform: scale(1.35); opacity: 1; } }
.plan-opt b .chip { margin-left: 8px; vertical-align: middle; }
