/* ==========================================================================
   GestIA · Vista de inicio: saldo, solicitud en curso, calendario, ficha y equipo
   ========================================================================== */

/* ---------- Inicio ---------- */
.welcome { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.welcome h2 { margin-top: 4px; font-size: clamp(24px, 2.6vw, 32px); font-weight: 800; letter-spacing: -.035em; }
.welcome .name { background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.welcome p.muted { margin-top: 4px; font-size: 14.5px; }

.balance { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(300px, 1fr); overflow: hidden; }
.balance-main { display: flex; flex-direction: column; gap: 18px; padding: 26px 28px 28px; min-width: 0; }
.balance-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.balance-figure { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 10px; }
.balance-figure strong { font-size: clamp(64px, 6.6vw, 88px); font-weight: 800; letter-spacing: -.055em; line-height: .9; color: var(--navy-800); }
.balance-figure .unit { font-size: 24px; font-weight: 750; color: var(--ink-2); }
.balance-figure .hint { flex-basis: 100%; margin-top: 8px; font-size: 13.5px; color: var(--ink-3); }
.balance-legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.legend-card {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line-soft);
  background: var(--surface-2);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.legend-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.legend-card .swatch { width: 12px; height: 12px; margin-top: 7px; border-radius: 4px; }
.legend-card b { display: block; font-size: 14.5px; font-weight: 750; }
.legend-card .num { margin-right: 3px; font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.legend-card small { display: block; margin-top: 4px; font-size: 12.5px; line-height: 1.5; color: var(--ink-3); }
.legend-card .legend-expired { display: block; margin-top: 2px; color: var(--ink-2); }
.legend-card .legend-expired .swatch { width: 8px; height: 8px; margin: 0 6px 0 0; border-radius: 2px; }
.legend-card.is-hold { background: #fffaf0; border-color: #fde7b8; }
.balance-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; padding-top: 4px; }

.scene {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 340px;
  container-type: inline-size;
  background: linear-gradient(180deg, #1c3486 0%, #2f5bea 32%, #14a4dc 70%, #8ee6d8 100%);
}
.scene-art { position: absolute; inset: 0; }
.scene-star { position: absolute; width: 6px; height: 6px; border-radius: 1px; background: #fff; opacity: 0; animation: twinkle 3.4s ease-in-out infinite; }
.scene-star.s1 { top: 11%; left: 12%; }
.scene-star.s2 { top: 21%; left: 46%; animation-delay: -1.1s; }
.scene-star.s3 { top: 7%; left: 64%; animation-delay: -2.2s; }
.scene-star.s4 { top: 30%; left: 26%; width: 4px; height: 4px; animation-delay: -.6s; }
@keyframes twinkle { 0%, 100% { opacity: 0; transform: rotate(45deg) scale(.4); } 50% { opacity: .9; transform: rotate(45deg) scale(1); } }
.scene-sun {
  position: absolute;
  top: 15%;
  right: 17%;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff4c2 0%, #fbbf24 45%, #f2654f 100%);
  box-shadow: 0 0 0 16px rgba(251, 191, 36, .16), 0 0 0 36px rgba(251, 191, 36, .07), 0 0 90px 30px rgba(251, 160, 60, .45);
  animation: sun-rise .9s var(--ease) .1s both;
}
.scene-sun::after {
  content: "";
  position: absolute;
  inset: -50px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(251, 191, 36, .28) 30%, transparent 70%);
  animation: sun-glow 6s ease-in-out 1s infinite;
}
@keyframes sun-rise { from { opacity: 0; transform: translateY(120px) scale(.7); } to { opacity: 1; transform: none; } }
@keyframes sun-glow { 0%, 100% { opacity: .4; transform: scale(.9); } 50% { opacity: 1; transform: scale(1.1); } }
.cloud { position: absolute; left: -120px; height: 18px; border-radius: 99px; background: rgba(255, 255, 255, .9); animation: cloud linear infinite; will-change: transform; }
.cloud::before, .cloud::after { content: ""; position: absolute; border-radius: 50%; background: inherit; }
.cloud::before { width: 26px; height: 26px; left: 12px; top: -12px; }
.cloud::after { width: 18px; height: 18px; left: 32px; top: -8px; }
.cloud.c1 { top: 25%; width: 72px; animation-duration: 40s; animation-delay: -8s; }
.cloud.c2 { top: 42%; width: 54px; opacity: .75; animation-duration: 55s; animation-delay: -32s; }
.cloud.c3 { top: 11%; width: 46px; opacity: .6; animation-duration: 46s; animation-delay: -20s; }
@keyframes cloud { to { transform: translateX(calc(100cqw + 240px)); } }
.scene-plane { position: absolute; top: 36%; left: -40px; animation: plane 17s linear 1.2s infinite; will-change: transform; }
.scene-plane .i { width: 26px; height: 26px; fill: #fff; stroke: #fff; stroke-width: 1; }
@keyframes plane { from { transform: translate(0, 34px); } to { transform: translate(calc(100cqw + 90px), -80px); } }
.scene .mountains { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 60%; }
.scene-card {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  color: #fff;
  background: rgba(6, 13, 43, .62);
  border: 1px solid rgba(255, 255, 255, .22);
  animation: rise .4s var(--ease) .3s both;
}
.scene-card-icon { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--grad-warm); }
.scene-card-text { min-width: 0; }
.scene-card small { display: block; font-size: 11.5px; font-weight: 600; opacity: .82; }
.scene-card strong { display: block; font-size: 14.5px; font-weight: 750; }
.scene-count { margin-left: auto; padding: 6px 10px; border-radius: 10px; font-size: 12.5px; font-weight: 750; white-space: nowrap; background: rgba(255, 255, 255, .18); }
@media (max-width: 1000px) {
  .balance { grid-template-columns: 1fr; }
  .scene { min-height: 230px; }
}
@media (max-width: 560px) {
  .balance-main { padding: 20px 18px; }
  .balance-legend { grid-template-columns: 1fr; }
  .balance-actions .btn { flex: 1 1 100%; }
  .scene-count { display: none; }
}

/* Solicitud en curso */
.pending-body { display: grid; gap: 20px; }
.pending-range { display: flex; align-items: center; gap: 14px; }
.pending-range strong { display: block; font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.pending-range span { font-size: 13px; color: var(--ink-3); }
.stepper { position: relative; display: grid; grid-auto-columns: 1fr; grid-auto-flow: column; margin: 0; padding: 0; list-style: none; }
.stepper li { position: relative; display: grid; justify-items: center; gap: 4px; text-align: center; font-size: 12.5px; font-weight: 700; color: var(--ink-3); }
.stepper li::before { content: ""; position: absolute; top: 17px; left: -50%; right: 50%; height: 3px; background: var(--line); }
.stepper li:first-child::before { display: none; }
.stepper li.done::before { background: var(--green-500); }
.stepper li.current::before { background: linear-gradient(90deg, var(--green-500), var(--amber-500)); }
.step-dot { position: relative; z-index: 1; display: grid; place-items: center; width: 36px; height: 36px; margin-bottom: 4px; border-radius: 50%; color: var(--ink-4); background: #fff; border: 2px solid var(--line); }
.step-dot .i { width: 16px; height: 16px; stroke-width: 2.5; }
.stepper .done .step-dot { color: #fff; background: var(--green-500); border-color: var(--green-500); }
.stepper .current { color: var(--ink); }
.stepper .current .step-dot { --pulse: rgba(245, 158, 11, .5); color: #fff; background: var(--amber-500); border-color: var(--amber-500); }
.stepper .current .step-dot .i { animation: flip 3s ease-in-out infinite; }
.stepper small { font-size: 11.5px; font-weight: 500; color: var(--ink-3); }
.pending-note { display: flex; gap: 10px; padding: 12px 14px; border-radius: 14px; font-size: 13px; line-height: 1.5; color: var(--ink-2); background: var(--surface-2); }
.pending-note .i { width: 17px; height: 17px; margin-top: 1px; color: var(--blue-600); }

/* Calendario */
.cal-nav { display: flex; gap: 2px; }
.cal-wrap { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.cal-month { min-width: 0; }
.cal-title { margin-bottom: 8px; text-align: center; font-size: 14px; font-weight: 750; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); row-gap: 3px; }
.cal-dow { padding: 4px 0; text-align: center; font-size: 11px; font-weight: 750; color: var(--ink-4); }
.cal-day {
  position: relative;
  display: grid;
  place-items: center;
  height: 36px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.cal-day.weekend { color: var(--ink-3); }
.cal-day.today { color: var(--blue-700); font-weight: 800; box-shadow: inset 0 0 0 2px var(--blue-200); }
.cal-day.mark { border-radius: 0; }
.cal-day.mark-pending { background: #fef0d3; color: #8f5600; }
.cal-day.mark-approved { background: #dbf5e9; color: #0b7349; }
.cal-day.mark-start { border-top-left-radius: 10px; border-bottom-left-radius: 10px; }
.cal-day.mark-end { border-top-right-radius: 10px; border-bottom-right-radius: 10px; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-soft); font-size: 12.5px; color: var(--ink-2); }
.cal-legend span { display: inline-flex; align-items: center; gap: 7px; }
.today-ring { width: 12px; height: 12px; border-radius: 4px; box-shadow: inset 0 0 0 2px var(--blue-200); }
button.cal-day { width: 100%; transition: background-color .15s, color .15s, box-shadow .2s; }
button.cal-day:hover:not(:disabled) { background: var(--blue-100); color: var(--blue-700); }
button.cal-day:disabled { color: var(--ink-4); cursor: not-allowed; }
.cal-day.busy-pending { color: #8f5600 !important; background: repeating-linear-gradient(135deg, #fde7b8 0 3px, #fff7e6 3px 7px); }
.cal-day.busy-approved { color: #0b7349 !important; background: repeating-linear-gradient(135deg, #c6eedb 0 3px, #effaf5 3px 7px); }
.cal-day.in-range { border-radius: 0; background: var(--blue-100); color: var(--blue-700); }
.cal-day.preview { border-radius: 0; background: var(--blue-50); color: var(--blue-700); }
.cal-day.range-start, .cal-day.range-end { z-index: 1; color: #fff !important; font-weight: 800; background: var(--blue-600) !important; box-shadow: 0 8px 16px -8px rgba(47, 91, 234, .8); }
.cal-day.range-start { border-radius: 10px 0 0 10px; }
.cal-day.range-end { border-radius: 0 10px 10px 0; }
.cal-day.range-start.range-end, .cal-day.range-single { border-radius: 10px; }
@media (max-width: 680px) {
  .cal-wrap { grid-template-columns: 1fr; }
  .cal-wrap .cal-month + .cal-month { display: none; }
}

/* Ficha laboral */
.facts { display: grid; gap: 2px; padding: 12px 12px 14px; }
.fact { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 12px; transition: background-color .15s; }
.fact:hover { background: var(--surface-2); }
.fact .icon-tile { width: 36px; height: 36px; border-radius: 11px; }
.fact .icon-tile .i { width: 17px; height: 17px; }
.fact-text { flex: 1; min-width: 0; }
.fact-text span { display: block; font-size: 12px; color: var(--ink-3); }
.fact-text strong { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; font-size: 14px; font-weight: 700; }
.fact-text strong small { font-size: 12px; font-weight: 600; color: var(--ink-3); }

/* Bloque de equipo */
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 8px; padding-top: 24px; border-top: 1px solid var(--line); }
.section-head h2 { margin-top: 3px; font-size: 22px; font-weight: 800; letter-spacing: -.03em; }
.review-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 22px; border-top: 1px solid var(--line-soft); transition: background-color .15s; }
.review-item:hover { background: var(--surface-2); }
.review-item.leaving, .req-row.leaving { animation: leave .45s var(--ease) forwards; pointer-events: none; }
@keyframes leave { to { opacity: 0; transform: translateX(28px); } }
.review-main { min-width: 0; }
.review-main strong { display: block; font-size: 14px; font-weight: 700; }
.review-main small { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-3); }
.review-actions { display: flex; gap: 6px; }
@media (max-width: 560px) {
  .review-item { grid-template-columns: auto minmax(0, 1fr); }
  .review-actions { grid-column: 1 / -1; }
  .review-actions .btn { flex: 1; }
}
.countries { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 16px 22px 22px; }
.country { display: grid; gap: 12px; padding: 16px; border-radius: 16px; border: 1px solid var(--line-soft); background: var(--surface-2); transition: transform .25s var(--ease), box-shadow .25s; }
.country:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.country-head { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 750; }
.country-big { font-size: 30px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.country-big small { margin-left: 4px; font-size: 13px; font-weight: 600; letter-spacing: 0; color: var(--ink-3); }
.country-rows { display: grid; gap: 6px; font-size: 12.5px; color: var(--ink-3); }
.country-rows div { display: flex; justify-content: space-between; gap: 8px; }
.country-rows b { color: var(--ink); font-variant-numeric: tabular-nums; }
.country-rows span { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 440px) { .countries { grid-template-columns: 1fr; } }

.bars { display: grid; gap: 8px; padding: 16px 22px 20px; }
.bar-row { display: grid; grid-template-columns: minmax(96px, 180px) minmax(0, 1fr); align-items: center; gap: 14px; padding: 4px 0; }
.bar-label { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.bar-area { min-width: 0; padding-right: 92px; }
.bar-scale { position: relative; height: 18px; }
.bar { position: absolute; left: 0; top: 0; bottom: 0; width: 0; transition: width .45s var(--ease); }
.bar .meter { height: 100%; border-radius: 0 4px 4px 0; background: transparent; }
.bar .meter-seg:first-child { border-radius: 0; }
.bar-row .meter-seg { transition: width .45s var(--ease), opacity .2s var(--ease); }
.bars-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 12px 22px 0; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.bars-legend span { display: inline-flex; align-items: center; gap: 6px; }
.bar-value { position: absolute; top: 50%; left: calc(var(--w) + 8px); transform: translateY(-50%); font-size: 12.5px; font-weight: 750; white-space: nowrap; font-variant-numeric: tabular-nums; animation: fade .5s ease .7s both; }
.bar-value small { font-weight: 600; color: var(--ink-3); }
.bars:hover .bar-row:not(:hover) .meter-seg { opacity: .55; }
.bar-row:hover .bar-label { color: var(--ink); }
@media (max-width: 520px) { .bar-row { grid-template-columns: 1fr; gap: 4px; } }

.rank { width: 22px; flex: none; text-align: center; font-size: 12px; font-weight: 800; color: var(--ink-4); }
.days-cell { flex: none; text-align: right; }
.days-cell strong { display: block; font-size: 17px; font-weight: 800; line-height: 1.2; }
.days-cell small { font-size: 11.5px; color: var(--ink-3); }
.top-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; padding: 16px 22px 22px; }
.top-card { display: grid; justify-items: center; gap: 6px; padding: 16px 10px; border-radius: 16px; text-align: center; border: 1px solid var(--line-soft); background: var(--surface-2); transition: transform .25s var(--ease), box-shadow .25s; min-width: 0; }
.top-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); }
.top-card strong { max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13.5px; }
.top-card .days-cell { text-align: center; }
@media (max-width: 900px) { .top-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
