/* Chinflip · bloques de números con diseño propio por pantalla (ver js/stats.js) */

/* ---------- Asistencia: tablero con anillo ---------- */
[data-estilo="stats-mes"] { grid-template-columns: 1.35fr repeat(3, minmax(0, 1fr)); gap: 0; padding: 0; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); box-shadow: var(--shadow); overflow: hidden; }
.st-ring-card { display: flex; align-items: center; gap: 16px; padding: 18px 20px; color: #fff; background: linear-gradient(135deg, #1d4fd8, #0b1a36); }
.st-ring { --v: 0; display: grid; place-items: center; width: 84px; aspect-ratio: 1; flex: none; border-radius: 50%; background: conic-gradient(var(--lime) calc(var(--v) * 1%), #ffffff26 0); }
.st-ring::before { content: ""; grid-area: 1 / 1; width: 70%; aspect-ratio: 1; border-radius: 50%; background: #0f2f8a; }
.st-ring b { grid-area: 1 / 1; z-index: 1; font-size: 1.25rem; letter-spacing: -.04em; }
.st-ring-card small, .st-ring-card span { display: block; }
.st-ring-card small { font-size: 1rem; font-weight: 700; }
.st-ring-card span { color: #c9d6ef; font-size: .8rem; }
.st-ring-card span::first-letter { text-transform: uppercase; }
.st-metric { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-left: 1px solid var(--line); }
.st-metric i { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 14px; background: #e8eefc; }
.st-metric i svg { width: 22px; height: 22px; fill: var(--purple); }
.st-metric i[data-kind="late"] { background: #fdf0d9; } .st-metric i[data-kind="late"] svg { fill: #c27a0e; }
.st-metric i[data-kind="missing"] { background: #fde8eb; } .st-metric i[data-kind="missing"] svg { fill: #c2384b; }
.st-metric b, .st-metric small, .st-metric span { display: block; }
.st-metric b { font-size: 1.6rem; line-height: 1.05; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.st-metric small { font-size: .82rem; font-weight: 700; }
.st-metric span { color: var(--muted); font-size: .74rem; line-height: 1.3; }

/* ---------- Colaboradores: vidrio sobre la planta, con caras ---------- */
[data-estilo="stats-equipo"] { position: relative; isolation: isolate; overflow: hidden; padding: 14px; border-radius: 20px; background: #0b1a36 url("../planta-demo.png") center 40% / cover no-repeat; box-shadow: 0 14px 34px #0b1a3633; }
[data-estilo="stats-equipo"]::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, #07142eeb 0%, #07142eb0 45%, #07142e4d 100%); }
[data-estilo="stats-equipo"] .mini { border: 1px solid #ffffff30; background: #ffffff17; color: #fff; box-shadow: none; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
[data-estilo="stats-equipo"] .mini:first-child { background: linear-gradient(135deg, #1d4fd8e6, #0f2f8ae6); border-color: #4f7cf0; }
[data-estilo="stats-equipo"] .mini small { color: #c9d6ef; }
[data-estilo="stats-equipo"] .mini span:not(.faces):not(.portrait):not(.more) { color: #aebbd6; }
[data-estilo="stats-equipo"] .faces { margin-top: 6px; }
[data-estilo="stats-equipo"] .faces .portrait { width: 28px; box-shadow: 0 0 0 2px #0f2f8a; }
[data-estilo="stats-equipo"] .faces .more { color: #fff; }

/* ---------- Vacaciones: hojitas de calendario ---------- */
[data-estilo="stats-permisos"] { gap: 14px; }
[data-estilo="stats-permisos"] .mini { padding: 0 0 14px; gap: 0; text-align: center; border-radius: 14px; overflow: visible; }
[data-estilo="stats-permisos"] .mini::before, [data-estilo="stats-permisos"] .mini::after { content: ""; position: absolute; top: -6px; width: 8px; height: 16px; border-radius: 4px; background: #c3ccdc; box-shadow: inset 0 -2px #8d9ab3; z-index: 1; }
[data-estilo="stats-permisos"] .mini::before { left: 26%; } [data-estilo="stats-permisos"] .mini::after { right: 26%; }
.st-cal-top { display: block; padding: 9px 10px 7px; border-radius: 14px 14px 0 0; background: var(--rail); color: #fff; font-size: .72rem; font-style: normal; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
[data-estilo="stats-permisos"] .mini[data-kind="late"] .st-cal-top { background: var(--lime); color: #3d2a00; }
[data-estilo="stats-permisos"] .mini[data-kind="missing"] .st-cal-top { background: #c2384b; }
[data-estilo="stats-permisos"] .mini b { margin: 8px 0 2px; font-size: 2.5rem; letter-spacing: -.05em; line-height: 1; }
[data-estilo="stats-permisos"] .mini span { padding: 0 12px; }

/* ---------- Altas y bajas: la cuenta del año + rotación ---------- */
[data-estilo="stats-mov"] { grid-template-columns: minmax(0, 1fr) 300px; gap: 12px; }
.st-eq { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 16px 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper) repeating-linear-gradient(90deg, transparent 0 23px, #eef2f8 23px 24px); box-shadow: var(--shadow); }
.st-eq em { color: #8d9ab3; font-size: 1.6rem; font-style: normal; font-weight: 800; }
.st-eq-term { display: grid; justify-items: center; min-width: 92px; padding: 10px 12px; border-radius: 14px; background: #f3f6fa; }
.st-eq-term b { font-size: 2rem; line-height: 1; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.st-eq-term small { color: var(--muted); font-size: .74rem; font-weight: 600; white-space: nowrap; }
.st-eq-term.st-alta { background: #e3f4ea; } .st-eq-term.st-alta b { color: #1f7a4d; }
.st-eq-term.st-baja { background: #fde8eb; } .st-eq-term.st-baja b { color: #b02a3e; }
.st-eq-term.st-total { background: var(--purple); color: #fff; box-shadow: 0 8px 20px #1d4fd840; } .st-eq-term.st-total small { color: #d6e2ff; }
.st-gauge { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: 18px; background: var(--rail); color: #fff; box-shadow: var(--shadow); }
.st-gauge-arc { --v: 0; position: relative; display: grid; place-items: end center; width: 104px; height: 56px; flex: none; overflow: hidden; }
.st-gauge-arc::before { content: ""; position: absolute; top: 0; left: 0; width: 104px; height: 104px; border-radius: 50%; background: conic-gradient(from -90deg, #2fa36b 0 calc(var(--v) * .5% * .33), #f5b324 0 calc(var(--v) * .5% * .66), #e2687a 0 calc(var(--v) * .5%), #ffffff22 0 50%, transparent 0); -webkit-mask: radial-gradient(circle, transparent 36px, #000 37px); mask: radial-gradient(circle, transparent 36px, #000 37px); }
.st-gauge-arc b { position: relative; font-size: 1.15rem; letter-spacing: -.03em; }
.st-gauge small, .st-gauge span { display: block; }
.st-gauge small { font-weight: 700; }
.st-gauge span { color: #aebbd6; font-size: .74rem; line-height: 1.3; }

/* ---------- Vacantes: embudo de flechas ---------- */
[data-estilo="vac-stats"] { gap: 0; filter: drop-shadow(0 6px 14px #0b1a3626); }
[data-estilo="vac-stats"] .mini { padding: 14px 30px 14px 34px; border: 0; border-radius: 0; box-shadow: none; color: #fff; background: var(--rail);
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 50%, calc(100% - 18px) 100%, 0 100%, 18px 50%); margin-left: -8px; }
[data-estilo="vac-stats"] .mini:first-child { margin-left: 0; border-radius: 16px 0 0 16px; clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 50%, calc(100% - 18px) 100%, 0 100%); padding-left: 20px; }
[data-estilo="vac-stats"] .mini[data-paso="2"] { background: #163ea8; }
[data-estilo="vac-stats"] .mini[data-paso="3"] { background: #1d4fd8; }
[data-estilo="vac-stats"] .mini[data-paso="4"] { background: var(--lime); color: #3d2a00; }
[data-estilo="vac-stats"] .mini small { color: inherit; opacity: .85; }
[data-estilo="vac-stats"] .mini span { color: inherit; opacity: .72; }
.st-paso { position: absolute; top: 12px; right: 30px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #ffffff26; font-size: .72rem; font-style: normal; font-weight: 800; }
[data-paso="4"] .st-paso { background: #3d2a0022; }

/* ---------- EPP: franja de seguridad ---------- */
[data-estilo="epp-stats"] .mini { padding-top: 22px; overflow: hidden; }
[data-estilo="epp-stats"] .mini::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 8px; background: repeating-linear-gradient(-45deg, var(--lime) 0 10px, #0b1a36 10px 20px); }
[data-estilo="epp-stats"] .mini[data-kind="missing"] b { color: #b02a3e; }
[data-estilo="epp-stats"] .mini[data-kind="late"] b { color: #b46a0c; }
[data-estilo="epp-stats"] .mini[data-kind="extra"] { background: var(--rail); color: #fff; border-color: var(--rail); }
[data-estilo="epp-stats"] .mini[data-kind="extra"] b { color: var(--lime); }
[data-estilo="epp-stats"] .mini[data-kind="extra"] small, [data-estilo="epp-stats"] .mini[data-kind="extra"] span { color: #c9d6ef; }
.st-bar { height: 8px; margin-top: 8px; border-radius: 99px; background: #eef2f8; overflow: hidden; }
.st-bar div { height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2fa36b, #3ddc8a); }

/* ---------- Laptop chica y celular ---------- */
@media (max-width: 1200px) {
  [data-estilo="stats-mov"] { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  [data-estilo="stats-mes"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .st-ring-card { grid-column: 1 / -1; }
  .st-metric:nth-child(2) { border-left: 0; }
  .st-metric { flex-direction: column; align-items: flex-start; border-top: 1px solid var(--line); }
  [data-estilo="vac-stats"] { gap: 8px; filter: none; }
  [data-estilo="vac-stats"] .mini, [data-estilo="vac-stats"] .mini:first-child { margin: 0; clip-path: none; border-radius: 14px; padding: 14px 16px; }
  .st-paso { right: 12px; }
}
@media (max-width: 720px) {
  .st-metric { padding: 12px; }
  .st-metric b { font-size: 1.3rem; }
  .st-eq { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 10px; }
  .st-eq em { display: none; }
  .st-eq-term { min-width: 0; }
  .st-eq-term.st-alta b::before { content: "+"; } .st-eq-term.st-baja b::before { content: "−"; } .st-eq-term.st-total b::before { content: "= "; opacity: .7; }
}
