/* Tokens y estilos — valores exactos del handoff design_handoff_aprobacion_semanal */

:root {
  --bg: #f1f2f5;
  --surface: #ffffff;
  --ink: #1b1d23;
  --ink-2: #2c2f36;
  --ink-3: #3c4048;
  --muted: #71757e;
  --muted-2: #9aa0a8;
  --muted-3: #a0a4ad;
  --muted-3b: #a8adb5;
  --disabled-ink: #c8ccd3;
  --disabled-ink-2: #c4c8cf;
  --hairline: #eef0f3;
  --border: #e6e8ec;
  --border-2: #e2e4e9;
  --border-hover: #c8ccd3;
  --field: #f7f8fa;
  --field-2: #f3f4f7;
  --accent: #5551d6;
  --accent-hover: #443fc4;
  --accent-ink: #3f3bb8;
  --accent-soft-bg: #f5f5ff;
  --accent-soft-border: #d8d7f5;
  --warn: #c98a1e;
  --warn-border: #ece0c8;
  --danger: #c8564f;
  --danger-border: #eadad8;
  --danger-bg: #fdf6f5;
  --scrim: rgba(20, 22, 30, 0.32);
  --card-shadow: 0 12px 32px rgba(20, 22, 30, 0.1);
  --btn-shadow: 0 2px 10px rgba(20, 22, 30, 0.06);
  --accent-shadow: 0 6px 18px rgba(85, 81, 214, 0.32);
  --stripe: repeating-linear-gradient(135deg, #eceef2 0 9px, #e5e7ed 9px 18px);
  --stripe-sm: repeating-linear-gradient(135deg, #eceef2 0 8px, #e5e7ed 8px 16px);
  --display: "Bricolage Grotesque", sans-serif;
  --ui: "Manrope", system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: var(--bg); }
body { font-family: var(--ui); color: var(--ink); }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-ink); }
input, textarea, button { font-family: var(--ui); }
button { cursor: pointer; }
textarea { resize: none; }
::placeholder { color: var(--muted-3); }

@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

/* ---------- base compartida ---------- */

.wordmark { display: flex; align-items: center; gap: 8px; }
.wordmark-dot { width: 10px; height: 10px; border-radius: 99px; background: var(--accent); }
.wordmark-name { font-family: var(--display); font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }

.label-upper {
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted-2);
}

.avatar { display: block; flex: 0 0 auto; border-radius: 99px; }

/* El video reemplaza al rayado. La caja ya tiene el aspecto real del archivo,
   así que `cover` llena hasta el borde sin recortar nada y sin dejar la franja
   de un píxel que deja `contain` al redondear. */
.pieza-video { width: 100%; height: 100%; object-fit: cover; display: block; background: #0e1016; }
.fd-preview.has-video, .dt-preview.has-video { background: #0e1016; padding-bottom: 0; }
.dt-preview.has-video { overflow: hidden; }

.mono-tag {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase; color: #8b9099; background: #ffffff;
  padding: 6px 10px; border-radius: 6px;
}

.text-btn { background: none; border: none; padding: 0; font-size: 13px; font-weight: 600; }

/* ---------- login ---------- */

.lg-screen {
  width: 100%; max-width: 480px; min-height: 100vh; margin: 0 auto;
  padding: 40px 28px 32px; display: flex; flex-direction: column;
  justify-content: space-between; background: var(--surface);
}
.lg-center { display: flex; flex-direction: column; gap: 28px; }
.lg-heading { display: flex; flex-direction: column; gap: 12px; }
.lg-h1 {
  margin: 0; font-family: var(--display); font-weight: 600; font-size: 36px;
  line-height: 1.05; letter-spacing: -0.03em; text-wrap: balance;
}
.lg-sub { margin: 0; font-size: 15px; line-height: 1.55; color: var(--muted); max-width: 32ch; }
.lg-form { display: flex; flex-direction: column; gap: 10px; }
.lg-label { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-2); }
.lg-input {
  height: 52px; border: 1px solid var(--border-2); border-radius: 14px; padding: 0 16px;
  font-size: 17px; font-weight: 600; letter-spacing: 0.08em; background: #fbfbfc; outline: none;
}
.lg-enter {
  height: 52px; border: none; border-radius: 14px; background: var(--ink);
  color: #ffffff; font-size: 15px; font-weight: 600;
}
.lg-enter:hover { background: #000000; }
.lg-error { margin: 0; font-size: 13px; color: var(--danger); font-weight: 600; }
.lg-bottom { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted-2); }
.lg-switch { background: none; border: none; padding: 8px 0; font-size: 13px; color: var(--accent); font-weight: 600; }

/* ---------- shell de la app ---------- */

/* dvh y no vh: en el teléfono 100vh mide el viewport CON la barra del
   navegador oculta, así que la columna quedaba más alta que lo visible y la
   página scrolleaba justo cuando el cliente está decidiendo. */
.app-wrap {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg); display: flex; justify-content: center; gap: 56px;
}

