/* =========================================================
   Aku Ley — «Analiza tu caso»
   ========================================================= */
.caso-page { min-height: 100vh; }
.caso-page [hidden] { display: none !important; }
.caso-page .nav { color: var(--ink); }
.who { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 0.9rem; }
.who img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: var(--surface-2); }
.who span { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- gate ---------- */
.gate { position: relative; min-height: 100vh; min-height: 100svh; display: grid; place-items: center; padding: 100px 16px 40px; overflow: hidden; }
.gate .blob { opacity: 0.22; }
.gate-card {
  position: relative; z-index: 1; width: min(520px, 100%); text-align: center; background: var(--surface);
  border: 1px solid var(--line); border-radius: 28px; padding: clamp(26px, 5vw, 44px); box-shadow: var(--shadow-lg);
  animation: rise 0.7s var(--ease) both; opacity: 0; transform: translateY(16px);
}
.gate-card h1 { font-size: clamp(2rem, 6vw, 2.8rem); margin: 14px 0 12px; }
.gate-card p { color: var(--ink-2); }
.gate-card .btn.big { margin: 26px auto 18px; padding: 15px 24px; font-size: 1.02rem; }
.gate-points { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 8px; text-align: left; }
.gate-points li { padding: 10px 14px; background: var(--surface-2); border-radius: 12px; font-size: 0.92rem; color: var(--ink-2); }
.gate-err { margin-top: 14px; color: var(--red); font-weight: 600; font-size: 0.9rem; }
.big-emoji { font-size: 3.4rem; animation: wobble 0.9s var(--spring); }
.lock { width: 84px; height: 84px; margin: 0 auto 10px; border-radius: 24px; display: grid; place-items: center; background: linear-gradient(135deg, var(--gold-2), var(--ember)); box-shadow: 0 18px 40px -12px rgba(224, 122, 63, 0.6); }
.lock svg { width: 50px; height: 50px; fill: none; stroke: var(--navy); stroke-width: 4; stroke-linecap: round; }
.lock .lk-body { fill: rgba(11, 21, 48, 0.12); }
.lock .lk-shackle { animation: shackle 2.8s var(--spring) infinite; transform-origin: 44px 28px; }
@keyframes shackle { 0%, 60%, 100% { transform: none; } 75% { transform: translateY(-5px) rotate(18deg); } }
.loader { display: flex; gap: 10px; }
.loader span { width: 14px; height: 14px; border-radius: 50%; background: var(--gold); animation: bounce 1s ease-in-out infinite; }
.loader span:nth-child(2) { animation-delay: 0.15s; } .loader span:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce { 50% { transform: translateY(-14px); opacity: 0.5; } }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 320px 1fr; min-height: 100vh; padding-top: 64px; }
.side { border-right: 1px solid var(--line); background: var(--bg-alt); display: flex; flex-direction: column; height: calc(100vh - 64px); position: sticky; top: 64px; }
.side-head { display: flex; justify-content: space-between; align-items: center; padding: 20px 18px 12px; }
.side-head h2 { font-size: 1.5rem; }
.btn.sm { padding: 8px 14px; font-size: 0.86rem; border-radius: 12px; }
.case-list { flex: 1; overflow-y: auto; padding: 4px 12px 16px; display: grid; gap: 8px; align-content: start; }
.case-item {
  text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 16px; padding: 14px;
  display: grid; gap: 6px; transition: transform 0.25s var(--spring), border-color 0.2s, box-shadow 0.2s;
  animation: rise 0.45s var(--ease) both; animation-delay: calc(var(--i) * 40ms); opacity: 0; transform: translateY(10px);
}
.case-item:hover { transform: translateX(4px); box-shadow: var(--shadow); }
.case-item.on { border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 25%, transparent); }
.case-item b { font-size: 0.98rem; line-height: 1.3; }
.case-item .ci-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 0.78rem; color: var(--muted); }
.state { font-size: 0.72rem; font-weight: 800; padding: 3px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.state.s-abierto { background: color-mix(in srgb, var(--teal) 15%, transparent); color: var(--teal); }
.state.s-analisis { background: color-mix(in srgb, var(--amber) 16%, transparent); color: var(--amber); }
.state.s-esperando { background: color-mix(in srgb, #7c3aed 15%, transparent); color: #8b5cf6; }
.state.s-respondido { background: color-mix(in srgb, var(--green) 15%, transparent); color: var(--green); }
.state.s-cerrado { background: color-mix(in srgb, var(--muted) 18%, transparent); color: var(--muted); }
.side-empty { padding: 20px; text-align: center; color: var(--muted); font-size: 0.92rem; }
.side-foot { border-top: 1px solid var(--line); padding: 16px 18px 20px; background: var(--surface-2); }
.side-foot h3 { font-family: "Plus Jakarta Sans", sans-serif; font-size: 1rem; letter-spacing: 0; }
.side-foot p { font-size: 0.82rem; color: var(--muted); margin: 4px 0 8px; }
.acl { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 6px; max-height: 140px; overflow-y: auto; }
.acl li { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; font-size: 0.84rem; animation: pop 0.35s var(--spring); }
.acl li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acl li button { border: 0; background: none; color: var(--red); font-weight: 800; }
.acl-add { display: flex; gap: 6px; }
.acl-add input { flex: 1; min-width: 0; font: inherit; font-size: 0.88rem; color: var(--ink); background: var(--surface); border: 1.5px solid var(--line); border-radius: 10px; padding: 8px 10px; }

.main { padding: clamp(18px, 3vw, 34px); min-width: 0; }
.empty-state { max-width: 640px; margin: 6vh auto 0; text-align: center; animation: rise 0.6s var(--ease) both; opacity: 0; transform: translateY(14px); }
.es-art { font-size: 4rem; animation: bob 4s ease-in-out infinite; display: inline-block; }
.empty-state h2 { font-size: clamp(1.6rem, 3.6vw, 2.2rem); margin: 10px 0; }
.empty-state p { color: var(--ink-2); }
.how { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 10px; text-align: left; }
.how li { display: flex; gap: 12px; align-items: center; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.how b { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--gold-2); color: var(--navy); display: grid; place-items: center; }

/* ---------- case ---------- */
.case { max-width: 1200px; margin: 0 auto; animation: rise 0.5s var(--ease) both; opacity: 0; transform: translateY(12px); }
.case-top { display: flex; gap: 12px; align-items: center; }
.case-top .back { display: none; flex: none; }
.case-title {
  flex: 1; min-width: 0; font-family: "Fraunces", serif; font-size: clamp(1.5rem, 3.4vw, 2.2rem); font-weight: 800; letter-spacing: -0.02em;
  border: 1.5px solid transparent; background: none; color: var(--ink); border-radius: 12px; padding: 4px 8px; margin-left: -8px;
}
.case-title:hover { border-color: var(--line); }
.case-title:focus { outline: 0; border-color: var(--gold); background: var(--surface); }
.case-actions { display: flex; gap: 8px; flex: none; }
.danger-t:hover { color: var(--red); border-color: var(--red); }
.meta-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: end; margin: 14px 0; }
.meta-row label, .desc-label { display: grid; gap: 6px; font-size: 0.82rem; font-weight: 700; color: var(--muted); }
select {
  font: inherit; font-size: 0.95rem; color: var(--ink); background: var(--surface); border: 1.5px solid var(--line);
  border-radius: 12px; padding: 9px 12px; min-width: 200px;
}
select:focus { outline: 0; border-color: var(--gold); }
.saved { font-size: 0.82rem; font-weight: 700; color: var(--green); opacity: 0; transition: opacity 0.3s; margin-bottom: 10px; }
.saved.show { opacity: 1; }
.desc-label textarea { font-size: 0.98rem; resize: vertical; min-height: 100px; }

.panels { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.panel h3 { font-family: "Plus Jakarta Sans", sans-serif; font-size: 1.08rem; letter-spacing: 0; display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.count { font-size: 0.78rem; background: var(--surface-2); border: 1px solid var(--line); padding: 2px 9px; border-radius: 999px; }

.drop {
  position: relative; display: grid; place-items: center; text-align: center; gap: 4px; cursor: pointer;
  padding: 26px 16px; border-radius: 18px; border: 2px dashed color-mix(in srgb, var(--gold) 55%, transparent);
  background: color-mix(in srgb, var(--gold-2) 7%, transparent); transition: background 0.25s, transform 0.25s var(--spring), border-color 0.25s;
}
.drop:hover { background: color-mix(in srgb, var(--gold-2) 13%, transparent); }
.drop.over { transform: scale(1.02); border-color: var(--ember); background: color-mix(in srgb, var(--gold-2) 22%, transparent); }
.drop-ico { font-size: 2rem; animation: bob 2.4s ease-in-out infinite; }
.drop.over .drop-ico { animation: bounce 0.6s infinite; }
.drop span { font-size: 0.84rem; color: var(--muted); }
.uploads, .docs { list-style: none; padding: 0; margin: 12px 0 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.docs { max-height: 560px; overflow-y: auto; padding-right: 4px; }
.panels > .panel { overflow: hidden; }
.doc, .up { min-width: 0; }
.up { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-size: 0.86rem; animation: pop 0.3s var(--spring); }
.up .bar { height: 6px; border-radius: 6px; background: var(--line); margin-top: 6px; overflow: hidden; }
.up .bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold-2), var(--ember)); border-radius: inherit; transition: width 0.25s var(--ease); }
.up.err { color: var(--red); }
.doc {
  display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2);
  animation: rise 0.4s var(--ease) both; animation-delay: calc(var(--i) * 35ms); opacity: 0; transform: translateY(8px);
}
.doc .ft { flex: none; width: 44px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-size: 0.62rem; font-weight: 900; color: #fff; background: #64748b; letter-spacing: 0.04em; }
.doc .ft.pdf { background: #dc2626; } .doc .ft.doc { background: #2563eb; } .doc .ft.img { background: #16a34a; } .doc .ft.xls { background: #15803d; } .doc .ft.aud { background: #9333ea; }
.doc .dn { flex: 1; min-width: 0; }
.doc .dn b { display: block; font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc .dn small { color: var(--muted); font-size: 0.76rem; }
.doc .da { display: flex; gap: 4px; flex: none; }
.doc .da button { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; transition: transform 0.2s var(--spring); }
.doc .da button:hover { transform: translateY(-2px); }
.no-docs { color: var(--muted); font-size: 0.9rem; text-align: center; padding: 8px; }

.chat-panel { display: flex; flex-direction: column; }
.chat { display: flex; flex-direction: column; gap: 10px; max-height: 520px; min-height: 160px; overflow-y: auto; padding: 4px 2px 10px; }
.msg { max-width: 88%; padding: 12px 14px; border-radius: 16px; font-size: 0.94rem; white-space: pre-wrap; word-wrap: break-word; animation: pop 0.35s var(--spring); position: relative; }
.msg small { display: block; font-size: 0.72rem; font-weight: 700; margin-bottom: 4px; opacity: 0.7; }
.msg.me { align-self: flex-end; background: var(--ink); color: var(--bg); border-bottom-right-radius: 4px; }
.msg.other { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.claude { align-self: flex-start; background: linear-gradient(145deg, color-mix(in srgb, var(--gold-2) 18%, var(--surface)), var(--surface)); border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); border-bottom-left-radius: 4px; max-width: 96%; }
.msg.claude small { color: var(--ember); opacity: 1; }
.msg .del { position: absolute; top: 6px; right: 8px; border: 0; background: none; opacity: 0; font-size: 0.8rem; color: inherit; transition: opacity 0.2s; }
.msg:hover .del { opacity: 0.6; }
.chat-empty { color: var(--muted); font-size: 0.9rem; text-align: center; margin: auto; padding: 20px; }
.composer { border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 10px; }
.composer textarea { resize: vertical; min-height: 80px; }
.composer-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.composer-row .btn { margin-left: auto; }

@media (max-width: 1100px) {
  .panels { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; border-right: 0; }
  .app.viewing .side { display: none; }
  .app:not(.viewing) .main { display: none; }
  .case-top .back { display: grid; }
  .who span { display: none; }
  .case-top { flex-wrap: wrap; }
  .case-title { order: 3; flex-basis: 100%; margin-left: 0; }
  .case-actions { margin-left: auto; }
  select { min-width: 0; width: 100%; }
  .meta-row label { flex: 1 1 140px; }
}

/* =========================================================
   Tarjeta «Analizar caso completo»
   ========================================================= */
.ai-card { margin-top: 18px; }
.ai {
  position: relative; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; overflow: hidden;
  padding: 22px 24px; border-radius: 24px; color: #fdf8ee;
  background: linear-gradient(130deg, #0b1530, #1d2763 55%, #3b1f5e); box-shadow: var(--shadow-lg);
  animation: rise .5s var(--ease) both; opacity: 0; transform: translateY(10px);
}
.ai::before { content: ""; position: absolute; inset: 0; background: radial-gradient(500px circle at 10% 0%, rgba(245,195,91,.25), transparent 60%); pointer-events: none; }
.ai > * { position: relative; }
.ai-copy { flex: 1 1 320px; min-width: 0; }
.ai-copy b { font-family: "Fraunces", serif; font-size: 1.45rem; display: block; margin-bottom: 4px; }
.ai-copy p { color: rgba(253,248,238,.78); font-size: .94rem; }
.ai-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.ai .btn.ghost { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.2); }
.btn.shine { position: relative; overflow: hidden; }
.btn.shine::after { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.65), transparent); transform: skewX(-20deg); animation: sweep 2.8s ease-in-out infinite; }
@keyframes sweep { 0%, 55% { left: -60%; } 100% { left: 130%; } }
.ai-orb { position: relative; width: 70px; height: 70px; flex: none; display: grid; place-items: center; }
.ai-orb b { position: relative; z-index: 2; font-size: 1.9rem; }
.ai-orb::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: conic-gradient(from 0deg, #f5c35b, #e07a3f, #c2418f, #7c3aed, #12a594, #f5c35b); animation: rot 4s linear infinite; filter: blur(1px); }
.ai-orb::after { content: ""; position: absolute; inset: 11px; border-radius: 50%; background: #121b45; }
.ai-orb.done::before { background: conic-gradient(#16a34a, #4ade80, #16a34a); animation-duration: 8s; }
@keyframes rot { to { transform: rotate(360deg); } }
.ai-orb span { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(245,195,91,.6); animation: ring 2.4s ease-out infinite; }
.ai-orb span:nth-child(2) { animation-delay: .8s; } .ai-orb span:nth-child(3) { animation-delay: 1.6s; }
.ai-steps { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ai-steps span { font-size: .76rem; font-weight: 700; padding: 5px 10px; border-radius: 999px; background: rgba(255,255,255,.07); color: rgba(253,248,238,.6); position: relative; overflow: hidden; }
.ai-steps span.on { background: rgba(245,195,91,.22); color: #ffd98a; }
.ai.pending .ai-steps span:not(.on)::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.18), transparent); transform: translateX(-100%); animation: shimmer 1.8s infinite; }
.ai.pending .ai-steps span:nth-child(3)::after { animation-delay: .3s; } .ai.pending .ai-steps span:nth-child(4)::after { animation-delay: .6s; }
@keyframes shimmer { to { transform: translateX(100%); } }

/* =========================================================
   Informe
   ========================================================= */
.report {
  position: fixed; inset: 0; z-index: 90; background: var(--bg); display: flex; flex-direction: column;
  opacity: 0; transform: translateY(30px) scale(.985); transition: opacity .35s var(--ease), transform .45s var(--ease);
}
.report.open { opacity: 1; transform: none; }
.report-bar { display: flex; align-items: center; gap: 14px; padding: 12px clamp(14px, 3vw, 28px); border-bottom: 1px solid var(--line); background: var(--surface); flex: none; }
.rb-title { flex: 1; min-width: 0; }
.rb-title small { display: block; font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--ember); }
.rb-title b { display: block; font-family: "Fraunces", serif; font-size: 1.25rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rb-actions { display: flex; gap: 8px; }
.report-nav { display: flex; gap: 6px; overflow-x: auto; padding: 10px clamp(14px, 3vw, 28px); border-bottom: 1px solid var(--line); background: var(--surface-2); flex: none; scrollbar-width: none; }
.report-nav::-webkit-scrollbar { display: none; }
.report-nav a { flex: none; text-decoration: none; font-size: .84rem; font-weight: 700; padding: 7px 12px; border-radius: 999px; color: var(--muted); border: 1px solid transparent; transition: all .25s var(--ease); }
.report-nav a:hover { color: var(--ink); }
.report-nav a.on { color: var(--ink); background: var(--surface); border-color: var(--line); box-shadow: var(--shadow); }
.report-body { flex: 1; overflow-y: auto; padding: clamp(16px, 3vw, 36px) clamp(14px, 4vw, 48px) 80px; scroll-behavior: smooth; }
.report-body > * { max-width: 1100px; margin-left: auto; margin-right: auto; }

.rv { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: var(--d, 0s); }
.rv.in { opacity: 1; transform: none; }

.r-hero {
  display: grid; grid-template-columns: 1.4fr .8fr; gap: 28px; align-items: center; color: #fdf8ee;
  background: linear-gradient(140deg, #0b1530, #1d2763 55%, #3b1f5e); border-radius: 30px; padding: clamp(22px, 4vw, 44px); position: relative; overflow: hidden;
}
.r-hero::before { content: ""; position: absolute; width: 380px; height: 380px; right: -100px; top: -140px; border-radius: 50%; background: rgba(240,169,72,.25); filter: blur(50px); }
.r-hero > * { position: relative; }
.r-chip { display: inline-block; font-size: .78rem; font-weight: 800; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16); }
.r-hero h1 { font-size: clamp(1.9rem, 4.4vw, 3rem); margin: 14px 0; }
.r-summary p { color: rgba(253,248,238,.85); font-size: 1.02rem; margin-bottom: 10px; }
.gauge-box { text-align: center; }
.gauge { width: 100%; max-width: 260px; margin: 0 auto; overflow: visible; }
.g-arc { stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset 1.8s var(--ease) .3s; }
.r-hero.in .g-arc { stroke-dashoffset: calc(100 - var(--v)); }
.g-needle { transform-origin: 100px 105px; transform: rotate(-90deg); transition: transform 1.8s var(--spring) .3s; }
.r-hero.in .g-needle { transform: rotate(var(--deg)); }
.g-val { margin-top: -6px; }
.g-val b { font-family: "Fraunces", serif; font-size: 2.6rem; color: #ffd98a; }
.g-val span { color: rgba(253,248,238,.6); font-weight: 700; }
.g-label { font-weight: 800; text-transform: uppercase; letter-spacing: .1em; font-size: .82rem; color: #ffd98a; }
.g-text { font-size: .88rem; color: rgba(253,248,238,.75); margin-top: 6px; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 18px; box-shadow: var(--shadow); opacity: 0; transform: translateY(20px) scale(.97); transition: opacity .6s var(--ease), transform .6s var(--spring); transition-delay: var(--d, 0s); }
.kpi.in { opacity: 1; transform: none; }
.kpi span { font-size: 1.5rem; }
.kpi b { display: block; font-family: "Fraunces", serif; font-size: 2.3rem; line-height: 1.1; }
.kpi small { color: var(--muted); font-size: .84rem; }

.alert-plazo { display: flex; gap: 16px; align-items: center; margin-top: 18px; padding: 16px 20px; border-radius: 18px; background: color-mix(in srgb, var(--amber) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--amber) 35%, transparent); }
.alert-plazo.hot { background: color-mix(in srgb, var(--red) 11%, var(--surface)); border-color: color-mix(in srgb, var(--red) 40%, transparent); }
.alert-plazo p { color: var(--ink-2); font-size: .94rem; }
.ap-ring { flex: none; width: 16px; height: 16px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 0 var(--amber); animation: ping2 1.8s infinite; }
.alert-plazo.hot .ap-ring { background: var(--red); }
@keyframes ping2 { 0% { box-shadow: 0 0 0 0 rgba(217,119,6,.6); } 100% { box-shadow: 0 0 0 16px rgba(217,119,6,0); } }

.rs { margin-top: clamp(40px, 6vw, 64px); }
.rs-h { display: flex; align-items: center; gap: 12px; font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: 20px; }
.rs-i { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 1.4rem; background: color-mix(in srgb, var(--gold-2) 22%, transparent); }

.datos { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin: 0; }
.datos div { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.datos dt { font-size: .76rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.datos dd { margin: 4px 0 0; font-weight: 700; }

.partes { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.parte { display: flex; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px; box-shadow: var(--shadow); }
.parte .av { flex: none; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: var(--navy); background: linear-gradient(135deg, var(--gold-2), var(--ember)); }
.parte small { display: block; color: var(--ember); font-weight: 700; font-size: .82rem; }
.parte p { color: var(--ink-2); font-size: .9rem; margin-top: 4px; }

/* cronología */
.crono { position: relative; list-style: none; padding: 0; margin: 0; }
.crono-line { position: absolute; left: 50%; top: 0; bottom: 0; width: 4px; margin-left: -2px; border-radius: 4px; background: var(--line); }
.crono-line i { position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(var(--gold-2), var(--ember), #c2418f); transform-origin: top; transform: scaleY(0); }
.ce { position: relative; width: 50%; padding: 0 42px 26px 0; }
.ce.right { margin-left: 50%; padding: 0 0 26px 42px; }
.ce-dot { position: absolute; top: 4px; right: -22px; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 3px solid var(--gold); z-index: 1; font-size: 1.1rem; box-shadow: 0 0 0 6px var(--bg); transition: transform .5s var(--spring) .15s; transform: scale(0); }
.ce.right .ce-dot { right: auto; left: -22px; }
.ce.in .ce-dot { transform: scale(1); }
.ce-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px; box-shadow: var(--shadow); position: relative; }
.ce.left { transform: translateX(-30px); } .ce.right { transform: translateX(30px); }
.ce.in { transform: none; }
.ce-card time { display: inline-block; font-size: .78rem; font-weight: 800; color: var(--ember); background: color-mix(in srgb, var(--ember) 12%, transparent); padding: 3px 9px; border-radius: 999px; margin-bottom: 6px; }
.ce-card b { display: block; font-size: 1.02rem; }
.ce-card p { color: var(--ink-2); font-size: .92rem; margin-top: 4px; }
.ce-card small { display: block; color: var(--muted); font-size: .78rem; margin-top: 6px; }
.t-plazo .ce-dot { border-color: var(--amber); } .t-riesgo .ce-dot { border-color: var(--red); }
.t-aud .ce-dot { border-color: #7c3aed; } .t-doc .ce-dot { border-color: #2563eb; } .t-pago .ce-dot { border-color: var(--green); }

.hechos { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.hechos li { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.hechos li span { flex: none; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: .85rem; background: var(--ink); color: var(--bg); }

.an { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; margin-bottom: 10px; overflow: hidden; }
.an summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 20px; font-weight: 800; font-size: 1.05rem; }
.an summary::-webkit-details-marker { display: none; }
.an summary i { font-style: normal; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); transition: transform .35s var(--spring), background .2s; flex: none; }
.an[open] summary i { transform: rotate(45deg); background: var(--gold-2); color: var(--navy); }
.an-b { padding: 0 20px 18px; color: var(--ink-2); }
.an-b p { margin-bottom: 10px; }
.an[open] .an-b { animation: rise .45s var(--ease) both; }

.balance { display: flex; height: 40px; border-radius: 14px; overflow: hidden; margin-bottom: 16px; font-weight: 800; font-size: .86rem; background: color-mix(in srgb, var(--red) 75%, #000 0%); color: #fff; }
.bl-f { display: flex; align-items: center; padding: 0 14px; background: var(--green); white-space: nowrap; width: 0; transition: width 1.4s var(--ease) .2s; }
.balance.in .bl-f { width: var(--w); }
.bl-d { display: flex; align-items: center; margin-left: auto; padding: 0 14px; white-space: nowrap; }
.foda { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.foda-col { border-radius: 20px; padding: 18px 20px; border: 1px solid var(--line); background: var(--surface); }
.foda-col.pos { border-top: 5px solid var(--green); } .foda-col.neg { border-top: 5px solid var(--red); }
.foda-col h3 { font-family: "Plus Jakarta Sans", sans-serif; font-size: 1.05rem; letter-spacing: 0; margin-bottom: 10px; }
.foda-col ul { margin: 0; padding-left: 20px; display: grid; gap: 8px; color: var(--ink-2); }
.foda-col.in li { animation: rise .5s var(--ease) both; animation-delay: calc(var(--i) * 70ms); }
.foda-col li { opacity: 0; transform: translateY(8px); }

.riesgos { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.riesgo { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px; }
.rg-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.rg-tag { flex: none; font-size: .72rem; font-weight: 900; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; background: color-mix(in srgb, var(--amber) 16%, transparent); color: var(--amber); }
.r-alto .rg-tag { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.r-bajo .rg-tag { background: color-mix(in srgb, var(--green) 14%, transparent); color: var(--green); }
.rg-bar { height: 8px; border-radius: 8px; background: var(--surface-2); margin: 12px 0 8px; overflow: hidden; }
.rg-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--gold-2), var(--amber)); transition: width 1.2s var(--ease) .2s; }
.r-alto .rg-bar i { background: linear-gradient(90deg, var(--amber), var(--red)); }
.r-bajo .rg-bar i { background: linear-gradient(90deg, #4ade80, var(--green)); }
.riesgo.in .rg-bar i { width: var(--w); }
.riesgo p { color: var(--ink-2); font-size: .9rem; }

.plazos { display: grid; gap: 10px; }
.plazo { display: grid; grid-template-columns: 170px 1fr; gap: 6px 18px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--teal); border-radius: 16px; padding: 14px 18px; }
.plazo.warm { border-left-color: var(--amber); } .plazo.hot { border-left-color: var(--red); animation: hotPulse 2s ease-in-out infinite; } .plazo.past { opacity: .6; border-left-color: var(--muted); }
@keyframes hotPulse { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--red) 18%, transparent); } }
.pz-date b { display: block; } .pz-date small { color: var(--muted); font-weight: 700; font-size: .8rem; }
.plazo.hot .pz-date small { color: var(--red); }
.plazo > small { grid-column: 2; color: var(--muted); font-size: .8rem; }

.pasos { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.pasos label { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; cursor: pointer; transition: opacity .3s, background .3s; }
.pasos input { display: none; }
.pk { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--gold-2); color: var(--navy); transition: transform .35s var(--spring), background .3s; }
.pasos input:checked + .pk { background: var(--green); color: #fff; transform: rotate(360deg); }
.pasos input:checked + .pk::before { content: "✓"; }
.pasos input:checked + .pk { font-size: 0; } .pasos input:checked + .pk::before { font-size: 1rem; }
.pasos label:has(input:checked) { opacity: .6; }
.pasos label:has(input:checked) b { text-decoration: line-through; }
.pasos p { color: var(--ink-2); font-size: .92rem; } .pasos small { color: var(--muted); font-size: .8rem; }

.normas { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.norma { padding: 16px 18px; background: var(--surface); border-radius: 0 16px 16px 0; border-left: 5px solid var(--gold); }
.norma p { color: var(--ink-2); font-size: .9rem; margin-top: 4px; }

.pend { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pend-col { background: var(--surface); border: 1px dashed color-mix(in srgb, var(--gold) 55%, transparent); border-radius: 20px; padding: 18px 20px; }
.pend-col h3 { font-family: "Plus Jakarta Sans", sans-serif; font-size: 1rem; letter-spacing: 0; margin-bottom: 10px; }
.pend-col ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: var(--ink-2); }

.rdocs { display: grid; gap: 8px; }
.rdoc { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.rdoc summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 10px; padding: 12px 16px; font-weight: 700; }
.rdoc summary::-webkit-details-marker { display: none; }
.rdoc summary small { color: var(--muted); font-weight: 600; flex: none; }
.rdoc p { padding: 0 16px 14px; color: var(--ink-2); font-size: .92rem; }
.r-disc { margin-top: 50px !important; font-size: .85rem; color: var(--muted); padding: 16px 18px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }

@media (max-width: 860px) {
  .r-hero, .foda, .pend { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .crono-line { left: 22px; }
  .ce, .ce.right { width: 100%; margin-left: 0; padding: 0 0 22px 62px; }
  .ce-dot, .ce.right .ce-dot { left: 0; right: auto; }
  .ce.left, .ce.right { transform: translateY(20px); }
  .ce.in { transform: none; }
  .plazo { grid-template-columns: 1fr; }
  .plazo > small { grid-column: 1; }
  .rb-actions .btn span { display: none; }
}

@media print {
  body.print-report > *:not(.report) { display: none !important; }
  body.print-report .report { position: static; transform: none; opacity: 1; display: block; }
  body.print-report .report-bar, body.print-report .report-nav { display: none; }
  body.print-report .report-body { overflow: visible; }
  body.print-report .rv, body.print-report .kpi, body.print-report .foda-col li { opacity: 1 !important; transform: none !important; }
  body.print-report .r-hero, body.print-report .ai { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body.print-report .rs { break-inside: avoid-page; }
}
