/* ==========================================================================
   componentes.css — versiones Navaja de los 10 componentes guardados
   (Dynamic Menu, Sidebar Collapse, OTP, Star Rating, Checkbox List,
   Boarding Pass, Notification Stack, Stack Panel, Stat Card, Expand Card,
   File Drop). Sin autoplays ni ciclos de demostración: todo responde solo
   al toque del usuario. Sin emojis. Textos en español, pesos en MXN.
   Tokens y tipografías de static/css/app.css (Big Shoulders Display/Inter, negro
   #060608, oro #D4AF37, rojo #D4182B).
   ========================================================================== */

/* El JS de componentes.js marca <html class="js-componentes"> al cargar.
   Sin JS, los componentes se muestran en su forma simple (lista visible,
   detalle abierto) en vez de quedarse escondidos. */
html:not(.js-componentes) .expandible-detalle { display: block; }

/* 1. Menú del cliente: ahora es .mc (barra de pestañas) en diseno.css. */

/* ============================ 2. SIDEBAR (dueño/barbero) =============== */
.sb-hamburguesa { display: none; }
.sb {
  background: #0b0b0f; border-right: 1px solid var(--linea);
  display: flex; flex-direction: column; min-height: 100vh;
}
.sb-cabeza { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 16px 14px 12px; }
.sb-marca { font-family: 'Big Shoulders Display', serif; font-weight: 900; text-transform: uppercase; font-size: 17px; letter-spacing: .03em; white-space: nowrap; }
.sb-marca small { display: block; font-family: 'Barlow', sans-serif; font-weight: 500; font-size: 11px; color: var(--texto-tenue); text-transform: none; letter-spacing: 0; }
.sb-colapsar {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 8px;
  border: 1px solid var(--linea-fuerte); background: transparent; color: var(--oro);
  font-size: 16px; line-height: 1; cursor: pointer;
}
.sb-colapsar:hover { border-color: var(--oro); }
.sb-secciones { display: flex; flex-direction: column; gap: 2px; padding: 4px 10px; }
.sb-secciones a, .sb-atajos a {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 10px; border-radius: 10px; color: var(--texto);
  text-decoration: none; border-left: 3px solid transparent;
}
.sb-secciones a:hover, .sb-atajos a:hover { background: rgba(255, 255, 255, .05); }
.sb-secciones a.activo { background: rgba(212, 175, 55, .12); border-left-color: var(--oro); color: var(--oro-claro); }
.sb-atajos a.activo { color: var(--oro-claro); background: rgba(212, 175, 55, .12); }
.sb-num {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(212, 175, 55, .14); color: var(--oro);
  font-size: 11px; font-weight: 700;
}
.sb-textos { min-width: 0; }
.sb-textos b { display: block; font-size: 14px; font-weight: 600; }
.sb-textos span { display: block; font-size: 12px; color: var(--texto-tenue); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-atajos { display: flex; flex-direction: column; gap: 2px; padding: 10px; margin-top: 8px; border-top: 1px solid var(--linea); }
.sb-atajos a { font-size: 13px; font-weight: 600; padding: 8px 10px; }
.sb-pie { margin-top: auto; padding: 12px 14px 16px; border-top: 1px solid var(--linea); }
.sb-pie a { color: var(--texto-tenue); font-size: 13px; text-decoration: none; }
.sb-pie a:hover { color: var(--oro-claro); }
.sb-velo { display: none; }
@media (min-width: 901px) {
  body.vista-negocio .sb { position: fixed; left: 0; top: 0; bottom: 0; width: 248px; z-index: 40; }
  body.vista-negocio .envoltura { margin-left: 248px; width: auto; }
  body.vista-negocio.sb-plegado .sb { width: 68px; }
  body.vista-negocio.sb-plegado .sb .sb-textos,
  body.vista-negocio.sb-plegado .sb .sb-marca { display: none; }
  body.vista-negocio.sb-plegado .sb .sb-cabeza { justify-content: center; padding: 16px 6px 12px; }
  body.vista-negocio.sb-plegado .sb-secciones a,
  body.vista-negocio.sb-plegado .sb-atajos a { justify-content: center; padding: 10px 6px; }
  body.vista-negocio.sb-plegado .sb-atajos a { font-size: 0; }
  body.vista-negocio.sb-plegado .sb-atajos a .sb-num { margin: 0; }
  body.vista-negocio.sb-plegado .envoltura { margin-left: 68px; }
  body.vista-negocio.sb-plegado .sb-colapsar { transform: rotate(180deg); }
}
@media (max-width: 900px) {
  .sb-hamburguesa {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 4px;
    width: 38px; height: 38px; padding: 10px 9px;
    background: transparent; border: 1px solid var(--linea-fuerte); border-radius: 10px; cursor: pointer;
  }
  .sb-hamburguesa span { display: block; height: 2px; background: var(--oro); border-radius: 2px; }
  html.js-componentes body.vista-negocio .sb {
    position: fixed; left: 0; top: 0; bottom: 0; width: 272px; z-index: 70;
    transform: translateX(-105%); transition: transform .25s ease;
    box-shadow: 0 0 60px rgba(0, 0, 0, .6);
  }
  html.js-componentes body.vista-negocio.sb-abierto .sb { transform: translateX(0); }
  html.js-componentes body.vista-negocio.sb-abierto .sb-velo {
    display: block; position: fixed; inset: 0; z-index: 65;
    background: rgba(0, 0, 0, .55); border: 0; padding: 0; cursor: pointer;
  }
}

/* ============================ 3. OTP (4 casillas) ======================= */
.otp-cajas { display: none; }
html.js-componentes .otp-cajas { display: flex; gap: 10px; justify-content: center; }
.otp-caja {
  width: 56px; height: 64px; text-align: center;
  font-family: 'Big Shoulders Display', serif; font-size: 30px; font-weight: 900;
  color: var(--texto); background: #0b0b0f;
  border: 1px solid var(--linea-fuerte); border-radius: 14px;
  caret-color: var(--oro);
}
.otp-caja:focus { outline: none; border-color: var(--oro); box-shadow: 0 0 0 3px rgba(212, 175, 55, .25); }
.otp-caja.llena { border-color: var(--oro); background: rgba(212, 175, 55, .08); }
.otp-caja.pop { animation: otp-pop .18s ease; }
@keyframes otp-pop { 50% { transform: scale(1.1); } }
.otp-fusion { display: none; justify-content: center; }
.otp-fusion.visible { display: flex; animation: otp-fusion .35s ease both; }
.otp-fusion span {
  background: #1d5c38; color: #c9f2da; font-weight: 700;
  border-radius: 999px; padding: 12px 26px; font-size: 16px;
}
@keyframes otp-fusion { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: scale(1); } }
.otp-cajas.fusionando .otp-caja { animation: otp-junta .35s ease both; }
.otp-cajas.fusionando .otp-caja:nth-child(2) { animation-delay: .05s; }
.otp-cajas.fusionando .otp-caja:nth-child(3) { animation-delay: .1s; }
.otp-cajas.fusionando .otp-caja:nth-child(4) { animation-delay: .15s; }
@keyframes otp-junta { to { opacity: 0; transform: translateY(6px) scale(.85); } }