.rail {
  width: 300px; padding: 56px 0 40px; display: flex; flex-direction: column; gap: 36px;
  align-self: flex-start; position: sticky; top: 0;
}
.rail-block { display: flex; flex-direction: column; gap: 6px; }
.rail-identity { display: flex; align-items: center; gap: 12px; }
.rail-client { font-family: var(--display); font-size: 26px; font-weight: 600; letter-spacing: -0.02em; }
.rail-week { font-size: 14px; color: var(--muted); }
.rail-progress { display: flex; flex-direction: column; gap: 14px; }
.rail-progress-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.rail-progress-row b { font-weight: 600; color: var(--ink); }
.rail-bar { height: 4px; border-radius: 99px; background: var(--border-2); overflow: hidden; }
.rail-bar-fill { height: 100%; background: var(--ink); border-radius: 99px; transition: width 0.3s ease; }
.rail-counts { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }
.rail-count { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.rail-count-dot { width: 8px; height: 8px; border-radius: 99px; }
.rail-count-label { color: var(--muted); }
.rail-count-n { margin-left: auto; font-weight: 600; }
.rail-foot { align-self: flex-start; background: none; border: none; padding: 0; font-size: 13px; color: var(--muted-2); font-weight: 600; }
.rail-foot:hover { color: var(--accent); }

.col {
  position: relative; width: 100%; max-width: 470px; height: 100%; background: var(--surface);
  display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 0 0 1px var(--border);
}

/* Franja superior mínima: equilibra la barra de pestañas de abajo y dice
   cuánto falta de la semana, en 44px en vez de los 66 del header viejo. */
.col-tira {
  flex: 0 0 auto; display: flex; align-items: center; gap: 10px;
  padding: max(10px, env(safe-area-inset-top, 0px)) 16px 10px;
  border-bottom: 1px solid var(--hairline);
}
.col-tira-semana { font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.col-tira-progreso {
  flex: 1; min-width: 40px; height: 4px; border-radius: 99px;
  background: var(--border-2); overflow: hidden;
}
.col-tira-progreso-fill {
  height: 100%; background: var(--accent); border-radius: 99px; transition: width 0.3s ease;
}
.col-tira-volver {
  flex: 0 0 auto; height: 30px; padding: 0 12px; border-radius: 99px;
  border: 1px solid var(--border-2); background: var(--surface);
  font-size: 12.5px; font-weight: 600; color: var(--ink);
}
.col-tira-volver:hover { background: #f6f7f9; }

.col-header {
  padding: 18px 20px 14px; display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid var(--hairline);
}
.col-header-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.col-header-name {
  font-family: var(--display); font-size: 17px; font-weight: 600; letter-spacing: -0.02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.col-header-sub { font-size: 12px; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.undo-btn {
  height: 36px; padding: 0 14px; border: 1px solid var(--border-2); background: var(--surface);
  border-radius: 99px; font-size: 13px; font-weight: 600; color: var(--ink);
}
.undo-btn:hover { background: #f6f7f9; }

.tabbar {
  display: flex; border-top: 1px solid var(--hairline); background: var(--surface);
  /* El indicador de home del iPhone no puede taparle las pestañas. */
  padding-bottom: env(safe-area-inset-bottom, 0px);
  flex: 0 0 auto;
}
.tab {
  flex: 1; height: 60px; border: none; background: none; font-size: 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.tab svg { display: block; }
.tab.on { font-weight: 700; color: var(--accent); }
.tab.off { font-weight: 600; color: var(--muted-2); }
.tab.off:hover { color: var(--ink-3); }

/* ---------- feed ---------- */

/* Sigue siendo un mazo de tarjetas: la de arriba se arrastra y detrás asoman
   las que vienen. Lo que se sacó es el header y la franja de botones, no la
   tarjeta. Las acciones ahora flotan sobre el video. */
.fd-area {
  flex: 1; display: flex; flex-direction: column; min-height: 0;
  padding: max(14px, env(safe-area-inset-top, 0px)) 16px 14px;
}
.fd-stack { position: relative; flex: 1; min-height: 0; }

/* Con video la tarjeta toma el aspecto real del archivo: entra completa, sin
   franjas negras ni recorte. La medida la calcula el JS y llega inline. */
.fd-stack.fit .fd-card,
.fd-stack.fit .fd-ghost {
  inset: auto;
  left: 50%;
  top: 50%;
  margin-left: calc(var(--card-w) / -2);
  margin-top: calc(var(--card-h) / -2);
  width: var(--card-w);
  height: var(--card-h);
}

.fd-ghost { position: absolute; inset: 0; border-radius: 26px; background: var(--surface); }
.fd-ghost.third { transform: scale(0.9) translateY(22px); border: 1px solid var(--hairline); }
.fd-ghost.second { transform: scale(0.95) translateY(11px); border: 1px solid var(--border); }

.fd-card {
  position: absolute; inset: 0; border-radius: 26px; background: var(--surface);
  border: 1px solid var(--border-2); box-shadow: var(--card-shadow); overflow: hidden;
  display: flex; flex-direction: column; touch-action: none; user-select: none; cursor: grab;
}
.fd-preview {
  position: relative; flex: 1; min-height: 0; background: var(--stripe);
  display: flex; align-items: center; justify-content: center;
}
.fd-pills { position: absolute; top: 14px; left: 14px; display: flex; gap: 6px; }
.fd-pill {
  background: rgba(255, 255, 255, 0.94); backdrop-filter: blur(4px);
  padding: 6px 11px; border-radius: 99px; font-size: 12px; font-weight: 600;
}
.fd-pill.plat { color: var(--muted); }

/* La flecha va centrada y el parlante cuelga a la derecha en absoluto, para
   que la flecha quede al medio de la tarjeta y no del espacio sobrante. */
.fd-overlay-actions {
  position: relative; display: flex; align-items: center; justify-content: center;
  margin-top: 2px; min-height: 34px;
}
.fd-swipe-up {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 34px; color: rgba(255, 255, 255, 0.92);
  animation: invitarArriba 2.2s ease-in-out infinite;
}
.fd-swipe-up:hover { color: #ffffff; }
@keyframes invitarArriba {
  0%, 100% { transform: translateY(2px); opacity: 0.75; }
  50% { transform: translateY(-3px); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .fd-swipe-up { animation: none; }
}
.fd-sound {
  position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center; border-radius: 99px;
  border: 1px solid rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(6px); color: #ffffff;
}
.fd-sound:hover { background: rgba(255, 255, 255, 0.26); }
.fd-sound-icon { display: block; }

.fd-pausa {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 62px; height: 62px; border-radius: 99px; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  background: rgba(20, 22, 30, 0.44); border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(6px); color: #ffffff; font-size: 22px; padding-left: 4px;
}

.fd-zone {
  position: absolute; top: 0; bottom: 104px; width: 32%; display: flex; align-items: center;
  color: rgba(255, 255, 255, 0.9); font-size: 22px;
}
.fd-zone.prev { left: 0; justify-content: flex-start; padding-left: 12px; }
.fd-zone.next { right: 0; justify-content: flex-end; padding-right: 12px; }
.fd-zone.prev:hover { background: linear-gradient(to right, rgba(14, 16, 22, 0.16), rgba(14, 16, 22, 0)); }
.fd-zone.next:hover { background: linear-gradient(to left, rgba(14, 16, 22, 0.16), rgba(14, 16, 22, 0)); }

.stamp {
  pointer-events: none; position: absolute; top: 18px; opacity: 0;
  font-family: var(--display); font-weight: 700; font-size: 17px; letter-spacing: 0.02em;
  padding: 6px 12px; border-radius: 10px;
}
.stamp.ok { right: 18px; border: 2.5px solid var(--accent); color: var(--accent); transform: rotate(9deg); }
.stamp.no { left: 18px; border: 2.5px solid var(--danger); color: var(--danger); transform: rotate(-9deg); }
.stamp.up {
  left: 50%; transform: translateX(-50%); background: var(--ink); color: #ffffff;
  padding: 7px 13px; border-radius: 99px; font-family: var(--ui); font-size: 13px; font-weight: 600;
  letter-spacing: normal;
}

.fd-overlay {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 34px 16px 16px;
  background: linear-gradient(to top, rgba(14, 16, 22, 0.92) 0%, rgba(14, 16, 22, 0.6) 58%, rgba(14, 16, 22, 0) 100%);
  display: flex; flex-direction: column; gap: 7px; color: #ffffff;
}
.fd-dots { display: flex; gap: 4px; padding-bottom: 3px; }
.fd-dot { flex: 1; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.32); }
.fd-dot.on { background: #ffffff; }
.fd-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: rgba(255, 255, 255, 0.76); }
.fd-meta .pos { margin-left: auto; }
.fd-copy {
  margin: 0; font-size: 14.5px; line-height: 1.45; color: rgba(255, 255, 255, 0.96);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.fd-more {
  display: inline-flex; align-items: center; justify-content: center;
  height: 34px; padding: 0 20px; border-radius: 99px; line-height: 1;
  border: 1px solid rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(6px); color: #ffffff; font-size: 12.5px; font-weight: 600;
}
.fd-more:hover { background: rgba(255, 255, 255, 0.26); }
.fd-more.ghost { background: rgba(255, 255, 255, 0.08); }

.fd-empty {
  position: absolute; inset: 0; border-radius: 26px; border: 1px dashed #dcdfe5;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; text-align: center; padding: 32px;
}
.fd-empty-title { font-family: var(--display); font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
.fd-empty-sub { margin: 0; font-size: 14px; color: var(--muted); max-width: 26ch; line-height: 1.5; }
.fd-empty-cta { height: 44px; padding: 0 20px; border: none; border-radius: 99px; background: var(--ink); color: #ffffff; font-size: 14px; font-weight: 600; }

/* Debajo de la tarjeta, no encima: sobre el video tapaban demasiado. */
.fd-actions {
  position: relative; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 16px max(4px, env(safe-area-inset-bottom, 0px));
}
.fd-undo {
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  height: 36px; padding: 0 14px; border: 1px solid var(--border-2); background: var(--surface);
  border-radius: 99px; font-size: 13px; font-weight: 600; color: var(--ink);
}
.fd-undo:hover { background: #f6f7f9; }
/* Pastillas anchas y no dos círculos: el glifo solo no decía qué pasaba al
   tocar el ✕. Se reparten el ancho para que la etiqueta entre siempre. */
.fd-btn {
  flex: 1 1 0; max-width: 220px; min-width: 0;
  height: 56px; border-radius: 99px; font-size: 14.5px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  white-space: nowrap;
}
.fd-btn-glifo { font-size: 17px; line-height: 1; }
.fd-btn.reject { border: 1px solid var(--danger-border); background: var(--surface); color: var(--danger); box-shadow: var(--btn-shadow); }
.fd-btn.reject:hover { background: var(--danger-bg); }
.fd-btn.approve { border: none; background: var(--accent); color: #ffffff; box-shadow: var(--accent-shadow); }
.fd-btn.approve:hover { background: var(--accent-hover); }
.fd-hint { text-align: center; font-size: 11.5px; color: var(--muted-3b); padding-bottom: 6px; letter-spacing: 0.01em; }

/* ---------- detalle ---------- */

.dt-overlay {
  position: absolute; inset: 0; background: var(--surface); z-index: 20;
  display: flex; flex-direction: column; animation: sheetUp 0.28s cubic-bezier(0.22, 0.9, 0.3, 1);
}
.dt-header { padding: 12px 16px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--hairline); }
.dt-close { width: 40px; height: 40px; border-radius: 99px; border: none; background: var(--field-2); font-size: 15px; color: var(--ink-3); }
.dt-header-info { display: flex; flex-direction: column; min-width: 0; }
.dt-title { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dt-estado { font-size: 12px; font-weight: 600; }
.dt-body { flex: 1; overflow-y: auto; padding: 16px 20px 24px; display: flex; flex-direction: column; gap: 20px; }
.dt-preview {
  aspect-ratio: 4 / 5; border-radius: 18px; background: var(--stripe);
  display: flex; align-items: center; justify-content: center;
  /* Sin esto el flex del cuerpo le come el alto y el video queda aplastado. */
  flex: 0 0 auto;
}
/* En el detalle la caja ya tiene el aspecto real del archivo, así que `contain`
   entra justo y además protege de cualquier redondeo. */
.dt-preview .pieza-video { object-fit: contain; }
.dt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dt-field { display: flex; flex-direction: column; gap: 3px; }
.dt-value { font-size: 14px; font-weight: 600; }
.dt-copy-block { display: flex; flex-direction: column; gap: 8px; }
.dt-copy { margin: 0; font-size: 15px; line-height: 1.6; color: var(--ink-2); white-space: pre-line; }
.dt-sep { height: 1px; background: var(--hairline); }
.dt-thread { display: flex; flex-direction: column; gap: 14px; }
.dt-comment {
  display: flex; flex-direction: column; gap: 6px; padding: 12px 14px;
  border-radius: 14px; background: var(--field); border: 1px solid var(--hairline);
}
.dt-comment-head { display: flex; align-items: center; gap: 8px; }
.dt-comment-author { font-size: 12.5px; font-weight: 700; }
.dt-comment-time { font-size: 11.5px; color: var(--muted-3); }
.dt-comment-motivos { font-size: 12.5px; font-weight: 600; color: var(--warn); }
.dt-comment-text { margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink-3); }
.dt-audio {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 99px; align-self: flex-start;
}
.dt-audio-play {
  width: 26px; height: 26px; border-radius: 99px; background: var(--ink); color: #ffffff;
  display: flex; align-items: center; justify-content: center; font-size: 10px;
}
.dt-audio-wave { display: flex; align-items: flex-end; gap: 2px; height: 16px; }
.dt-audio-wave i { width: 2px; background: var(--disabled-ink-2); display: block; }
.dt-audio-dur { font-size: 12px; font-weight: 600; color: var(--muted); }
.dt-comment-img { max-width: 180px; border-radius: 10px; border: 1px solid var(--border); }
.dt-thread-empty { margin: 0; font-size: 13.5px; color: var(--muted-3); }
.dt-add-comment {
  align-self: flex-start; height: 42px; padding: 0 16px; border: 1px solid var(--border-2);
  background: var(--surface); border-radius: 99px; font-size: 13.5px; font-weight: 600;
}
.dt-add-comment:hover { background: #f6f7f9; }
.dt-footer { display: flex; gap: 10px; padding: 12px 16px 16px; border-top: 1px solid var(--hairline); }
.dt-footer-btn { flex: 1; height: 48px; border-radius: 12px; font-size: 14px; font-weight: 600; }
.dt-footer-btn.reject { border: 1px solid var(--danger-border); background: var(--surface); color: var(--danger); }
.dt-footer-btn.approve { border: none; background: var(--accent); color: #ffffff; }
.dt-locked { padding: 14px 16px 18px; border-top: 1px solid var(--hairline); font-size: 13px; color: var(--muted-2); text-align: center; }

/* ---------- sheet de feedback ---------- */

.fb-backdrop {
  position: absolute; inset: 0; z-index: 40; background: var(--scrim);
  display: flex; align-items: flex-end; animation: fade 0.18s ease;
}
.fb-sheet {
  width: 100%; background: var(--surface); border-radius: 22px 22px 0 0; padding: 20px 20px 18px;
  display: flex; flex-direction: column; gap: 16px; max-height: 92%; overflow-y: auto;
  animation: sheetUp 0.26s cubic-bezier(0.22, 0.9, 0.3, 1);
}
.fb-head { display: flex; align-items: flex-start; gap: 12px; }
.fb-head-text { display: flex; flex-direction: column; gap: 4px; }
.fb-title { font-family: var(--display); font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.fb-sub { font-size: 13px; color: var(--muted); line-height: 1.45; }
.fb-close {
  margin-left: auto; width: 36px; height: 36px; border-radius: 99px; border: none;
  background: var(--field-2); color: var(--ink-3); font-size: 14px; flex: 0 0 auto;
}
.fb-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { height: 38px; padding: 0 14px; border-radius: 99px; font-size: 13px; }
.chip.off { border: 1px solid var(--border-2); background: var(--surface); color: var(--ink-3); font-weight: 500; }
.chip.off:hover { border-color: var(--border-hover); }
.chip.on { border: 1px solid var(--ink); background: var(--ink); color: #ffffff; font-weight: 600; }
.fb-textarea {
  min-height: 96px; border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px;
  font-size: 14px; line-height: 1.5; background: var(--field); outline: none;
}
.fb-attach-row { display: flex; gap: 10px; }
.fb-attach {
  flex: 1; height: 46px; border: 1px solid var(--border-2); background: var(--surface);
  border-radius: 12px; font-size: 13.5px; font-weight: 600; color: var(--ink-3);
}
.fb-attach:hover { background: #f6f7f9; }
.fb-attach.recording {
  border: 1px solid var(--danger); background: var(--danger-bg); color: var(--danger); font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.fb-rec-dot { width: 9px; height: 9px; border-radius: 99px; background: var(--danger); animation: pulse 1s infinite; }
.fb-ready { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 12px; }
.fb-ready.image { gap: 12px; }
.fb-ready-label { font-size: 13px; font-weight: 600; }
.fb-ready-label.filename { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fb-ready-thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 8px; }
.fb-quitar { margin-left: auto; background: none; border: none; font-size: 12.5px; color: var(--danger); font-weight: 600; flex: 0 0 auto; }
.fb-cta { height: 50px; border: none; border-radius: 14px; background: var(--ink); color: #ffffff; font-size: 15px; font-weight: 600; }
.fb-cta:disabled { background: #eceef2; color: var(--muted-3b); cursor: not-allowed; }
.fb-discard-block { display: flex; flex-direction: column; gap: 10px; padding: 14px 0 2px; border-top: 1px solid var(--hairline); }
.fb-discard-head { display: flex; flex-direction: column; gap: 3px; }
.fb-discard-title { font-size: 13px; font-weight: 700; color: var(--ink-3); }
.fb-discard-sub { font-size: 12.5px; color: var(--muted-2); line-height: 1.45; }
.fb-discard {
  height: 46px; border: 1px solid var(--danger-border); border-radius: 12px;
  background: var(--surface); color: var(--danger); font-size: 14px; font-weight: 700;
}
.fb-discard:hover { background: var(--danger-bg); }
.fb-discard:disabled { border-color: var(--hairline); color: var(--disabled-ink); cursor: not-allowed; background: var(--surface); }

/* ---------- todos ---------- */

.td-area { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.td-bar { padding: 14px 20px 12px; display: flex; flex-direction: column; gap: 12px; border-bottom: 1px solid var(--hairline); }
.td-search {
  height: 42px; border: 1px solid var(--border); border-radius: 12px; padding: 0 14px;
  font-size: 14px; background: var(--field); outline: none;
}
.td-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.td-chip { flex: 0 0 auto; height: 34px; padding: 0 14px; border-radius: 99px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.td-chip.on { border: 1px solid var(--ink); background: var(--ink); color: #ffffff; }
.td-chip.off { border: 1px solid var(--border-2); background: var(--surface); color: var(--muted); }
.td-chip.off:hover { border-color: var(--border-hover); }
.td-scroll { flex: 1; overflow-y: auto; padding: 16px 20px 96px; }
.td-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.td-tile {
  text-align: left; padding: 0; border: 1px solid var(--border); background: var(--surface);
  border-radius: 16px; overflow: hidden; display: flex; flex-direction: column;
}
.td-tile:hover { border-color: var(--border-hover); }
.td-tile-preview { position: relative; aspect-ratio: 4 / 5; background: var(--stripe); display: flex; align-items: flex-end; padding: 8px; }
.td-tile-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.td-tile-formato { position: relative; background: rgba(255, 255, 255, 0.94); padding: 4px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; }
.td-tile-dot { position: absolute; top: 8px; right: 8px; width: 9px; height: 9px; border-radius: 99px; }
.td-tile-body { padding: 10px 10px 12px; display: flex; flex-direction: column; gap: 5px; }
.td-tile-cuando { font-size: 11.5px; font-weight: 600; color: var(--muted-2); }
.td-tile-titulo {
  font-size: 13px; line-height: 1.35; color: var(--ink-3);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.td-tile-estado { font-size: 11.5px; font-weight: 600; }
.td-empty { margin: 40px 0 0; text-align: center; font-size: 14px; color: var(--muted-2); }

/* ---------- resumen ---------- */

.rs-area { flex: 1; overflow-y: auto; padding: 24px 20px 110px; display: flex; flex-direction: column; gap: 24px; }
.rs-head { display: flex; flex-direction: column; gap: 8px; }
.rs-h2 { margin: 0; font-family: var(--display); font-size: 28px; font-weight: 600; letter-spacing: -0.025em; }
.rs-sub { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.5; }
.rs-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; }
.rs-stat { border: 1px solid var(--border); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.rs-stat-n { font-family: var(--display); font-size: 28px; font-weight: 600; line-height: 1; }
.rs-stat-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.rs-list { display: flex; flex-direction: column; gap: 10px; }
.rs-row {
  text-align: left; display: flex; align-items: center; gap: 12px; padding: 12px;
  border: 1px solid var(--hairline); background: var(--surface); border-radius: 14px;
}
.rs-row:hover { border-color: #dcdfe5; }
.rs-row-thumb {
  width: 44px; height: 52px; border-radius: 8px; background: var(--stripe-sm);
  flex: 0 0 auto; overflow: hidden;
}
.rs-row-poster { width: 100%; height: 100%; object-fit: cover; display: block; }
.rs-row-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.rs-row-meta { font-size: 11.5px; font-weight: 600; color: var(--muted-2); }
.rs-row-titulo { font-size: 13.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rs-row-estado { font-size: 11.5px; font-weight: 600; }
.rs-row-chevron { color: var(--disabled-ink-2); font-size: 16px; }
.rs-cta { height: 52px; border: none; border-radius: 14px; background: var(--ink); color: #ffffff; font-size: 15px; font-weight: 600; }
.rs-cta:hover { background: #000000; }
.rs-cta:disabled { background: #eceef2; color: var(--muted-3b); cursor: not-allowed; }
.rs-sent { border: 1px solid var(--accent-soft-border); background: var(--accent-soft-bg); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.rs-sent-title { font-size: 14px; font-weight: 700; color: var(--accent-ink); }
.rs-sent-sub { font-size: 13px; color: #5b5f68; line-height: 1.5; }
.rs-logout { align-self: center; background: none; border: none; font-size: 13px; color: var(--muted-2); font-weight: 600; }
.rs-logout:hover { color: var(--ink-3); }

/* ---------- panel del equipo ---------- */

.tp-screen { width: 100%; min-height: 100vh; background: var(--bg); padding: 36px 28px 64px; }
.tp-inner { max-width: 1080px; margin: 0 auto; display: flex; flex-direction: column; gap: 26px; }
.tp-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.tp-bar-label { font-size: 13px; color: var(--muted-2); }
.tp-bar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.tp-view-client {
  height: 40px; padding: 0 16px; border: 1px solid var(--border-2); background: var(--surface);
  border-radius: 99px; font-size: 13.5px; font-weight: 600;
}
.tp-view-client:hover { background: #f6f7f9; }
.tp-logout { background: none; border: none; font-size: 13px; color: var(--muted-2); font-weight: 600; }
.tp-logout:hover { color: var(--ink-3); }
.tp-picker { display: flex; flex-direction: column; gap: 10px; }
.tp-picker-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tp-title-block { display: flex; flex-direction: column; gap: 4px; }
.tp-identity { display: flex; align-items: center; gap: 14px; }
.td-chip.with-avatar { display: inline-flex; align-items: center; gap: 8px; }
.tp-h1 { margin: 0; font-family: var(--display); font-size: 32px; font-weight: 600; letter-spacing: -0.03em; }
.tp-sub { font-size: 14px; color: var(--muted); }
.tp-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.tp-stat { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.tp-stat-n { font-family: var(--display); font-size: 30px; font-weight: 600; line-height: 1; }
.tp-stat-label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.tp-table { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; }
.tp-table-scroll { overflow-x: auto; }
.tp-thead, .tp-row {
  display: grid; grid-template-columns: minmax(220px, 2.2fr) 120px 130px 150px minmax(200px, 2fr);
  gap: 16px; padding: 14px 20px; align-items: center;
}
.tp-thead {
  border-bottom: 1px solid var(--hairline); font-size: 11px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-2);
}
.tp-row {
  border-bottom: 1px solid #f4f5f7; font-size: 13.5px; width: 100%;
  background: none; border-left: none; border-right: none; border-top: none;
  text-align: left; font-family: var(--ui);
}
.tp-row:hover { background: var(--field); }
.tp-row:last-child { border-bottom: none; }
.tp-row-mas {
  margin-left: 8px; padding: 1px 7px; border-radius: 99px; background: var(--field-2);
  color: var(--muted); font-size: 11.5px; font-weight: 600;
}

.tp-tabla-head { display: flex; align-items: center; gap: 16px; }
.tp-copiar {
  margin-left: auto; height: 38px; padding: 0 16px; border-radius: 99px;
  border: 1px solid var(--border-2); background: var(--surface);
  font-size: 13px; font-weight: 600; color: var(--ink); flex: 0 0 auto;
}
.tp-copiar:hover { background: #f6f7f9; }

/* El detalle del equipo reusa la misma pantalla que ve el cliente, metida en
   una ventana del ancho de la columna. */
.tp-modal-backdrop {
  position: fixed; inset: 0; z-index: 60; background: var(--scrim);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  animation: fade 0.18s ease;
}
.tp-modal {
  position: relative; width: 100%; max-width: 470px; height: min(88vh, 900px);
  background: var(--surface); border-radius: 18px; overflow: hidden;
  display: flex; flex-direction: column; box-shadow: 0 24px 60px rgba(20, 22, 30, 0.24);
}
/* Adentro de la ventana el detalle deja de ser una capa absoluta y pasa a ser
   una fila más del flex, para no taparle el pie con el botón de copiar. */
.tp-modal .dt-overlay {
  position: relative; inset: auto; z-index: auto; animation: none;
  flex: 1; min-height: 0;
}
/* El equipo viene a leer el feedback: el video no puede empujar el hilo fuera
   de la ventana. Se le fija el alto y el ancho sale del aspecto, así entra
   justo y no quedan franjas negras a los costados. */
.tp-modal .dt-preview {
  height: 42vh; max-height: 42vh; width: auto; max-width: 100%;
  align-self: center; overflow: hidden;
}

.tp-modal-pie {
  padding: 12px 16px; border-top: 1px solid var(--hairline);
  display: flex; justify-content: flex-end; flex: 0 0 auto;
}
.tp-modal-pie .tp-copiar { margin-left: 0; }
.tp-row-titulo { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-row-muted { color: var(--muted); }
.tp-row-estado { display: flex; align-items: center; gap: 7px; font-weight: 600; }
.tp-row-dot { width: 8px; height: 8px; border-radius: 99px; }
.tp-row-feedback { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-empty { padding: 40px 20px; text-align: center; font-size: 14px; color: var(--muted-2); }

.tp-nav { display: flex; gap: 4px; margin-left: 8px; }

/* En pantallas angostas la barra del panel se amontonaba: la marca, las
   pestañas y los dos botones no entran en una línea. Se parte en dos filas y
   los botones bajan a la segunda, alineados a la derecha. */
@media (max-width: 720px) {
  .tp-screen { padding: 20px 16px 48px; }
  /* Cada grupo en su propia fila: la marca, las pestañas y los botones no
     entran en una línea y "Ver como cliente" terminaba partido en dos. */
  .tp-bar { flex-direction: column; align-items: stretch; gap: 12px; }
  .tp-bar-label { display: none; }
  .tp-nav { margin-left: 0; }
  .tp-bar-right { margin-left: 0; justify-content: flex-end; }
  .tp-view-client { white-space: nowrap; }
  .tp-h1 { font-size: 26px; }
  .tp-identity { gap: 10px; }
  .tp-tabla-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .tp-copiar { margin-left: 0; }
  .tp-modal-backdrop { padding: 12px; }
  .tp-modal { height: min(92dvh, 900px); }

  /* La tabla de 5 columnas no entra en un teléfono: cada fila pasa a ser una
     tarjeta apilada, sin scroll horizontal. */
  .tp-thead { display: none; }
  .tp-table-scroll { overflow-x: visible; }
  .tp-row {
    display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
    padding: 14px 16px;
  }
  .tp-row-titulo { white-space: normal; font-size: 14.5px; }
  /* Los cuatro datos sueltos de la grilla se reemplazan por la línea única. */
  .tp-row > .tp-row-muted,
  .tp-row > .tp-row-estado { display: none; }
  .tp-row-meta-movil { display: flex !important; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 12.5px; }
  .tp-row-feedback { white-space: normal; font-size: 12.5px; }
}
.tp-row-meta-movil { display: none; }
.tp-nav-item {
  height: 34px; padding: 0 14px; border-radius: 99px; border: 1px solid transparent;
  background: none; font-size: 13.5px; font-weight: 600;
}
.tp-nav-item.on { background: var(--surface); border-color: var(--border); color: var(--ink); }
.tp-nav-item.off { color: var(--muted); }
.tp-nav-item.off:hover { color: var(--ink-3); }

/* ---------- cuentas ---------- */

.ac-wrap { display: flex; flex-direction: column; gap: 20px; }
.ac-head { display: flex; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.ac-h2 { margin: 0 0 6px; font-family: var(--display); font-size: 28px; font-weight: 600; letter-spacing: -0.025em; }
.ac-sub { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.5; max-width: 62ch; }
.ac-primary {
  margin-left: auto; height: 44px; padding: 0 18px; border: none; border-radius: 12px;
  background: var(--ink); color: #ffffff; font-size: 14px; font-weight: 600; flex: 0 0 auto;
}
.ac-primary:hover { background: #000000; }
.ac-primary:disabled { background: #eceef2; color: var(--muted-3b); cursor: not-allowed; }
.ac-secondary {
  align-self: flex-start; height: 42px; padding: 0 16px; border: 1px solid var(--border-2);
  background: var(--surface); border-radius: 12px; font-size: 13.5px; font-weight: 600;
}
.ac-secondary:hover { background: #f6f7f9; }
.ac-secondary:disabled { color: var(--disabled-ink); cursor: not-allowed; }

.ac-error {
  border: 1px solid var(--danger-border); background: var(--danger-bg); color: var(--danger);
  border-radius: 12px; padding: 12px 14px; font-size: 13.5px; font-weight: 600;
}
.ac-aviso {
  border: 1px solid var(--accent-soft-border); background: var(--accent-soft-bg);
  color: var(--accent-ink); border-radius: 12px; padding: 12px 14px; font-size: 13.5px; font-weight: 600;
}

.ac-form {
  display: flex; flex-direction: column; gap: 14px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 16px; padding: 18px;
}
.ac-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.ac-campo { display: flex; flex-direction: column; gap: 6px; }
.ac-campo-label { font-size: 12px; font-weight: 600; color: var(--muted); }
.ac-input {
  height: 44px; border: 1px solid var(--border); border-radius: 12px; padding: 0 14px;
  font-size: 14px; background: var(--field); outline: none;
}
.ac-input:focus { border-color: var(--border-hover); }

.ac-list { display: flex; flex-direction: column; gap: 12px; }
.ac-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; }
.ac-card-head { display: flex; align-items: center; gap: 14px; padding: 16px 18px; }
.ac-card-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.ac-card-name { font-size: 15px; font-weight: 700; }
.ac-card-meta { font-size: 12.5px; color: var(--muted-2); }
.ac-ghost {
  height: 38px; padding: 0 14px; border: 1px solid var(--border-2); background: var(--surface);
  border-radius: 99px; font-size: 13px; font-weight: 600; flex: 0 0 auto;
}
.ac-ghost:hover { background: #f6f7f9; }
.ac-card-body {
  display: flex; flex-direction: column; gap: 16px; padding: 4px 18px 18px;
  border-top: 1px solid var(--hairline); padding-top: 16px;
}
.ac-users { display: flex; flex-direction: column; gap: 10px; }
.ac-empty { margin: 0; font-size: 13.5px; color: var(--muted-3); }
.ac-user {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border: 1px solid var(--hairline); border-radius: 12px; background: var(--field);
}
.ac-user-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.ac-user-name { font-size: 13.5px; font-weight: 600; }
.ac-user-email { font-size: 12px; color: var(--muted-2); }
.ac-link { background: none; border: none; font-size: 12.5px; font-weight: 600; color: var(--accent); }
.ac-link:hover { color: var(--accent-ink); }
.ac-link.danger { color: var(--danger); }
