/* ==========================================================================
   ANIMAL PARK · DESLIZADERO EXTREMO — sistema de diseño premium
   CSS propio, sin build. Mobile-first (el operador usa iPhone).
   Craft: tipografía Inter, profundidad en capas, gradientes sobrios,
   feedback instantáneo, números tabulares, motion con intención.
   ========================================================================== */

:root {
  /* Marca — esmeralda, acento disciplinado */
  --brand: #0f766e;
  --brand-2: #12a594;
  --brand-strong: #0c5f58;
  --brand-deep: #073a35;
  --brand-soft: #e6f4f1;
  --brand-tint: #f3faf8;
  --brand-ring: color-mix(in srgb, var(--brand) 22%, transparent);
  --grad-brand: linear-gradient(135deg, #109387 0%, #0c6b62 100%);
  --grad-accent: linear-gradient(135deg, #14b8a6, #0f766e 70%);

  /* Superficies y tinta — neutros fríos, elegidos (no genéricos) */
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #f7f9fb;
  --ink: #0b1220;
  --text: #141b28;
  --text-soft: #3a4557;
  --muted: #64707f;
  --faint: #97a2b0;
  --border: #e6eaef;
  --border-strong: #d3dae2;
  --hairline: #eef1f4;

  /* Estados — sobrios, no de semáforo */
  --danger: #b42318;   --danger-soft: #fdeceb;
  --warning: #a86a12;  --warning-soft: #fbf0d9;
  --success: #067a4e;  --success-soft: #e3f5eb;
  --info: #1d68d6;     --info-soft: #e8f0fd;
  --neutral-soft: #eef1f4;

  /* Geometría — más ajustada (instrumento de trabajo, no app de juguete) */
  --radius: 13px;
  --radius-sm: 9px;
  --radius-lg: 18px;

  /* Sombras sutiles: el peso lo lleva el borde hairline */
  --shadow-xs: 0 1px 1.5px rgb(16 24 40 / 4%);
  --shadow: 0 1px 2px rgb(16 24 40 / 5%), 0 2px 6px -2px rgb(16 24 40 / 6%);
  --shadow-md: 0 4px 14px -6px rgb(16 24 40 / 12%);
  --shadow-lg: 0 12px 32px -12px rgb(16 24 40 / 18%), 0 4px 10px -4px rgb(16 24 40 / 10%);
  --glow-brand: 0 2px 8px -3px rgb(15 118 110 / 30%);

  /* Motion (curvas propias, las nativas son débiles) */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv11", "ss01";
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.2; color: var(--ink); }
h1 { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.022em; }
h2 { font-size: 1.06rem; font-weight: 650; letter-spacing: -0.015em; }
h3 { font-size: .95rem; font-weight: 650; letter-spacing: -0.01em; }

p { margin: 0 0 .75rem; }

::selection { background: color-mix(in srgb, var(--brand) 24%, transparent); }

/* Scrollbar fino y elegante */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cfd8de; border-radius: 999px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #b6c2cb; }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

/* ==========================================================================
   Estructura: sidebar + topbar
   ========================================================================== */

.shell { display: flex; min-height: 100dvh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  width: 262px;
  background: linear-gradient(180deg, #12161d 0%, #0e1219 60%, #0b0e14 100%);
  color: #c6cdd8;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform .3s var(--ease-drawer);
  box-shadow: inset -1px 0 0 rgb(255 255 255 / 4%);
}

.sidebar.is-open { transform: translateX(0); box-shadow: var(--shadow-lg); }

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1.15rem 1.15rem 1.05rem;
  color: #fff;
  border-bottom: 1px solid rgb(255 255 255 / 6%);
}

.sidebar__brand img,
.sidebar__logo-fallback {
  width: 40px; height: 40px; border-radius: 12px;
  object-fit: cover; background: #fff; flex-shrink: 0;
  box-shadow: 0 4px 12px rgb(0 0 0 / 30%), inset 0 0 0 1px rgb(255 255 255 / 20%);
}

.sidebar__logo-fallback {
  background: var(--grad-accent);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
}

.sidebar__brand > span:last-child,
.sidebar__brandtext { display: flex; flex-direction: column; min-width: 0; }
.sidebar__brandname { font-weight: 700; font-size: 1.02rem; letter-spacing: -0.015em; line-height: 1.15; }
.sidebar__brandsub {
  font-size: .62rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: #3ecf9e; margin-top: .18rem; white-space: nowrap;
}

.sidebar nav { flex: 1; overflow-y: auto; padding: .85rem .7rem; }
.sidebar nav::-webkit-scrollbar-thumb { border-color: #0d1016; background: rgb(255 255 255 / 14%); }

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: .72rem;
  padding: .62rem .8rem;
  margin-bottom: 3px;
  border-radius: var(--radius-sm);
  color: #95a0b0;
  font-weight: 500;
  font-size: .92rem;
  letter-spacing: -0.005em;
  position: relative;
  transition: background .16s var(--ease-out), color .16s var(--ease-out), transform .16s var(--ease-out);
}

.sidebar nav a svg { width: 19px; height: 19px; flex-shrink: 0; opacity: .8; transition: opacity .16s var(--ease-out); }
.sidebar nav a .nav__badge {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; background: #f04438; color: #fff;
  font-size: .68rem; font-weight: 700; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgb(240 68 56 / 50%);
}
.sidebar nav a:hover { background: rgb(255 255 255 / 6%); color: #fff; text-decoration: none; }
.sidebar nav a:hover svg { opacity: 1; }
.sidebar nav a:active { transform: scale(0.985); }
.sidebar nav a.is-active {
  background: rgb(255 255 255 / 9%);
  color: #fff;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 7%);
}
.sidebar nav a.is-active svg { opacity: 1; color: #2dd4bf; }

.sidebar nav .nav__section {
  margin: 1.2rem .85rem .45rem;
  font-size: .64rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #5c6675;
  font-weight: 700;
}

.sidebar__footer {
  padding: .95rem 1.15rem;
  border-top: 1px solid rgb(255 255 255 / 6%);
  font-size: .85rem;
  background: rgb(0 0 0 / 12%);
}
.sidebar__footer .who { color: #fff; font-weight: 600; letter-spacing: -0.01em; }
.sidebar__footer .role { color: #7d8798; font-size: .76rem; margin-bottom: .2rem; }

.backdrop {
  position: fixed; inset: 0; z-index: 40;
  background: rgb(8 10 14 / 55%);
  backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none;
  transition: opacity .3s var(--ease-out);
}
.backdrop.is-visible { opacity: 1; pointer-events: auto; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: .75rem;
  min-height: 58px;
  padding: .55rem 1rem;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--hairline);
}

.topbar__burger {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); cursor: pointer; font-size: 1.1rem;
  transition: transform .16s var(--ease-out), background .15s ease;
}
.topbar__burger:active { transform: scale(0.93); background: var(--bg); }

.topbar__title { font-weight: 700; font-size: 1.04rem; letter-spacing: -0.015em; color: var(--ink); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.content { padding: 1.2rem 1rem 4.5rem; max-width: 1200px; width: 100%; margin: 0 auto; }

@media (min-width: 1024px) {
  .sidebar { transform: none; position: sticky; top: 0; height: 100dvh; flex-shrink: 0; }
  .topbar__burger, .backdrop { display: none; }
  .topbar { padding: .55rem 1.6rem; }
  .content { padding: 1.6rem 1.8rem 3.5rem; }
}

@media (prefers-reduced-motion: no-preference) {
  .content { animation: page-in .34s var(--ease-out) both; }
  .grid--stats .stat { animation: page-in .4s var(--ease-out) both; }
  .grid--stats .stat:nth-child(1) { animation-delay: .02s; }
  .grid--stats .stat:nth-child(2) { animation-delay: .07s; }
  .grid--stats .stat:nth-child(3) { animation-delay: .12s; }
  .grid--stats .stat:nth-child(4) { animation-delay: .17s; }
}
@keyframes page-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Componentes
   ========================================================================== */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.3rem;
  margin-bottom: 1.05rem;
}

.card__title { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .9rem; }
.card__title h2 { margin: 0; }

.grid { display: grid; gap: .9rem; }
.grid--stats { grid-template-columns: repeat(2, 1fr); }
.grid--2 { grid-template-columns: 1fr; gap: 1.05rem; }

@media (min-width: 720px) {
  .grid--stats { grid-template-columns: repeat(4, 1fr); gap: 1.05rem; }
  .grid--2 { grid-template-columns: 1fr 1fr; }
}

/* Tarjetas de métricas */
.stat {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.05rem 1.15rem 1rem;
  transition: box-shadow .25s var(--ease-out), transform .25s var(--ease-out), border-color .2s ease;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.stat__label {
  color: var(--muted); font-size: .7rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
}
.stat__value {
  font-size: 1.85rem; font-weight: 700; letter-spacing: -0.035em; line-height: 1.1;
  margin-top: .28rem; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.stat__hint { color: var(--muted); font-size: .77rem; margin-top: .3rem; }

/* Botones — feedback instantáneo (scale .97 al presionar) */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .6rem 1.1rem;
  min-height: 42px;
  border-radius: 10px;
  border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: .92rem; letter-spacing: -0.005em;
  cursor: pointer;
  text-decoration: none !important;
  transition: transform .16s var(--ease-out), background .15s ease, border-color .15s ease,
              box-shadow .22s var(--ease-out), filter .15s ease;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn--primary {
  background: var(--brand);
  color: #fff;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 12%), 0 1px 2px rgb(12 95 88 / 30%);
}
.btn--primary:hover { background: var(--brand-strong); box-shadow: inset 0 1px 0 rgb(255 255 255 / 12%), 0 2px 6px -2px rgb(12 95 88 / 40%); }

.btn--secondary {
  background: var(--surface); color: var(--text-soft);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-xs);
}
.btn--secondary:hover { background: var(--surface-2); border-color: #c3ccd6; }

.btn--danger { background: var(--danger); color: #fff; box-shadow: inset 0 1px 0 rgb(255 255 255 / 12%), 0 1px 2px rgb(120 20 15 / 30%); }
.btn--danger:hover { background: #9a1f14; }

.btn--ghost { background: transparent; color: var(--brand); }
.btn--ghost:hover { background: var(--brand-soft); }

.btn--lg { min-height: 52px; padding: .85rem 1.5rem; font-size: 1rem; width: 100%; border-radius: 11px; }
.btn--sm { min-height: 34px; padding: .3rem .8rem; font-size: .84rem; border-radius: 8px; }

@media (min-width: 720px) { .btn--lg { width: auto; } }

/* Iconografía SVG (estilo Lucide) — reemplaza emojis en toda la UI */
.btn svg { width: 1.05em; height: 1.05em; flex-shrink: 0; }
.btn--sm svg { width: 1em; height: 1em; }
h1 > svg, h2 > svg, h3 > svg { width: 1.12em; height: 1.12em; vertical-align: -0.17em; margin-right: .12rem; color: var(--muted); }
.card__title h2 > svg { color: var(--brand); }
.empty__icon svg { width: 42px; height: 42px; color: var(--faint); stroke-width: 1.6; }
.dropzone__icon svg, .filepick__icon svg { width: 34px; height: 34px; color: var(--brand); stroke-width: 1.7; }
.ico-inline { width: 1em; height: 1em; vertical-align: -0.13em; flex-shrink: 0; }
.chat__back svg, .topbar__burger svg { width: 20px; height: 20px; }

/* Formularios */
.field { margin-bottom: 1.05rem; }
.field label { display: block; font-weight: 600; font-size: .86rem; margin-bottom: .38rem; color: var(--text-soft); letter-spacing: -0.005em; }
.field .hint { color: var(--muted); font-size: .78rem; margin-top: .32rem; }
.field .error { color: var(--danger); font-size: .8rem; margin-top: .3rem; font-weight: 500; }

.input, select, textarea {
  width: 100%;
  padding: .62rem .85rem;
  min-height: 46px;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  outline: none;
  box-shadow: inset 0 1px 2px rgb(11 18 32 / 3%);
  transition: border-color .15s var(--ease-out), box-shadow .15s var(--ease-out);
  -webkit-appearance: none; appearance: none;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2361708a' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .75rem center; padding-right: 2.3rem;
}
textarea { min-height: 88px; resize: vertical; }
.input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3.5px var(--brand-ring), inset 0 1px 2px rgb(11 18 32 / 3%);
}
.input::placeholder, textarea::placeholder { color: var(--faint); }
.input.is-invalid, select.is-invalid, textarea.is-invalid { border-color: var(--danger); }
.input.is-invalid:focus { box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--danger) 18%, transparent); }

.input-group { display: flex; gap: .5rem; }
.input-group > select { width: 132px; flex-shrink: 0; }

.checkbox { display: flex; align-items: center; gap: .6rem; font-weight: 500; cursor: pointer; }
.checkbox input { width: 20px; height: 20px; accent-color: var(--brand); }

.form-grid { display: grid; gap: 0 1rem; }
@media (min-width: 720px) { .form-grid { grid-template-columns: 1fr 1fr; } }
.form-grid .field--full { grid-column: 1 / -1; }

/* Badges de estado — con punto indicador */
.badge {
  display: inline-flex; align-items: center; gap: .38rem;
  padding: .22rem .66rem;
  border-radius: 999px;
  font-size: .73rem; font-weight: 650; letter-spacing: .01em;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; flex-shrink: 0;
}
.badge--neutral { background: var(--neutral-soft); color: #3d4a5e; }
.badge--muted { background: var(--neutral-soft); color: var(--muted); }
.badge--info { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 14%, transparent); }
.badge--warning { background: var(--warning-soft); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 16%, transparent); }
.badge--success { background: var(--success-soft); color: var(--success); border-color: color-mix(in srgb, var(--success) 16%, transparent); }
.badge--danger { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 16%, transparent); }
.badge--primary { background: var(--brand-soft); color: var(--brand-strong); border-color: color-mix(in srgb, var(--brand) 16%, transparent); }

/* Alertas / flash */
.alert {
  padding: .85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  margin-bottom: 1rem;
  font-weight: 500;
  font-size: .92rem;
}
.alert--success { background: var(--success-soft); color: var(--success); border-color: color-mix(in srgb, var(--success) 25%, transparent); }
.alert--danger { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.alert--info { background: var(--info-soft); color: var(--info); }
.alert ul { margin: .25rem 0 0 1.1rem; padding: 0; }

/* Tablas */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -1.3rem; padding: 0 1.3rem; }
table.table { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 640px; }
.table th {
  text-align: left; font-size: .68rem; letter-spacing: .09em; text-transform: uppercase;
  color: var(--muted); font-weight: 700;
  padding: .6rem .7rem; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td { padding: .78rem .7rem; border-bottom: 1px solid var(--hairline); vertical-align: middle; font-variant-numeric: tabular-nums; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .13s ease; }
.table tbody tr:hover { background: var(--brand-tint); }
.table .t-muted { color: var(--muted); font-size: .84rem; }
.table .t-strong { font-weight: 600; color: var(--ink); }

/* Lista móvil (tarjetas) */
.rowcards { display: grid; gap: .6rem; }
.rowcard {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-xs);
  padding: .85rem .95rem;
  color: inherit;
  text-decoration: none !important;
  transition: transform .16s var(--ease-out), box-shadow .2s var(--ease-out), border-color .16s ease;
}
.rowcard:active { transform: scale(0.99); }
.rowcard:hover { box-shadow: var(--shadow); border-color: var(--border-strong); }
.rowcard__top { display: flex; justify-content: space-between; align-items: center; gap: .6rem; margin-bottom: .28rem; }
.rowcard__name { font-weight: 700; letter-spacing: -0.01em; }
.rowcard__meta { color: var(--muted); font-size: .81rem; display: flex; flex-wrap: wrap; gap: .35rem .8rem; }

@media (min-width: 900px) { .only-mobile { display: none !important; } }
@media (max-width: 899.98px) { .only-desktop { display: none !important; } }

/* Paginación */
.pagination { display: flex; gap: .3rem; flex-wrap: wrap; margin-top: 1rem; }
.pagination__link {
  min-width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 .6rem;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text-soft); font-weight: 600; font-size: .87rem;
  text-decoration: none !important;
  transition: transform .14s var(--ease-out), background .14s ease, border-color .14s ease;
}
.pagination__link:hover { background: var(--surface-2); }
.pagination__link:active { transform: scale(0.95); }
.pagination__link.is-active { background: var(--brand); border-color: transparent; color: #fff; }
.pagination__link.is-disabled { opacity: .45; pointer-events: none; }

/* Pasos del asistente */
.steps { display: flex; gap: .45rem; margin-bottom: 1.25rem; }
.steps__item {
  flex: 1; text-align: center;
  font-size: .72rem; font-weight: 700; color: var(--muted);
  padding-top: .5rem;
  transition: color .2s var(--ease-out);
}
.steps__item::before {
  content: ""; display: block; height: 5px; border-radius: 4px;
  background: var(--border-strong); margin-bottom: .45rem;
  transition: background .3s var(--ease-out);
}
.steps__item.is-active { color: var(--brand-strong); }
.steps__item.is-active::before { background: var(--grad-accent); }
.steps__item.is-done { color: var(--success); }
.steps__item.is-done::before { background: var(--success); }
.steps__item.is-error { color: var(--danger); }
.steps__item.is-error::before { background: var(--danger); }

/* Barra de progreso */
.progress { background: var(--neutral-soft); border-radius: 999px; height: 12px; overflow: hidden; }
.progress__bar {
  height: 100%; width: 0%;
  background: var(--grad-accent);
  border-radius: 999px;
  transition: width .3s var(--ease-out);
}
.progress-meta { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); margin-top: .4rem; font-variant-numeric: tabular-nums; }

/* Selector de archivo simple */
.filepick {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 1.6rem 1rem;
  text-align: center;
  cursor: pointer;
  background: var(--surface-2);
  transition: border-color .18s var(--ease-out), background .18s var(--ease-out), transform .16s var(--ease-out);
}
.filepick:hover, .filepick.is-drag { border-color: var(--brand); background: var(--brand-tint); }
.filepick.is-drag { transform: scale(1.01); border-style: solid; }
.filepick__icon { font-size: 1.9rem; }
.filepick__name { font-weight: 700; word-break: break-all; margin-top: .2rem; }
.filepick__meta { color: var(--muted); font-size: .82rem; }
.filepick input[type="file"] { display: none; }

/* Gráfico de barras */
.chart { display: flex; align-items: flex-end; gap: 7px; height: 156px; padding-top: .5rem; }
.chart__col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 5px; min-width: 0; height: 100%; }
.chart__stack { width: 100%; max-width: 32px; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.chart__bar { width: 100%; border-radius: 5px 5px 0 0; background: #d3e6e3; min-height: 2px; transition: background .2s ease; }
.chart__bar--ok { background: var(--grad-accent); border-radius: 0; }
.chart__col:hover .chart__bar { background: #bcd8d4; }
.chart__label { font-size: .6rem; color: var(--faint); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Línea de tiempo */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 1rem 1.65rem; }
.timeline li::before {
  content: ""; position: absolute; left: 6px; top: 6px; bottom: -6px;
  width: 2px; background: var(--border-strong);
}
.timeline li:last-child::before { display: none; }
.timeline li::after {
  content: ""; position: absolute; left: 0; top: 4px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
}
.timeline .when { color: var(--muted); font-size: .78rem; }

/* Modal */
.modal { border: none; border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 0; width: min(480px, calc(100vw - 2rem)); }
.modal::backdrop { background: rgb(8 10 14 / 58%); backdrop-filter: blur(4px); }
.modal__body { padding: 1.35rem; }
.modal__actions { display: flex; gap: .6rem; justify-content: flex-end; padding: 1rem 1.35rem; border-top: 1px solid var(--border); }
@media (prefers-reduced-motion: no-preference) {
  .modal[open] { animation: modal-in .26s var(--ease-out); }
}
@keyframes modal-in {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Utilidades */
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; letter-spacing: 0; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; }
.mb-0 { margin-bottom: 0; }
.flex { display: flex; gap: .6rem; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; }
.right { text-align: right; }
.center { text-align: center; }
.empty { text-align: center; color: var(--muted); padding: 2.6rem 1rem; }
.empty__icon { font-size: 2.1rem; margin-bottom: .35rem; }

.filters { display: grid; gap: .6rem; grid-template-columns: 1fr 1fr; }
.filters .filters__search { grid-column: 1 / -1; }
@media (min-width: 900px) {
  .filters { grid-template-columns: 2fr 1fr 1fr 1fr auto; align-items: end; }
  .filters .filters__search { grid-column: auto; }
}

.kv { display: grid; grid-template-columns: auto 1fr; gap: .38rem .95rem; font-size: .9rem; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; word-break: break-word; }

/* ==========================================================================
   Acceso (login) — presentación premium en dos paneles
   ========================================================================== */

.auth {
  min-height: 100dvh;
  display: grid;
  background: var(--bg);
}

.auth__panel {
  position: relative;
  overflow: hidden;
  display: none;
  flex-direction: column;
  justify-content: center;
  padding: 3.2rem 3.4rem;
  color: #eafffb;
  background:
    radial-gradient(90% 70% at 85% -10%, rgb(45 212 191 / 9%), transparent 60%),
    linear-gradient(200deg, #14181f 0%, #0c0f15 70%, #090b10 100%);
}
.auth__panel::after {
  content: ""; position: absolute; inset: auto -20% -35% auto;
  width: 520px; height: 520px; border-radius: 50%;
  background: radial-gradient(circle, rgb(45 212 191 / 7%), transparent 65%);
  pointer-events: none;
}

.auth__brandmark {
  width: 62px; height: 62px; border-radius: 18px;
  background: var(--grad-accent);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.9rem;
  box-shadow: 0 12px 32px rgb(0 0 0 / 35%), inset 0 0 0 1px rgb(255 255 255 / 22%);
  margin-bottom: 1.6rem;
}
.auth__overline {
  font-size: .68rem; font-weight: 700; letter-spacing: .22em; text-transform: uppercase;
  color: #3ecf9e; margin-bottom: .5rem;
}
.auth__headline { font-size: 2.3rem; font-weight: 700; letter-spacing: -0.03em; color: #fff; margin: 0 0 .7rem; line-height: 1.08; }
.auth__lede { color: #9aa4b3; font-size: 1.02rem; max-width: 40ch; margin-bottom: 1.8rem; }

.auth__points { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.auth__points li { display: flex; align-items: center; gap: .7rem; color: #cbd5e1; font-size: .93rem; font-weight: 500; }
.auth__points li::before {
  content: "✓";
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  background: rgb(45 212 191 / 13%); color: #2dd4bf;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 700;
  box-shadow: inset 0 0 0 1px rgb(45 212 191 / 28%);
}

.auth__side {
  display: grid; place-items: center;
  padding: 1.4rem;
  background:
    radial-gradient(800px 420px at 110% -10%, color-mix(in srgb, var(--brand) 10%, transparent), transparent),
    var(--bg);
}

.auth__card {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2rem 1.9rem 1.7rem;
}
@media (prefers-reduced-motion: no-preference) {
  .auth__card { animation: page-in .4s var(--ease-out) both; }
}

.auth__mobilebrand { display: flex; align-items: center; gap: .8rem; margin-bottom: 1.4rem; }
.auth__mobilebrand .mark {
  width: 46px; height: 46px; border-radius: 14px;
  background: var(--grad-accent); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  box-shadow: var(--glow-brand), inset 0 0 0 1px rgb(255 255 255 / 25%);
}
.auth__mobilebrand strong { display: block; font-size: 1.05rem; letter-spacing: -0.02em; color: var(--ink); }
.auth__mobilebrand span { display: block; font-size: .62rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--brand); }

.auth__formtitle { font-size: 1.25rem; margin-bottom: .2rem; }
.auth__formsub { color: var(--muted); font-size: .88rem; margin-bottom: 1.4rem; }

@media (min-width: 1000px) {
  .auth { grid-template-columns: 1.05fr 1fr; }
  .auth__panel { display: flex; }
  .auth__mobilebrand { display: none; }
}

/* ==========================================================================
   Nueva entrega — flujo rápido
   ========================================================================== */

.ne { max-width: 640px; margin-inline: auto; }
.ne__intro { color: var(--muted); font-size: .9rem; margin: -.2rem 0 1.25rem; }

.field--xl label { font-size: .9rem; }
.field--xl .input, .field--xl select { min-height: 52px; font-size: 1.04rem; border-radius: 13px; }

.dropzone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
  background: var(--surface-2);
  transition: border-color .18s var(--ease-out), background .18s var(--ease-out), transform .16s var(--ease-out);
}
.dropzone:hover, .dropzone.is-drag { border-color: var(--brand); background: var(--brand-tint); }
.dropzone.is-drag { transform: scale(1.01); border-style: solid; }
.dropzone:active { transform: scale(0.995); }
.dropzone__icon { font-size: 2.1rem; }
.dropzone__title { font-weight: 700; margin-top: .3rem; letter-spacing: -0.01em; }
.dropzone__hint { color: var(--muted); font-size: .8rem; margin-top: .2rem; }
.dropzone input[type="file"] { display: none; }

.videolist { display: grid; gap: .55rem; margin-top: .95rem; }
.videoitem {
  display: flex; align-items: center; gap: .8rem;
  padding: .72rem .85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 13px;
  box-shadow: var(--shadow-xs);
  animation: item-in .3s var(--ease-out) both;
}
@keyframes item-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.videoitem__thumb {
  width: 42px; height: 42px; flex-shrink: 0;
  border-radius: 11px; background: var(--brand-soft); color: var(--brand-strong);
  display: inline-flex; align-items: center; justify-content: center; font-size: 1.15rem;
}
.videoitem__main { flex: 1; min-width: 0; }
.videoitem__name { font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -0.005em; }
.videoitem__meta { color: var(--muted); font-size: .77rem; margin-top: .1rem; display: flex; align-items: center; gap: .4rem; font-variant-numeric: tabular-nums; }
.videoitem__bar { height: 5px; background: var(--neutral-soft); border-radius: 999px; overflow: hidden; margin-top: .45rem; display: none; }
.videoitem__bar > span { display: block; height: 100%; width: 0%; background: var(--grad-accent); border-radius: 999px; transition: width .3s var(--ease-out); }
.videoitem__remove {
  flex-shrink: 0; width: 32px; height: 32px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  transition: transform .14s var(--ease-out), background .14s ease, color .14s ease, border-color .14s ease;
}
.videoitem__remove:hover { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.videoitem__remove:active { transform: scale(0.9); }
.videoitem__state { font-size: .78rem; font-weight: 700; flex-shrink: 0; font-variant-numeric: tabular-nums; }

.videoitem.is-active { border-color: color-mix(in srgb, var(--brand) 40%, transparent); box-shadow: 0 0 0 3px var(--brand-ring); }
.videoitem.is-active .videoitem__bar { display: block; }
.videoitem.is-done { border-color: color-mix(in srgb, var(--success) 35%, transparent); }
.videoitem.is-done .videoitem__thumb { background: var(--success-soft); color: var(--success); }
.videoitem.is-error { border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.videoitem.is-error .videoitem__thumb { background: var(--danger-soft); color: var(--danger); }

.ne-results { display: grid; gap: .5rem; margin-top: 1rem; }

/* ==========================================================================
   Mensajes — lista de conversaciones + hilo estilo chat
   ========================================================================== */

/* ==========================================================================
   Lista de conversaciones (estilo WhatsApp): un panel con filas contiguas
   separadas por hairline, buscador, avatar con color propio por contacto.
   ========================================================================== */

.convos {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* ------------------------------------------------------------- encabezado */
.convos__head {
  display: flex; align-items: center; gap: .8rem; flex-wrap: wrap;
  padding: .9rem 1.1rem;
  border-bottom: 1px solid var(--hairline);
  background: var(--surface-2);
}
.convos__title { min-width: 0; }
.convos__title h1 { margin: 0; font-size: 1.2rem; }
.convos__count { font-size: .8rem; color: var(--muted); }
.convos__unreadtxt { color: var(--brand-strong); }

.convos__search {
  position: relative; flex: 1; min-width: 200px; max-width: 380px; margin-left: auto;
}
.convos__search svg {
  position: absolute; left: .7rem; top: 50%; transform: translateY(-50%);
  width: 17px; height: 17px; color: var(--faint); pointer-events: none;
}
.convos__search input {
  width: 100%; min-height: 40px;
  padding: .45rem .8rem .45rem 2.3rem;
  font: inherit; font-size: .9rem;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: 999px;
  outline: none;
  transition: border-color .15s var(--ease-out), box-shadow .15s var(--ease-out);
}
.convos__search input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3.5px var(--brand-ring);
}
.convos__search input::-webkit-search-cancel-button { display: none; }
.convos__clear {
  position: absolute; right: .55rem; top: 50%; transform: translateY(-50%);
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%;
  color: var(--muted); background: var(--neutral-soft);
}
.convos__clear svg { width: 13px; height: 13px; }
.convos__clear:hover { background: var(--border-strong); text-decoration: none; }

/* ------------------------------------------------------------------ filas */
.convos__list { display: flex; flex-direction: column; }

.convo {
  display: flex; align-items: center; gap: .85rem;
  padding: .7rem 1.1rem;
  color: inherit; text-decoration: none !important;
  border-bottom: 1px solid var(--hairline);
  transition: background .13s ease;
}
.convo:last-child { border-bottom: 0; }
.convo:hover { background: var(--brand-tint); }
.convo:active { background: var(--brand-soft); }

.convo__avatar {
  width: 46px; height: 46px; flex-shrink: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 650; font-size: 1.08rem; color: #fff;
  /* Color propio por contacto: tono estable, saturación y luz controladas */
  background: linear-gradient(140deg,
      hsl(var(--h, 170) 45% 46%),
      hsl(calc(var(--h, 170) + 18) 48% 38%));
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 22%);
}

.convo__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .18rem; }
.convo__top, .convo__bottom {
  display: flex; align-items: center; justify-content: space-between; gap: .6rem;
}
.convo__name {
  font-weight: 600; letter-spacing: -0.01em; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.convo__time {
  flex-shrink: 0; font-size: .74rem; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.convo__preview {
  display: flex; align-items: center; gap: .25rem;
  min-width: 0; color: var(--muted); font-size: .87rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.convo__preview .tick { margin: 0; }
.convo__preview svg { flex-shrink: 0; }

.convo__badge {
  flex-shrink: 0; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; background: #25d366; color: #06371c;
  font-size: .72rem; font-weight: 700; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}

/* Conversación con mensajes sin leer */
.convo--unread { background: color-mix(in srgb, var(--brand) 4%, transparent); }
.convo--unread .convo__name { font-weight: 700; }
.convo--unread .convo__preview { color: var(--text); font-weight: 500; }
.convo--unread .convo__time { color: var(--success); font-weight: 600; }

/* -------------------------------------------------------------- vacío/pies */
.convos__empty { text-align: center; color: var(--muted); padding: 3rem 1.5rem; }
.convos__empty svg { width: 40px; height: 40px; color: var(--faint); stroke-width: 1.6; }
.convos__empty p { margin: .4rem 0 0; }
.convos__pages { padding: .8rem 1.1rem; border-top: 1px solid var(--hairline); }
.convos__pages .pagination { margin: 0; }

@media (max-width: 720px) {
  .convos { border-radius: 0; border-left: 0; border-right: 0; }
  .convos__head { padding: .8rem .9rem; }
  .convos__search { max-width: none; margin-left: 0; order: 3; width: 100%; }
  .convo { padding: .65rem .9rem; }
}

/* ==========================================================================
   Chat estilo WhatsApp: separadores de día, burbujas con cola, acuses de
   lectura y barra de redacción con envío de video.
   ========================================================================== */

.chat {
  display: flex; flex-direction: column;
  height: calc(100dvh - 8.5rem); min-height: 460px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-md); overflow: hidden;
}

/* -------------------------------------------------------------- encabezado */
.chat__header {
  display: flex; align-items: center; gap: .7rem;
  padding: .6rem .85rem;
  border-bottom: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  flex-shrink: 0;
}
.chat__back {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; flex-shrink: 0;
  color: var(--text-soft); border-radius: 50%;
  transition: background .15s ease;
}
.chat__back:hover { background: var(--neutral-soft); text-decoration: none; }
.chat__avatar {
  width: 42px; height: 42px; flex-shrink: 0; border-radius: 50%;
  background: var(--grad-accent); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.05rem;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 25%);
}
.chat__who { min-width: 0; flex: 1; }
.chat__name {
  font-weight: 650; letter-spacing: -0.01em; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat__status { font-size: .76rem; color: var(--muted); display: flex; align-items: center; gap: .32rem; }
.chat__dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--success);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 18%, transparent);
}
.chat__headaction { flex-shrink: 0; }

/* -------------------------------------------------------------------- hilo */
.chat__body {
  flex: 1; overflow-y: auto; padding: 1rem .9rem 1.2rem;
  display: flex; flex-direction: column; gap: 2px;
  background-color: #eae6df;
  background-image:
    radial-gradient(circle at 20% 15%, color-mix(in srgb, var(--brand) 7%, transparent), transparent 55%),
    radial-gradient(rgb(0 0 0 / 4%) 1px, transparent 1px);
  background-size: auto, 22px 22px;
}
.chat__body::-webkit-scrollbar-thumb { border-color: #eae6df; }

.chat__daysep { display: flex; justify-content: center; margin: .9rem 0 .55rem; }
.chat__daysep span {
  background: rgb(255 255 255 / 92%);
  color: var(--text-soft);
  font-size: .72rem; font-weight: 600;
  padding: .28rem .8rem; border-radius: 999px;
  box-shadow: 0 1px 2px rgb(16 24 40 / 8%);
  text-transform: capitalize;
}

.chat__empty {
  margin: auto; text-align: center; color: var(--muted);
  background: rgb(255 255 255 / 75%); padding: 1.6rem 1.8rem; border-radius: var(--radius);
}
.chat__empty svg { width: 38px; height: 38px; color: var(--faint); stroke-width: 1.6; }
.chat__empty p { margin: .5rem 0 0; }

/* ---------------------------------------------------------------- burbujas */
.bubble {
  position: relative;
  max-width: min(78%, 560px);
  padding: .42rem .62rem .32rem;
  border-radius: 12px;
  font-size: .93rem; line-height: 1.45;
  box-shadow: 0 1px .5px rgb(16 24 40 / 13%);
  margin-top: .5rem;
  animation: bubble-in .22s var(--ease-out) both;
}
.bubble--cont { margin-top: 2px; }
@keyframes bubble-in {
  from { opacity: 0; transform: translateY(6px) scale(.985); }
  to { opacity: 1; transform: none; }
}

.bubble__text { white-space: pre-wrap; word-break: break-word; }
.bubble__img {
  display: block; max-width: min(260px, 62vw); max-height: 330px;
  border-radius: 8px; margin-bottom: .28rem; object-fit: cover;
  background: var(--neutral-soft);
}
.bubble__file { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; margin-bottom: .25rem; }
.bubble__time {
  font-size: .66rem; color: var(--faint);
  margin-top: .1rem; text-align: right; font-variant-numeric: tabular-nums;
  display: flex; align-items: center; justify-content: flex-end; gap: .1rem;
  line-height: 1;
}

.bubble--in {
  align-self: flex-start;
  background: #fff;
  border-top-left-radius: 4px;
}
.bubble--in.bubble--cont { border-top-left-radius: 12px; }
.bubble--in:not(.bubble--cont)::before {
  content: ""; position: absolute; top: 0; left: -7px;
  width: 8px; height: 13px; background: #fff;
  clip-path: polygon(100% 0, 0 0, 100% 100%);
}

.bubble--out {
  align-self: flex-end;
  background: #d9fdd3;
  border-top-right-radius: 4px;
}
.bubble--out.bubble--cont { border-top-right-radius: 12px; }
.bubble--out:not(.bubble--cont)::before {
  content: ""; position: absolute; top: 0; right: -7px;
  width: 8px; height: 13px; background: #d9fdd3;
  clip-path: polygon(0 0, 100% 0, 0 100%);
}
.bubble--out .bubble__time { color: #5c8a72; }

.bubble--video { background: #cdf3e4; }
.bubble--video:not(.bubble--cont)::before { background: #cdf3e4; }
.bubble__tag {
  display: flex; align-items: center; gap: .3rem;
  font-size: .68rem; font-weight: 700; letter-spacing: .03em;
  color: var(--brand-strong); margin-bottom: .2rem; text-transform: uppercase;
}

/* Acuses: un tick enviado, doble entregado, doble azul leido */
.tick { margin-left: .12rem; font-size: .74rem; letter-spacing: -2.5px; color: #8aa79a; }
.tick--read { color: #34b7f1 !important; }
.tick--failed {
  color: var(--danger) !important; font-weight: 700; letter-spacing: 0;
  display: inline-flex; align-items: center; justify-content: center;
  width: 13px; height: 13px; border-radius: 50%; margin-left: .25rem;
  border: 1.5px solid currentColor; font-size: .6rem;
}

.chat__notice {
  display: flex; align-items: center; gap: .45rem;
  padding: .55rem .9rem; font-size: .82rem;
  color: var(--warning); background: var(--warning-soft);
  border-top: 1px solid color-mix(in srgb, var(--warning) 22%, transparent);
}

/* --------------------------------------------------------------- redaccion */
.chat__compose {
  display: flex; gap: .5rem; align-items: flex-end;
  padding: .6rem .7rem; border-top: 1px solid var(--hairline);
  background: var(--surface-2); flex-shrink: 0;
}
.chat__compose textarea {
  flex: 1; min-height: 44px; max-height: 130px; resize: none;
  border-radius: 22px; padding: .68rem 1rem;
  border: 1px solid var(--border-strong); background: var(--surface);
  font: inherit; font-size: .93rem; line-height: 1.4;
  transition: border-color .15s var(--ease-out), box-shadow .15s var(--ease-out);
}
.chat__compose textarea:disabled { background: var(--neutral-soft); color: var(--muted); }

.chat__attach, .chat__send {
  flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .16s var(--ease-out), background .15s ease, filter .15s ease;
}
.chat__attach svg, .chat__send svg { width: 20px; height: 20px; }
.chat__attach {
  background: var(--surface); color: var(--text-soft);
  border-color: var(--border-strong); box-shadow: var(--shadow-xs);
}
.chat__attach:hover { background: var(--brand-soft); color: var(--brand-strong); border-color: color-mix(in srgb, var(--brand) 30%, transparent); }
.chat__send { background: var(--brand); color: #fff; box-shadow: inset 0 1px 0 rgb(255 255 255 / 12%), 0 1px 2px rgb(12 95 88 / 30%); }
.chat__send:hover:not(:disabled) { background: var(--brand-strong); }
.chat__attach:active, .chat__send:active { transform: scale(0.93); }
.chat__attach:disabled, .chat__send:disabled { opacity: .5; cursor: not-allowed; }

.chat__upload { padding: .6rem .9rem .8rem; border-top: 1px solid var(--hairline); background: var(--surface); }
.chat__upload-info { display: flex; justify-content: space-between; gap: .6rem; font-size: .82rem; margin-bottom: .35rem; }
.chat__upload .progress { height: 6px; }

@media (max-width: 720px) {
  .chat { height: calc(100dvh - 6.5rem); border-radius: 0; border-left: 0; border-right: 0; }
  .bubble { max-width: 86%; }
  .chat__headaction { display: none; }
}

/* ==========================================================================
   Reconocimiento facial — revisión de candidatos (Deslizadero Extremo)
   ========================================================================== */

.fr-tabs { display: inline-flex; gap: .35rem; }

/* Panel de envío manual (pestaña Enviados) */
.fr-manual {
  background: var(--surface-2);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  padding: .5rem .75rem;
}
.fr-manual summary { cursor: pointer; font-weight: 600; font-size: .85rem; color: var(--text-soft); }
.fr-manual[open] { border-style: solid; border-color: color-mix(in srgb, var(--brand) 30%, transparent); }
.fr-manualrow td { border-bottom: 1px solid var(--hairline) !important; }

/* Cámara del registro de clientes */
.cam__video, .cam__preview {
  width: 100%; max-width: 340px; aspect-ratio: 4 / 3;
  object-fit: cover; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: #0b0e13;
  display: block;
}
.cam__preview { border-color: color-mix(in srgb, var(--success) 35%, transparent); }

.fr-video {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  padding: .85rem .95rem;
  margin-bottom: .7rem;
}
.fr-video__head { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.fr-video__name { font-weight: 700; letter-spacing: -0.01em; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fr-candidates { display: grid; gap: .55rem; margin-top: .6rem; }

.fr-candidate {
  display: flex; align-items: center; gap: .9rem; flex-wrap: wrap;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: .65rem .75rem;
}
.fr-candidate__imgs { display: flex; gap: .5rem; }
.fr-candidate__imgs figure { margin: 0; text-align: center; }
.fr-candidate__imgs img {
  width: 74px; height: 74px; object-fit: cover; border-radius: 10px;
  background: var(--neutral-soft); border: 1px solid var(--border);
}
.fr-candidate__imgs figcaption { font-size: .62rem; color: var(--faint); margin-top: .15rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.fr-candidate__info { flex: 1; min-width: 180px; }
.fr-candidate__name { font-weight: 700; letter-spacing: -0.01em; }
.fr-candidate__actions { display: flex; gap: .45rem; align-items: center; }

/* ==========================================================================
   Accesibilidad
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