/* ============================ 4. STAR RATING ============================ */
.calif-palabra {
  display: block; min-height: 30px; text-align: center;
  font-family: 'Big Shoulders Display', serif; font-size: 22px; font-weight: 900;
  text-transform: uppercase; color: var(--oro-claro);
}
.calif-palabra.rueda { animation: calif-rueda .28s ease; }
@keyframes calif-rueda { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.estrellas button.pop { animation: estrella-pop .25s ease; }
@keyframes estrella-pop { 50% { transform: scale(1.35) rotate(-8deg); } }

/* ============================ 5. CHECKBOX LIST (tareas) ================= */
.tareas-lista { display: flex; flex-direction: column; gap: 8px; }
.tarea {
  display: flex; align-items: center; gap: 12px;
  background: var(--tarjeta-1); border: 1px solid var(--linea);
  border-radius: 12px; padding: 10px 12px;
}
.tarea.hecha { opacity: .75; }
.tarea-check {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 9px;
  border: 1px solid var(--linea-fuerte); background: transparent;
  color: transparent; font-size: 17px; line-height: 1; cursor: pointer;
}
.tarea-check:hover { border-color: var(--oro); color: var(--oro); }
.tarea.hecha .tarea-check { background: var(--oro); border-color: var(--oro); color: #060608; }
.tarea-texto { flex: 1 1 auto; min-width: 0; font-weight: 600; }
.tarea.hecha .tarea-texto { text-decoration: line-through; color: var(--texto-tenue); }
.tarea-quien { flex: 0 0 auto; font-size: 12px; color: var(--texto-tenue); background: rgba(255, 255, 255, .05); border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
.tareas-contador { font-size: 13px; color: var(--texto-tenue); }

/* ============================ 6. BOARDING PASS (ticket) ================= */
.pase {
  position: relative; background: var(--tarjeta-1);
  border: 1px solid var(--linea-fuerte); border-radius: 16px;
  padding: 16px 18px 14px; overflow: hidden;
}
.pase::before, .pase::after {
  content: ""; position: absolute; width: 22px; height: 22px; border-radius: 50%;
  background: var(--bg); border: 1px solid var(--linea-fuerte);
  top: 50%; margin-top: -11px;
}
.pase::before { left: -12px; }
.pase::after { right: -12px; }
.pase-cabeza { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pase-marca { font-family: 'Big Shoulders Display', serif; font-weight: 900; text-transform: uppercase; font-size: 14px; letter-spacing: .04em; }
.pase-estado {
  font-size: 12px; font-weight: 700; border-radius: 999px; padding: 4px 11px;
  background: rgba(212, 175, 55, .14); color: var(--oro-claro); white-space: nowrap;
}
.pase-estado.en-curso { background: rgba(212, 24, 43, .16); color: #ff8a96; }
.pase-estado.reprogramada { background: rgba(212, 175, 55, .22); color: var(--oro-claro); }
.pase-medio { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; padding: 12px 0 10px; }
.pase-servicio { font-family: 'Big Shoulders Display', serif; font-weight: 900; text-transform: uppercase; font-size: clamp(20px, 4vw, 28px); line-height: 1; }
.pase-hora { font-family: 'Big Shoulders Display', serif; font-weight: 900; font-size: clamp(20px, 4vw, 28px); line-height: 1; text-align: right; white-space: nowrap; }
.pase-datos { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 13px; color: var(--texto-suave); }
.pase-datos b { color: var(--texto); font-weight: 600; }
.pase-cambio { display: inline-flex; flex-direction: column; gap: 1px; }
.pase-viejo { text-decoration: line-through; color: var(--texto-tenue); font-size: 12px; animation: pase-viejo .4s ease both; }
.pase-nuevo { animation: pase-nuevo .45s ease both; }
@keyframes pase-viejo { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pase-nuevo { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.pase-corte { border-top: 1px dashed var(--linea-fuerte); margin: 12px 0 10px; }
.pase-pie { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.pase-codigo { font-size: 13px; font-weight: 700; letter-spacing: .08em; }
.pase-codigo small { display: block; font-size: 11px; font-weight: 500; color: var(--texto-tenue); letter-spacing: 0; }
.pase-barras { display: flex; align-items: flex-end; gap: 2px; height: 34px; }
.pase-barras i { display: block; background: var(--texto); height: 100%; }

/* ============================ 7. NOTIFICATION STACK ===================== */
.pila-avisos { position: relative; }
.pila-avisos .pila-tarjeta {
  background: var(--tarjeta-1); border: 1px solid var(--linea-fuerte);
  border-radius: 14px; padding: 12px 14px;
}
html.js-componentes .pila-avisos .pila-tarjeta { transition: transform .25s ease, opacity .25s ease; }
html.js-componentes .pila-avisos:not(.expandida) .pila-tarjeta:nth-child(2) { transform: translateY(-8px) scale(.97); opacity: .55; }
html.js-componentes .pila-avisos:not(.expandida) .pila-tarjeta:nth-child(3) { transform: translateY(-16px) scale(.94); opacity: .3; }
html.js-componentes .pila-avisos:not(.expandida) .pila-tarjeta:nth-child(n+4) { display: none; }
html.js-componentes .pila-avisos:not(.expandida) .pila-tarjeta { cursor: pointer; }
.pila-tarjeta-cabeza { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.pila-tarjeta-tipo { font-size: 12px; font-weight: 700; color: var(--oro); text-transform: uppercase; letter-spacing: .05em; }
.pila-tarjeta-hora { font-size: 12px; color: var(--texto-tenue); white-space: nowrap; }
.pila-tarjeta-mensaje { margin: 6px 0 0; font-size: 14px; }
.pila-tarjeta-acciones { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.pila-descartar {
  background: transparent; border: 1px solid var(--linea-fuerte); color: var(--texto-suave);
  border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.pila-descartar:hover { border-color: var(--oro); color: var(--oro-claro); }
.pila-tarjeta.saliendo { animation: pila-sale .3s ease both; }
@keyframes pila-sale { to { opacity: 0; transform: translateX(30px); } }

/* ============================ 8. STACK PANEL (ajustes) ================== */
.aj-nivel { display: none; }
.aj-nivel.activo { display: block; animation: aj-entra .25s ease both; }
@keyframes aj-entra { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: translateX(0); } }
html:not(.js-componentes) .aj-nivel { display: block; margin-bottom: 24px; }
.aj-fila {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; text-align: left; background: var(--tarjeta-1);
  border: 1px solid var(--linea); border-radius: 12px; padding: 14px 16px;
  color: var(--texto); font: inherit; cursor: pointer; text-decoration: none;
}
.aj-fila:hover { border-color: var(--oro); }
.aj-fila b { font-weight: 600; }
.aj-fila small { display: block; color: var(--texto-tenue); font-size: 13px; margin-top: 2px; }
.aj-fila .aj-flecha { color: var(--oro); font-weight: 700; }
.aj-volver {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: 0; color: var(--oro-claro);
  font: inherit; font-weight: 600; cursor: pointer; padding: 6px 0;
}
.aj-titulo { font-family: 'Big Shoulders Display', serif; font-weight: 900; text-transform: uppercase; font-size: clamp(24px, 4vw, 34px); margin: 4px 0 14px; }

/* ============================ 9. STAT CARD ============================== */
.stat-card { background: var(--tarjeta-1); border: 1px solid var(--linea-fuerte); border-radius: 16px; padding: 18px; }
.stat-rangos { display: flex; gap: 6px; }
.stat-rango {
  background: transparent; border: 1px solid var(--linea-fuerte); color: var(--texto-suave);
  border-radius: 999px; padding: 7px 14px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.stat-rango.activo { background: var(--oro); border-color: var(--oro); color: #060608; }
.stat-cifra { font-family: 'Big Shoulders Display', serif; font-weight: 900; font-size: clamp(34px, 6vw, 48px); line-height: 1.05; margin-top: 10px; }
.stat-chip {
  display: inline-block; margin-top: 8px; font-size: 13px; font-weight: 700;
  border-radius: 999px; padding: 4px 11px;
  background: rgba(63, 164, 106, .16); color: #7fd6a4;
}
.stat-chip.baja { background: rgba(212, 24, 43, .16); color: #ff8a96; }
.stat-chip.plano { background: rgba(255, 255, 255, .07); color: var(--texto-suave); }
.stat-grafica { width: 100%; height: 110px; margin-top: 12px; }
.stat-grafica path.area { fill: rgba(212, 175, 55, .18); }
.stat-grafica path.linea { fill: none; stroke: var(--oro); stroke-width: 2; }
.stat-grafica circle.punto { fill: var(--oro); }
.stat-etiquetas { display: flex; justify-content: space-between; font-size: 12px; color: var(--texto-tenue); margin-top: 6px; }

/* ============================ 10. EXPAND CARD =========================== */
.expandible { background: var(--tarjeta-1); border: 1px solid var(--linea); border-radius: 14px; overflow: hidden; transition: border-color .2s ease, transform .2s ease; }
.expandible.abierta { border-color: var(--oro); }
.expandible-cabeza { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.expandible-resumen {
  flex: 1 1 auto; min-width: 0; display: flex; align-items: baseline; gap: 10px;
  background: transparent; border: 0; color: var(--texto); font: inherit;
  text-align: left; cursor: pointer; padding: 0;
}
.expandible-resumen .exp-nombre { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.expandible-resumen .exp-servicio { color: var(--texto-suave); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.expandible-resumen .exp-hora { margin-left: auto; font-weight: 700; color: var(--oro-claro); white-space: nowrap; }
.expandible-flecha { color: var(--oro); transition: transform .25s ease; flex: 0 0 auto; }
.expandible.abierta .expandible-flecha { transform: rotate(180deg); }
.expandible-acciones { flex: 0 0 auto; display: flex; gap: 6px; }
.expandible-detalle { display: none; border-top: 1px solid var(--linea); padding: 12px 14px; }
.expandible.abierta .expandible-detalle { display: block; animation: exp-abre .25s ease both; }
@keyframes exp-abre { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.expandible-detalle .fila { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 14px; }
.expandible-detalle .fila span:first-child { color: var(--texto-tenue); }
.expandible-detalle .fila span:last-child { text-align: right; font-weight: 600; }

/* Variante anidada (panel): el renglón .fila-item ya es la tarjeta y no se
   toca (ni sus botones ni sus atributos de refresco en vivo); la barra de
   detalle es una tarjeta fina debajo, con su detalle. */
.expandible.anidado { background: transparent; border: 0; overflow: visible; }
.expandible.anidado .expandible-cabeza {
  margin-top: 6px; background: var(--tarjeta-1);
  border: 1px solid var(--linea); border-radius: 12px;
}
.expandible.anidado.abierta .expandible-cabeza { border-radius: 12px 12px 0 0; }
.expandible.anidado .expandible-detalle {
  background: var(--tarjeta-1); border: 1px solid var(--linea); border-top: 0;
  border-radius: 0 0 12px 12px;
}

/* ============================ 11. FILE DROP ============================= */
.subida-zona {
  border: 1.5px dashed var(--linea-fuerte); border-radius: 14px;
  padding: 22px 16px; text-align: center; cursor: pointer;
  background: var(--tarjeta-2); transition: border-color .2s ease, background .2s ease;
}
.subida-zona:hover, .subida-zona.arrastrando { border-color: var(--oro); background: rgba(212, 175, 55, .06); }
.subida-zona .subida-titulo { font-weight: 700; }
.subida-zona .subida-ayuda { font-size: 13px; color: var(--texto-tenue); margin-top: 4px; }
.subida-archivo { display: flex; align-items: center; gap: 12px; margin-top: 12px; background: var(--tarjeta-1); border: 1px solid var(--linea); border-radius: 12px; padding: 10px 12px; }
.subida-archivo img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; }
.subida-archivo .subida-nombre { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.subida-archivo .subida-tamano { font-size: 12px; color: var(--texto-tenue); }
.subida-quitar { margin-left: auto; background: transparent; border: 1px solid var(--linea-fuerte); color: var(--texto-suave); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.subida-quitar:hover { border-color: var(--oro); color: var(--oro-claro); }
