/* Sistema visual: Suminregio Parker «Sidebar Dorado» (design/handoff), adaptado a celular.
   Claro y cálido por diseño; el oscuro solo vive en la barra inferior (el «sidebar» del móvil). */
:root {
  /* Acero claro con un brillo cepillado: el fondo es la lámina. */
  --bg-page: radial-gradient(900px 520px at 100% -10%, rgba(196,18,48,.07), transparent 60%),
             linear-gradient(180deg, #F7F8FA 0%, #EEF0F3 55%, #E6E9ED 100%);
  --bg-fallback: #EEF0F3;
  --bg-card: #FFFFFF;
  --bg-card-warm: linear-gradient(170deg, #FFFFFF, #F7F8FA);
  --bg-soft: #F3F4F6;
  --bg-hover: #F7F7F9;
  /* Lámina acanalada: estrías verticales sutiles para cabeceras y login. */
  --acanalado: repeating-linear-gradient(90deg, rgba(255,255,255,.07) 0 14px, rgba(0,0,0,.10) 14px 16px, rgba(255,255,255,.04) 16px 28px);

  --t1: #15171C; --t2: #2C3038; --t-muted: #5B6270; --t-faint: #828997; --t-label: #8E95A2;

  /* Rojo Mi Lámina (logo #C8231A, menú #C41230). */
  --acc-50: #FF6A5C; --acc-400: #E3261C; --acc-600: #C41230; --acc-deep: #8E0D22;
  --acc-grad: linear-gradient(135deg, #EE3A2A 0%, #C41230 55%, #8E0D22 100%);
  --dark-grad: linear-gradient(135deg, #1A1D23 0%, #343A44 100%);

  --ok: #0E9F6E; --ok-bg: #E7F6EF; --ok-text: #067647;
  --warn: #B45309; --warn-bg: #FDF1E3;
  --danger: #D92D20; --danger-bg: #FEECEA;
  --neutral: #8A909B;
  --blue: #2563EB; --purple: #6D4AE8; --cyan: #0E7490; --orange: #C2410C; --violet: #5B43C9;

  --graf: #15171B; --graf-text: #9AA0AA; --graf-active: #FF5A4E;

  --border: 1px solid rgba(20,24,32,.08);
  --hair: 1px solid rgba(20,24,32,.07);
  --shadow: 0 16px 38px -24px rgba(16,20,28,.32);
  --shadow-sm: 0 10px 24px -20px rgba(16,20,28,.32);
  --shadow-hover: 0 26px 54px -22px rgba(16,20,28,.32);
  --shadow-pill: 0 6px 18px -12px rgba(16,20,28,.24);

  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 18px; --r-2xl: 20px; --r-pill: 999px;
  --ease: cubic-bezier(.22,.7,.25,1);
  --f-body: 'Barlow', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --f-title: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --f-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --tab-h: 64px;
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg-fallback);
  background: var(--bg-page);
  background-attachment: fixed;
  color: var(--t1);
  font: 400 16px/1.5 var(--f-body);
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid var(--acc-400); outline-offset: 2px; border-radius: 6px; }

.fr { font-family: var(--f-title); font-weight: 700; font-style: italic; text-transform: uppercase; letter-spacing: .01em; }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.eyebrow { font: 500 .62rem/1.2 var(--f-mono); letter-spacing: .22em; text-transform: uppercase; color: var(--acc-600); margin: 0 0 .35rem; }
.tenue { color: var(--t-muted); margin: 0; }
.tenue-2 { color: var(--t-label); font-size: .7rem; }
h1, h2, h3 { margin: 0; color: var(--t1); }
.titulo { font-size: clamp(2rem, 9vw, 2.7rem); line-height: .98; }
h2.fr { font-size: 1.32rem; }

/* ── Layout ── */
.vista {
  max-width: 760px; margin: 0 auto; min-height: 100dvh;
  padding: calc(env(safe-area-inset-top) + 18px) 16px 24px;
}
.con-tabs { padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 28px); }
.cabecera { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 6px 0 18px; }

/* ── Botones ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px; border-radius: var(--r-md);
  border: var(--border); background: var(--bg-card); color: var(--t1);
  font-weight: 600; text-decoration: none; box-shadow: var(--shadow-pill);
  transition: transform .18s var(--ease), box-shadow .2s var(--ease), background .2s;
}
.btn:active { transform: scale(.98); }
.btn-oro { background: var(--acc-grad); color: #FFFFFF; border-color: transparent; box-shadow: 0 10px 22px -12px rgba(196,18,48,.7); }
.btn-oro svg { color: #fff; }
.btn-grande { min-height: 52px; font-size: 1.02rem; }
.btn-peligro { background: var(--bg-card); color: var(--danger); border: 1px solid rgba(217,45,32,.35); box-shadow: none; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-icono {
  width: 44px; height: 44px; display: inline-grid; place-items: center; flex: none;
  border: 0; border-radius: var(--r-md); background: transparent; color: var(--t-muted);
  transition: background .15s, color .15s;
}
.btn-icono:hover { background: rgba(20,24,32,.05); color: var(--t1); }
.btn-icono[aria-pressed="true"] { color: var(--acc-600); background: rgba(196,18,48,.15); }

/* ── Logo ── */
.logo {
  width: 40px; height: 40px; border-radius: 11px; background: var(--acc-grad);
  display: grid; place-items: center; box-shadow: 0 4px 14px rgba(196,18,48,.35);
  font: 700 italic 17px/1 var(--f-title); color: #fff; letter-spacing: -0.02em;
}
.logo-xl { width: 68px; height: 68px; border-radius: 18px; font-size: 25px; margin: 0 auto 18px; }

/* ── Campos ── */
.campo { display: grid; gap: 6px; text-align: left; }
.campo > span { font: 500 .6rem/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--t-label); }
input, textarea, select {
  width: 100%; min-height: 46px; padding: 11px 13px;
  background: var(--bg-card); border: var(--border); border-radius: var(--r-md);
  transition: border-color .2s, box-shadow .2s; outline: none;
}
input:focus, textarea:focus { border-color: rgba(196,18,48,.55); box-shadow: 0 0 0 4px rgba(196,18,48,.12); }
textarea { resize: none; line-height: 1.45; }
::placeholder { color: #A3A9B4; }

/* ── Login ── */
.vista-login { display: grid; place-items: center; }
.login { width: 100%; max-width: 380px; display: grid; gap: 14px; text-align: center; padding: 24px 4px; }
.login h1 { font-size: 2rem; margin-top: -4px; }
.login .tenue { margin-bottom: 10px; }
.error { color: var(--danger); min-height: 1.2em; margin: 0; font-size: .9rem; }

/* ── Tarjetas ── */
.tarjeta {
  background: var(--bg-card); border: var(--border); border-radius: var(--r-2xl);
  box-shadow: var(--shadow); padding: 1.1rem 1.15rem;
}

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; margin-bottom: 1.4rem; }
@media (min-width: 640px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kpi {
  position: relative; overflow: hidden; background: var(--bg-card); border: var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: .9rem 1rem 1rem;
}
.kpi::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--acento, var(--acc-600)); }
.kpi .lbl { font: 500 .56rem/1.2 var(--f-mono); letter-spacing: .09em; text-transform: uppercase; color: var(--neutral); }
.kpi .val { font: 500 1.45rem/1.15 var(--f-mono); letter-spacing: -0.025em; color: var(--acento, var(--t1)); margin: .35rem 0 .15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .sub { font: 400 .62rem/1.3 var(--f-mono); color: var(--t-label); }

/* Bloques de Hoy */
.bloque { margin-bottom: 1.5rem; }
.bloque-cab { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 4px .7rem; }
.lista-tarjetas { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--bg-card); border: var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm); padding: .8rem .9rem; color: inherit; text-decoration: none;
  transition: transform .26s var(--ease), box-shadow .26s var(--ease), border-color .26s;
}
button.item:hover, a.item:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); border-color: rgba(196,18,48,.4); }
.item .cuerpo { flex: 1; min-width: 0; }
.item .t { font-weight: 600; line-height: 1.3; }
.item .d { color: var(--t-muted); font-size: .88rem; line-height: 1.4; margin-top: 2px; overflow-wrap: anywhere; }
.item .m { font: 400 .66rem/1.3 var(--f-mono); color: var(--t-label); margin-top: 5px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.item .monto { font: 500 1rem/1 var(--f-mono); color: var(--t1); white-space: nowrap; }
.item .acc { display: flex; gap: 6px; flex: none; }
.mini {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  border: var(--border); background: var(--bg-soft); color: var(--t-muted);
}
.mini.ok:hover { color: var(--ok); border-color: rgba(14,159,110,.4); background: var(--ok-bg); }
.mini.no:hover { color: var(--danger); border-color: rgba(217,45,32,.35); background: var(--danger-bg); }
.vacio, .vacio-item { color: var(--t-faint); text-align: center; padding: 1rem; font-size: .9rem; }
.vacio-item { background: rgba(255,255,255,.55); border: 1px dashed rgba(20,24,32,.12); border-radius: var(--r-lg); }

/* Badges */
.badge { font: 700 .56rem/1 var(--f-mono); letter-spacing: .04em; padding: .26rem .52rem; border-radius: var(--r-pill); text-transform: uppercase; white-space: nowrap; }
.badge.ok { color: var(--ok); background: var(--ok-bg); }
.badge.warn { color: var(--warn); background: var(--warn-bg); }
.badge.danger { color: var(--danger); background: var(--danger-bg); }
.badge.neutro { color: var(--t-muted); background: var(--bg-soft); }
.badge.oro { color: var(--acc-deep); background: rgba(196,18,48,.18); }

/* Avatar monograma */
.avatar {
  width: 42px; height: 42px; border-radius: 13px; flex: none; display: grid; place-items: center;
  font: 600 .95rem/1 var(--f-title); color: #fff; background: var(--av, var(--acc-600));
  box-shadow: inset 0 -8px 16px rgba(0,0,0,.08);
}

/* ── Clientes ── */
.buscador { position: sticky; top: calc(env(safe-area-inset-top) + 8px); z-index: 3; margin-bottom: 1rem; }
.buscador input { min-height: 50px; padding-left: 16px; border-radius: 14px; box-shadow: var(--shadow-pill); }
.nuevo { border-style: dashed; border-color: rgba(196,18,48,.45); background: rgba(255,255,255,.7); }
.nuevo .avatar { background: var(--acc-grad); color: #fff; }

/* ── Vista cliente ── */
.vista-cliente { padding: 0; display: flex; flex-direction: column; height: 100dvh; min-height: 0; }
.barra-cliente {
  display: flex; align-items: center; gap: 4px;
  padding: calc(env(safe-area-inset-top) + 8px) 8px 6px;
}
.barra-titulo { flex: 1; min-width: 0; }
.barra-titulo h1 { font-size: 1.3rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barra-titulo p { margin: 1px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acciones-cliente { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 6px 16px 10px; }
.accion {
  display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 6px;
  background: var(--bg-card); border: var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
  color: var(--t2); font-size: .78rem; font-weight: 600; text-decoration: none;
  transition: transform .2s var(--ease), border-color .2s;
}
.accion svg { color: var(--acc-600); width: 22px; height: 22px; }
.accion:active { transform: scale(.97); }
.accion[aria-disabled="true"] { opacity: .45; pointer-events: none; }

.segmentos {
  display: flex; margin: 0 16px 8px; padding: 4px; gap: 2px;
  background: var(--bg-card); border: 1px solid rgba(20,24,32,.09); border-radius: 13px; box-shadow: var(--shadow-pill);
}
.seg { flex: 1; border: 0; min-height: 40px; border-radius: 9px; background: transparent; color: var(--t-muted); font: 500 .84rem/1 var(--f-body); transition: background .25s, color .2s; }
.seg.activo { background: var(--dark-grad); color: #FFFFFF; font-weight: 600; }
.seg .mono { font-size: .7rem; opacity: .8; }

.pestana-chat { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.pestana-memoria { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 16px calc(24px + env(safe-area-inset-bottom)); display: grid; gap: 12px; align-content: start; }

/* Chat */
.mensajes { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 16px 12px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; }
.msg { max-width: 88%; padding: 11px 14px; border-radius: 18px; overflow-wrap: anywhere; line-height: 1.5; animation: entra .32s var(--ease) both; }
.msg.user { align-self: flex-end; background: var(--dark-grad); color: #FFFFFF; border-bottom-right-radius: 6px; white-space: pre-wrap; }
.msg.assistant { align-self: flex-start; background: var(--bg-card); border: var(--border); box-shadow: var(--shadow-sm); border-bottom-left-radius: 6px; }
.msg.assistant p { margin: 0 0 .5em; } .msg.assistant p:last-child { margin: 0; }
.msg.assistant ul { margin: .2em 0 .5em; padding-left: 1.15em; }
.msg.assistant strong { color: var(--t1); font-weight: 600; }
.msg.estado { align-self: center; background: rgba(196,18,48,.14); color: var(--acc-deep); font: 500 .72rem/1.3 var(--f-mono); padding: 6px 12px; border-radius: var(--r-pill); }
.msg .foto { display: block; max-width: 220px; border-radius: 12px; margin-bottom: 6px; }
.anotado { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.anotado .badge { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: .7rem; line-height: 1.35; white-space: normal; max-width: 100%; border-radius: 10px; }
.escribiendo { display: inline-flex; gap: 4px; padding: 4px 0; }
.escribiendo i { width: 6px; height: 6px; border-radius: 50%; background: var(--acc-400); animation: punto 1.1s infinite ease-in-out; }
.escribiendo i:nth-child(2) { animation-delay: .15s; } .escribiendo i:nth-child(3) { animation-delay: .3s; }
.paso { font: 400 .72rem/1.3 var(--f-mono); color: var(--t-faint); }
.bienvenida { margin: auto 0; text-align: center; padding: 18px 12px; color: var(--t-muted); }
.bienvenida .logo { margin: 0 auto 12px; }
.bienvenida h3 { font: 600 1.15rem/1.3 var(--f-title); margin-bottom: 4px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 16px 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 1px solid rgba(196,18,48,.3); background: rgba(255,255,255,.85); color: var(--acc-deep);
  border-radius: var(--r-pill); padding: 7px 13px; font-size: .8rem; font-weight: 500; white-space: nowrap;
}
.chip:active { background: rgba(196,18,48,.18); }
#chip-terminar { border-color: rgba(20,24,32,.15); color: var(--t2); }

.entrada {
  display: flex; align-items: flex-end; gap: 4px; padding: 8px 10px calc(10px + env(safe-area-inset-bottom));
  background: rgba(247,248,250,.92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: var(--hair);
}
.caja-texto { flex: 1; min-width: 0; background: var(--bg-card); border: var(--border); border-radius: 22px; padding: 2px; }
.caja-texto:focus-within { border-color: rgba(196,18,48,.55); box-shadow: 0 0 0 4px rgba(196,18,48,.10); }
.caja-texto textarea { border: 0; box-shadow: none !important; background: transparent; min-height: 42px; max-height: 140px; padding: 10px 12px; border-radius: 20px; }
.foto-prev { position: relative; display: inline-block; margin: 6px 6px 0; }
.foto-prev img { height: 64px; border-radius: 10px; display: block; }
.foto-prev button { position: absolute; top: -6px; right: -6px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: var(--t1); color: #fff; display: grid; place-items: center; }
.foto-prev button svg { width: 14px; height: 14px; }
.btn-enviar { width: 46px; height: 46px; border: 0; border-radius: 50%; background: var(--acc-grad); color: #fff; display: grid; place-items: center; flex: none; box-shadow: 0 6px 16px -8px rgba(142,13,34,.55); }
.btn-enviar:disabled { opacity: .5; }
#b-mic.escuchando { color: var(--danger); background: var(--danger-bg); animation: latido 1.2s infinite; }

/* Memoria */
.datos-cliente { display: grid; gap: 10px; }
.plegable { padding: 0; box-shadow: var(--shadow-sm); }
.plegable > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 14px 16px; font-weight: 600; color: var(--t2); cursor: pointer; }
.plegable > summary::-webkit-details-marker { display: none; }
.plegable > summary svg { color: var(--acc-600); }
.plegable[open] > summary { border-bottom: var(--hair); }
.plegable > :not(summary) { padding: 14px 16px 16px; }
@media (min-width: 560px) { .datos-cliente { grid-template-columns: 1fr 1fr; } }
.nota-nueva { display: grid; gap: 10px; }
.tipos { display: flex; flex-wrap: wrap; gap: 6px; }
.tipos input { position: absolute; opacity: 0; pointer-events: none; }
.tipos span { display: inline-block; padding: 7px 12px; border-radius: var(--r-pill); border: var(--border); background: var(--bg-soft); font-size: .8rem; color: var(--t-muted); cursor: pointer; }
.tipos input:checked + span { background: var(--dark-grad); color: #FFFFFF; border-color: transparent; }
.tipos input:focus-visible + span { outline: 2px solid var(--acc-400); outline-offset: 2px; }
.fila-extra { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fila-extra:not(:has(.campo:not([hidden]))) { display: none; }

.linea-tiempo { list-style: none; margin: 4px 0 0; padding: 0 0 0 18px; position: relative; display: grid; gap: 10px; }
.linea-tiempo::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(var(--acc-400), rgba(196,18,48,.1)); border-radius: 2px; }
.nota { position: relative; background: var(--bg-card); border: var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: .8rem .9rem; }
.nota::before { content: ""; position: absolute; left: -18px; top: 15px; width: 12px; height: 12px; border-radius: 50%; background: var(--bg-card); border: 2.5px solid var(--punto, var(--acc-400)); }
.nota .cab { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.nota .cab .quien { font: 400 .64rem/1 var(--f-mono); color: var(--t-label); margin-left: auto; }
.nota .txt { color: var(--t2); line-height: 1.45; overflow-wrap: anywhere; }
.nota .pie { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.nota .pie button { border: var(--border); background: var(--bg-soft); border-radius: var(--r-pill); padding: 5px 11px; font-size: .74rem; color: var(--t-muted); }
.nota .pie button.borrar { color: var(--danger); margin-left: auto; }
.nota.cerrada .txt { color: var(--t-faint); }
.peligro { border-color: rgba(217,45,32,.2); display: grid; gap: 8px; box-shadow: none; }
.peligro p:not(.eyebrow) { margin: 0; color: var(--t-muted); font-size: .88rem; }
.peligro .eyebrow { color: var(--danger); }

/* ── Barra inferior (el «sidebar» espresso en móvil) ── */
.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 20;
  width: min(360px, calc(100% - 32px)); height: var(--tab-h);
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 6px;
  background: var(--graf); border-radius: 22px; box-shadow: 0 18px 40px -16px rgba(15,17,21,.65);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border-radius: 16px; color: var(--graf-text); text-decoration: none; font-size: .72rem; font-weight: 500;
  transition: background .2s, color .2s;
}
.tabbar a.activo { color: var(--graf-active); background: rgba(196,18,48,.15); font-weight: 600; }
.tabbar svg { width: 22px; height: 22px; }

/* ── Hojas (dialog) ── */
dialog.hoja {
  width: 100%; max-width: 640px; max-height: 90dvh; margin: auto auto 0; padding: 0;
  border: 0; border-radius: 24px 24px 0 0; background: #F7F8FA; color: var(--t1);
  box-shadow: 0 -20px 60px -20px rgba(15,17,21,.4); overflow: hidden;
}
dialog.hoja[open] { display: flex; flex-direction: column; animation: sube .34s var(--ease); }
dialog::backdrop { background: rgba(15,17,21,.45); backdrop-filter: blur(2px); }
@media (min-width: 700px) { dialog.hoja { margin: auto; border-radius: 24px; } }
.hoja-cab { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 18px 16px 10px 20px; border-bottom: var(--hair); }
.hoja-cab h2 { font-size: 1.3rem; }
.hoja-cuerpo { padding: 16px 20px calc(22px + env(safe-area-inset-bottom)); overflow-y: auto; display: grid; gap: 14px; }
.hero {
  background: linear-gradient(135deg, rgba(196,18,48,.07), rgba(37,99,235,.04));
  border: 1px solid rgba(196,18,48,.22); border-radius: var(--r-xl); padding: 1rem 1.1rem;
}
.hero p { margin: 0; color: #3A3F48; line-height: 1.55; }
.seccion-brief h3 { font: 500 .6rem/1 var(--f-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--t-label); margin: 0 0 8px; }
.seccion-brief ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 7px; }
.seccion-brief li { display: flex; gap: 9px; line-height: 1.45; color: var(--t2); }
.seccion-brief li::before { content: ""; flex: none; width: 7px; height: 7px; margin-top: .55em; border-radius: 50%; background: var(--vineta, var(--acc-400)); }
.siguiente { background: var(--graf) var(--acanalado); color: #F3F4F6; border-radius: var(--r-xl); padding: 1rem 1.1rem; }
.siguiente .eyebrow { color: var(--graf-active); }
.siguiente p { margin: 0; line-height: 1.5; }
.cargando { display: grid; gap: 10px; }
.esqueleto { height: 14px; border-radius: 7px; background: linear-gradient(90deg, #E9ECF0 25%, #F7F8FA 50%, #E9ECF0 75%); background-size: 200% 100%; animation: brillo 1.3s infinite linear; }
.pildoras { display: flex; background: var(--bg-card); border: 1px solid rgba(20,24,32,.09); border-radius: 13px; padding: 4px; gap: 2px; box-shadow: var(--shadow-pill); }
.pildora { flex: 1; border: 0; min-height: 40px; border-radius: 9px; background: transparent; color: var(--t-muted); font: 500 .8rem/1 var(--f-mono); }
.pildora.activa { background: var(--dark-grad); color: #FFFFFF; font-weight: 600; }
.fila-botones { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; margin-top: 10px; }

/* ── Aviso ── */
.aviso {
  position: fixed; left: 50%; top: calc(env(safe-area-inset-top) + 12px); transform: translateX(-50%); z-index: 50;
  max-width: min(520px, calc(100% - 32px)); background: var(--graf); color: #F3F4F6;
  padding: 10px 16px; border-radius: 14px; font-size: .88rem; box-shadow: 0 16px 36px -14px rgba(15,17,21,.6);
  animation: baja .3s var(--ease);
}

@keyframes entra { from { opacity: 0; transform: translateY(8px); } }
@keyframes sube { from { transform: translateY(40px); opacity: 0; } }
@keyframes baja { from { transform: translate(-50%, -12px); opacity: 0; } }
@keyframes punto { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@keyframes brillo { to { background-position: -200% 0; } }
@keyframes latido { 50% { box-shadow: 0 0 0 6px rgba(217,45,32,.12); } }
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }

/* ── Identidad Mi Lámina ── */
.vista-login {
  background: linear-gradient(180deg, rgba(21,23,27,.86), rgba(21,23,27,.94)), var(--acanalado), #2A2E35;
  color: #fff;
}
.vista-login .login h1 { color: #fff; font-size: clamp(3rem, 16vw, 4.2rem); line-height: .9; }
.vista-login .eyebrow { color: #FF8A7E; }
.vista-login .tenue { color: #C9CDD4; }
.vista-login .campo > span { color: #AEB4BE; }
.vista-login input { background: rgba(255,255,255,.96); }
.vista-login .error { color: #FF8A7E; }
.marca-empresa { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0 auto 6px; }
.marca-empresa img { height: 54px; width: auto; filter: drop-shadow(0 6px 18px rgba(196,18,48,.45)); }
.lema { font: 700 italic 1.05rem/1.2 var(--f-title); text-transform: uppercase; letter-spacing: .04em; color: #fff; margin: 4px 0 8px; }
.lema b { color: var(--acc-50); font-weight: 700; }
.pie-login { font: 400 .68rem/1.4 var(--f-mono); color: #8E95A2; margin-top: 10px; }

.cabecera { position: relative; }
.cabecera .logo-mini { height: 30px; width: auto; display: block; margin-bottom: 8px; }
.titulo .rojo { color: var(--acc-600); }

/* Tarjetas KPI con la orilla superior como canto de lámina */
.kpi::before { height: 4px; }
.kpi .val { font-family: var(--f-title); font-style: italic; font-weight: 700; font-size: 1.85rem; letter-spacing: 0; }

.barra-cliente { background: var(--graf) var(--acanalado); color: #fff; padding-bottom: 12px; border-radius: 0 0 22px 22px; box-shadow: 0 14px 30px -20px rgba(15,17,21,.7); }
.barra-cliente h1 { color: #fff; }
.barra-cliente .tenue-2 { color: #AEB4BE; }
.barra-cliente .btn-icono { color: #D7DAE0; }
.barra-cliente .btn-icono:hover { background: rgba(255,255,255,.08); color: #fff; }
.barra-cliente .btn-icono[aria-pressed="true"] { color: #fff; background: var(--acc-600); }
.acciones-cliente { margin-top: -2px; padding-top: 12px; }
.tabbar { background: var(--graf) var(--acanalado); }
.tabbar a.activo { background: var(--acc-grad); color: #fff; }
.seg.activo { background: var(--dark-grad); }
.tipos input:checked + span { background: var(--acc-grad); }
.pildora.activa { background: var(--acc-grad); }
.chip { border-color: rgba(196,18,48,.28); color: var(--acc-600); }
.escribiendo i { background: var(--acc-400); }
.linea-tiempo::before { background: linear-gradient(var(--acc-400), rgba(196,18,48,.08)); }
.bienvenida .logo { width: 56px; height: 56px; border-radius: 16px; font-size: 22px; }
.kpis > .kpi:first-child { grid-column: 1 / -1; }
@media (min-width: 640px) { .kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); } .kpis > .kpi:first-child { grid-column: auto; } }
.tabbar.con-bi { grid-template-columns: repeat(3, 1fr); width: min(420px, calc(100% - 32px)); }
