/* ═══════════ Tokens ═══════════ */
:root {
  --bg: #F3F4F8;
  --surface: #FFFFFF;
  --surface-2: #F7F8FB;
  --ink: #0E1424;
  --ink-2: #344054;
  --muted: #6B7489;
  --line: #E6E8EF;
  --brand: #D3122A;
  --brand-2: #FF4B5C;
  --brand-deep: #750000;
  --navy: #0E1424;
  --blue: #3B6BFF;
  --teal: #10B3A3;
  --amber: #F2A516;
  --violet: #7A5CFF;
  --green: #18A957;
  --ring: rgba(211, 18, 42, .22);
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px -12px rgba(16, 24, 40, .12);
  --shadow-lg: 0 24px 60px -24px rgba(16, 24, 40, .35);
  --radius: 20px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --logo-filter: none;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #090C15;
  --surface: #111625;
  --surface-2: #161C2E;
  --ink: #EEF1F8;
  --ink-2: #C3C9D8;
  --muted: #8790A6;
  --line: #222A3F;
  --ring: rgba(255, 75, 92, .3);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -14px rgba(0, 0, 0, .6);
  --logo-filter: invert(1) hue-rotate(180deg) brightness(1.15);
  color-scheme: dark;
}

/* ═══════════ Base ═══════════ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv11", "ss01";
  transition: background .4s var(--ease), color .4s var(--ease);
}
h1, h2, h3, p { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sprite { display: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 8px; }

/* ═══════════ Botones ═══════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 12px; font-weight: 600; font-size: 14px;
  transition: transform .2s var(--ease), box-shadow .3s var(--ease), background .3s, opacity .2s;
  position: relative; white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--brand-2), var(--brand) 55%, #A10C1F);
  box-shadow: 0 8px 20px -8px rgba(211, 18, 42, .65), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.btn-primary:hover { box-shadow: 0 14px 28px -10px rgba(211, 18, 42, .75), inset 0 1px 0 rgba(255, 255, 255, .25); transform: translateY(-1px); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary svg { transition: transform .3s var(--ease); }
.btn-primary:hover svg { transform: translateX(3px); }
.btn-ghost { background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); }
.btn-ghost:hover { border-color: #C9CEDA; background: var(--surface-2); }
.btn-light { background: #fff; color: var(--navy); }
.btn-block { width: 100%; height: 50px; font-size: 15px; }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; border-radius: 10px; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  color: var(--ink-2); background: var(--surface); border: 1px solid var(--line);
  transition: background .2s, transform .2s var(--ease), border-color .2s; position: relative;
}
.icon-btn:hover { background: var(--surface-2); transform: translateY(-1px); }
.icon-btn.sm { width: 32px; height: 32px; border-radius: 10px; }
.icon-btn.sm svg { width: 16px; height: 16px; }
.has-dot::after {
  content: ""; position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--brand); box-shadow: 0 0 0 2px var(--surface); animation: pulse 2s infinite;
}

/* ═══════════ LOGIN ═══════════ */
.login {
  min-height: 100dvh; display: grid; grid-template-columns: 1.15fr 1fr; background: var(--surface);
}
.login.is-leaving { animation: loginOut .7s var(--ease) forwards; }

.login-hero {
  position: relative; overflow: hidden; color: #fff; background: #0A0F1E;
  display: flex; flex-direction: column; justify-content: center; padding: clamp(32px, 6vw, 88px);
}
.aurora span {
  position: absolute; border-radius: 50%; filter: blur(80px); opacity: .7; mix-blend-mode: screen;
  animation: drift 18s ease-in-out infinite alternate;
}
.aurora span:nth-child(1) { width: 520px; height: 520px; background: #D3122A; top: -160px; left: -120px; }
.aurora span:nth-child(2) { width: 460px; height: 460px; background: #4A2BD6; bottom: -180px; right: -80px; animation-duration: 22s; animation-delay: -6s; }
.aurora span:nth-child(3) { width: 340px; height: 340px; background: #FF7A45; top: 40%; left: 45%; opacity: .35; animation-duration: 26s; animation-delay: -12s; }
.grid-bg {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 70% 60% at 40% 45%, #000 30%, transparent 75%);
}
.hero-copy { position: relative; z-index: 2; max-width: 560px; animation: rise 1s var(--ease) both; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 10px; border-radius: 99px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); font-size: 12.5px; letter-spacing: .02em;
  backdrop-filter: blur(10px);
}
.pill i { width: 8px; height: 8px; border-radius: 50%; background: #3BE08B; box-shadow: 0 0 12px #3BE08B; animation: pulse 2s infinite; }
.hero-copy h1 {
  font-size: clamp(38px, 4.6vw, 64px); line-height: 1.04; letter-spacing: -.035em; font-weight: 750; margin: 26px 0 18px;
}
.hero-copy h1 em {
  font-style: normal;
  background: linear-gradient(100deg, #FF8A7A, #FF4B5C 35%, #FFB86B 70%, #FF4B5C);
  background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shine 6s linear infinite;
}
.hero-copy p { color: rgba(255,255,255,.72); font-size: 17px; max-width: 470px; }
.hero-stats { display: flex; gap: 34px; list-style: none; padding: 0; margin: 40px 0 0; flex-wrap: wrap; }
.hero-stats b { display: block; font-size: 24px; letter-spacing: -.02em; }
.hero-stats span { font-size: 12.5px; color: rgba(255,255,255,.55); }

.float-cards { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.fcard {
  position: absolute; display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: 18px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16);
  backdrop-filter: blur(18px) saturate(140%); box-shadow: 0 20px 50px -20px rgba(0,0,0,.6);
  animation: floaty 7s ease-in-out infinite, rise 1.1s var(--ease) both;
}
.fcard strong { display: block; font-size: 14px; }
.fcard small { color: rgba(255,255,255,.6); font-size: 12px; }
.fc1 { top: 9%; right: 7%; animation-delay: 0s, .3s; }
.fc2 { bottom: 10%; right: 12%; flex-direction: column; align-items: flex-start; gap: 2px; animation-delay: -2s, .5s; }
.fc2 strong { font-size: 22px; letter-spacing: -.02em; }
.fc3 { bottom: 7%; left: clamp(32px, 6vw, 88px); animation-delay: -4s, .7s; }
.fi { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; }
.fi.ok { background: rgba(59, 224, 139, .18); color: #5CF0A2; }
.fi.warn { background: rgba(255, 184, 107, .18); color: #FFC583; }
.mini-bars { display: flex; align-items: flex-end; gap: 5px; height: 34px; margin-top: 8px; }
.mini-bars i { width: 9px; border-radius: 3px; background: linear-gradient(#FF8A7A, #D3122A); animation: grow 1.4s var(--ease) both; transform-origin: bottom; }
.mini-bars i:nth-child(1) { height: 30%; } .mini-bars i:nth-child(2) { height: 45%; animation-delay: .1s; }
.mini-bars i:nth-child(3) { height: 38%; animation-delay: .2s; } .mini-bars i:nth-child(4) { height: 60%; animation-delay: .3s; }
.mini-bars i:nth-child(5) { height: 55%; animation-delay: .4s; } .mini-bars i:nth-child(6) { height: 78%; animation-delay: .5s; }
.mini-bars i:nth-child(7) { height: 100%; animation-delay: .6s; }

.login-panel { display: grid; place-items: center; padding: 40px 24px; background: var(--surface); position: relative; }
.login-card { width: 100%; max-width: 420px; animation: rise .9s var(--ease) .15s both; }
.brand-logo { width: 240px; height: auto; display: block; margin-bottom: 48px; filter: var(--logo-filter); }
.steps { position: relative; min-height: 430px; }
.step { display: none; }
.step.is-active { display: block; animation: stepIn .55s var(--ease) both; }
.step h2 { font-size: 28px; letter-spacing: -.025em; font-weight: 720; }
.sub { color: var(--muted); margin: 8px 0 28px; font-size: 15px; }
.sub b { color: var(--ink); font-weight: 600; }

.field { display: block; margin-bottom: 18px; }
.field > span:first-child { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; }
.input {
  display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 16px; border-radius: 14px;
  border: 1.5px solid var(--line); background: var(--surface-2); color: var(--muted);
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.input:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--ring); background: var(--surface); color: var(--brand); }
.input input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 15px; color: var(--ink); min-width: 0; }
.divider { display: flex; align-items: center; gap: 14px; margin: 26px 0 18px; color: var(--muted); font-size: 12.5px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.sso { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sso .btn { height: 46px; }

.link-back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 600; margin-bottom: 22px; }
.link-back:hover { color: var(--ink); }
.link-back svg { width: 16px; height: 16px; }
.otp-badge {
  width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; margin-bottom: 20px;
  color: #fff; background: linear-gradient(135deg, var(--brand-2), var(--brand)); position: relative;
  box-shadow: 0 14px 30px -10px rgba(211, 18, 42, .6);
}
.otp-badge svg { width: 26px; height: 26px; }
.otp-badge::after { content: ""; position: absolute; inset: -6px; border-radius: 22px; border: 2px solid var(--brand); opacity: 0; animation: ripple 2.2s var(--ease) infinite; }
.otp { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.otp input {
  width: 100%; min-width: 0; height: 62px; text-align: center; font-size: 26px; font-weight: 700;
  border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface-2); outline: 0;
  font-variant-numeric: tabular-nums; caret-color: var(--brand);
  transition: border-color .2s, box-shadow .2s, transform .25s var(--spring), background .2s;
}
.otp input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--ring); background: var(--surface); }
.otp input.filled { border-color: var(--ink); background: var(--surface); animation: pop .3s var(--spring); }
.otp.is-ok input { border-color: var(--green); color: var(--green); box-shadow: 0 0 0 4px rgba(24, 169, 87, .15); }
.otp.shake { animation: shake .4s; }
.otp-sep { width: 14px; height: 2px; background: var(--line); flex: none; border-radius: 2px; }
.otp-hint { font-size: 12.5px; color: var(--muted); margin-bottom: 24px; display: flex; gap: 6px; align-items: center; }
.otp-hint::before { content: "i"; width: 16px; height: 16px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; font-size: 10px; font-weight: 700; font-style: italic; }
.resend { text-align: center; color: var(--muted); font-size: 13px; margin-top: 18px; }
.resend button { color: var(--brand); font-weight: 600; }
.resend button:disabled { color: var(--muted); cursor: default; }
.spinner { display: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; animation: spin .7s linear infinite; }
.btn.loading span { opacity: .7; }
.btn.loading .spinner { display: block; }

.step-ok { text-align: center; padding-top: 30px; }
.ok-check { width: 96px; height: 96px; margin: 0 auto 26px; display: block; stroke-width: 3; }
.ok-check circle { stroke: var(--green); stroke-dasharray: 152; stroke-dashoffset: 152; animation: draw .7s var(--ease) forwards; fill: rgba(24, 169, 87, .08); }
.ok-check path { stroke: var(--green); stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .45s var(--ease) .55s forwards; }
.loader-bar { height: 4px; background: var(--line); border-radius: 4px; overflow: hidden; max-width: 240px; margin: 0 auto; }
.loader-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand-2), var(--brand)); border-radius: 4px; animation: load 1.5s var(--ease) forwards; }
.login-foot { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; margin-top: 36px; }
.login-foot svg { width: 15px; height: 15px; color: var(--green); }

/* ═══════════ Transición de entrada ═══════════ */
.warp {
  position: fixed; inset: 0; z-index: 100; background: #fff; display: grid; place-items: center;
  clip-path: circle(0 at var(--x, 75%) var(--y, 70%)); pointer-events: none; visibility: hidden;
}
.warp img { width: min(380px, 70vw); opacity: 0; transform: scale(.85); }
.warp.on { visibility: visible; animation: warpIn .9s cubic-bezier(.7, 0, .2, 1) forwards; }
.warp.on img { animation: logoIn .9s var(--ease) .35s forwards; }
.warp.out { animation: warpOut .8s var(--ease) forwards; visibility: visible; clip-path: circle(150% at 50% 50%); }
.warp.out img { opacity: 1; animation: logoOut .7s var(--ease) forwards; }

/* ═══════════ APP ═══════════ */
.app { display: grid; grid-template-columns: 272px 1fr; min-height: 100dvh; }

/* Sidebar */
.sidebar {
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 10px;
  padding: 22px 16px 16px; background: var(--surface); border-right: 1px solid var(--line); z-index: 40;
}
.sb-head { padding: 4px 10px 18px; display: flex; align-items: center; }
.sb-logo { width: 196px; height: auto; filter: var(--logo-filter); }
.sb-mark { display: none; }
.sb-nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; scrollbar-width: none; }
.sb-group { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; padding: 16px 12px 8px; }
.sb-nav a {
  display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 12px; border-radius: 12px;
  color: var(--ink-2); font-weight: 520; position: relative; transition: background .2s, color .2s;
}
.sb-nav a svg { width: 19px; height: 19px; color: var(--muted); transition: color .2s, transform .3s var(--spring); }
.sb-nav a:hover { background: var(--surface-2); color: var(--ink); }
.sb-nav a:hover svg { transform: scale(1.12); color: var(--ink); }
.sb-nav a.is-active { background: linear-gradient(90deg, rgba(211,18,42,.1), rgba(211,18,42,.02)); color: var(--brand); font-weight: 650; }
.sb-nav a.is-active svg { color: var(--brand); }
.sb-nav a.is-active::before { content: ""; position: absolute; left: -16px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--brand); }
.sb-nav a em { margin-left: auto; font-style: normal; font-size: 11.5px; font-weight: 650; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
.sb-nav a em.hot { background: var(--brand); border-color: var(--brand); color: #fff; }
.sb-promo {
  position: relative; overflow: hidden; border-radius: 18px; padding: 18px; color: #fff;
  background: radial-gradient(120% 120% at 100% 0%, #3A1FB8 0%, transparent 55%), linear-gradient(160deg, #1A2140, #0E1424);
}
.sb-promo::after { content: ""; position: absolute; width: 140px; height: 140px; right: -50px; bottom: -60px; border-radius: 50%; background: var(--brand); filter: blur(50px); opacity: .55; }
.sb-promo-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.12); margin-bottom: 12px; }
.sb-promo strong { display: block; font-size: 14.5px; }
.sb-promo p { font-size: 12.5px; color: rgba(255,255,255,.65); margin: 4px 0 14px; position: relative; z-index: 1; }
.sb-promo .btn { position: relative; z-index: 1; }
.sb-user { display: flex; align-items: center; gap: 10px; padding: 10px 8px 2px; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 14px; }
.sb-user strong { display: block; font-size: 13.5px; }
.sb-user small { color: var(--muted); font-size: 12px; }
.sb-user .icon-btn { margin-left: auto; width: 34px; height: 34px; border: 0; }

.avatar {
  --h: 220; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none;
  font-size: 13px; font-weight: 700; color: hsl(var(--h) 70% 35%);
  background: linear-gradient(135deg, hsl(var(--h) 90% 92%), hsl(var(--h) 80% 84%));
}
:root[data-theme="dark"] .avatar { color: hsl(var(--h) 90% 82%); background: linear-gradient(135deg, hsl(var(--h) 45% 26%), hsl(var(--h) 45% 18%)); }
.avatar.sm { width: 30px; height: 30px; border-radius: 10px; font-size: 11px; }

.scrim { position: fixed; inset: 0; background: rgba(9,12,21,.4); backdrop-filter: blur(3px); z-index: 35; opacity: 0; pointer-events: none; transition: opacity .3s; }

/* Main */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 18px;
  padding: 18px clamp(16px, 3vw, 36px); background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(16px) saturate(160%); border-bottom: 1px solid transparent; transition: border-color .3s;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.greet { min-width: 0; }
.greet h1 { font-size: 22px; letter-spacing: -.025em; font-weight: 720; white-space: nowrap; }
.greet p { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.greet p b { color: var(--ink-2); }
.greet p span::first-letter { text-transform: uppercase; }
.wave { display: inline-block; transform-origin: 70% 70%; animation: wave 2.4s ease-in-out 1s 2; }
.search {
  margin-left: auto; display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 10px 0 14px;
  width: min(380px, 32vw); border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--muted);
  transition: border-color .2s, box-shadow .2s;
}
.search:hover { border-color: #C9CEDA; box-shadow: var(--shadow); }
.search span { flex: 1; text-align: left; font-size: 13.5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
kbd { font: 600 11px/1 inherit; padding: 5px 7px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); font-family: inherit; }
.tb-actions { display: flex; align-items: center; gap: 10px; }
.t-sun { display: none; }
:root[data-theme="dark"] .t-sun { display: block; }
:root[data-theme="dark"] .t-moon { display: none; }
.only-mobile { display: none; }

.content { padding: 8px clamp(16px, 3vw, 36px) 32px; display: flex; flex-direction: column; gap: 20px; }

/* Cards */
.card {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow); overflow: hidden; isolation: isolate;
  transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .3s, background .4s;
}
.card::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .4s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(211, 18, 42, .07), transparent 45%);
}
.card:hover::before { opacity: 1; }
.card:hover { box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--line) 50%, var(--brand) 12%); }
.card-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.card-h h2 { font-size: 16px; letter-spacing: -.015em; font-weight: 680; }
.card-h p { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.link { color: var(--brand); font-weight: 600; font-size: 13px; white-space: nowrap; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Entrada escalonada */
.reveal { opacity: 0; }
.app.is-in .reveal { animation: cardIn .9s var(--ease) both; animation-delay: calc(var(--i, 0) * 75ms + 150ms); }
.app.is-in .sidebar { animation: slideIn .8s var(--ease) both; }
.app.is-in .topbar { animation: fadeDown .8s var(--ease) .1s both; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.kpi { padding: 20px 22px 0; display: flex; flex-direction: column; transform-style: preserve-3d; will-change: transform; }
.kpi-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.kpi-ico { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; }
.kpi-ico svg { width: 20px; height: 20px; }
.t-blue { background: rgba(59, 107, 255, .1); color: var(--blue); }
.t-teal { background: rgba(16, 179, 163, .1); color: var(--teal); }
.t-amber { background: rgba(242, 165, 22, .12); color: #D18C00; }
.kpi-label { color: var(--muted); font-size: 13px; font-weight: 520; }
.kpi-value { font-size: 34px; font-weight: 760; letter-spacing: -.035em; font-variant-numeric: tabular-nums; line-height: 1.15; margin-top: 2px; }
.spark { width: calc(100% + 44px); height: 54px; margin: 10px -22px 0; display: block; overflow: visible; }
.spark path.l { fill: none; stroke: var(--brand); stroke-width: 2.2; vector-effect: non-scaling-stroke; }
.spark path.a { stroke: none; }
.spark.c-blue path.l { stroke: var(--blue); } .spark.c-teal path.l { stroke: var(--teal); } .spark.c-amber path.l { stroke: var(--amber); }
.spark g { clip-path: inset(0 100% 0 0); }
.app.is-in .spark g { animation: reveal 1.6s var(--ease) .7s forwards; }

.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px; border-radius: 99px; font-size: 12px; font-weight: 650; }
.chip svg { width: 13px; height: 13px; stroke-width: 2.4; }
.chip-up { background: rgba(24, 169, 87, .1); color: var(--green); }
.chip-warn { background: rgba(242, 165, 22, .14); color: #C27F00; }
.chip-glass { background: rgba(255,255,255,.16); color: #fff; backdrop-filter: blur(6px); }

.kpi-hero {
  color: #fff; border: 0;
  background: radial-gradient(140% 120% at 100% 0%, #FF5A4F 0%, transparent 50%), linear-gradient(145deg, #E2182F, #9E0B1C 60%, #6A0010);
  box-shadow: 0 24px 50px -22px rgba(211, 18, 42, .75);
}
.kpi-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: repeating-linear-gradient(120deg, rgba(255,255,255,.05) 0 2px, transparent 2px 14px); mask-image: linear-gradient(200deg, #000, transparent 60%); }
.kpi-hero .kpi-ico { background: rgba(255,255,255,.16); }
.kpi-hero .kpi-label { color: rgba(255,255,255,.75); }
.kpi-hero .spark path.l { stroke: #fff; }
.kpi-hero::before { background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,.18), transparent 45%); }

/* Rows */
.row { display: grid; gap: 20px; }
.r-chart { grid-template-columns: 1.85fr 1fr; }
.r-cal { grid-template-columns: 1.05fr 1fr 1fr; }
.r-table { grid-template-columns: 1.9fr 1fr; }
.r-bottom { grid-template-columns: 1fr 1.25fr; }

/* Segmented */
.seg { display: inline-flex; padding: 4px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.seg button { padding: 6px 12px; border-radius: 9px; font-size: 12.5px; font-weight: 600; color: var(--muted); transition: all .25s var(--ease); }
.seg button.is-on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(16,24,40,.12); }

/* Area chart */
.legend { display: flex; align-items: center; gap: 18px; font-size: 12.5px; color: var(--muted); margin-bottom: 8px; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.lg-brand { background: var(--brand); } .lg-ink { background: var(--ink-2); opacity: .35; }
.legend-total { margin-left: auto; font-weight: 500; }
.legend-total b { color: var(--green); font-size: 14px; }
.chart { position: relative; height: 290px; padding: 6px 0 26px 44px; }
.chart svg.plot { position: absolute; left: 44px; right: 0; top: 6px; bottom: 26px; width: calc(100% - 44px); height: calc(100% - 32px); overflow: visible; }
.plot g.series { clip-path: inset(0 100% 0 0); }
.app.is-in .plot g.series { animation: reveal 2s var(--ease) .5s forwards; }
.plot .line-a { stroke: var(--brand); stroke-width: 3; vector-effect: non-scaling-stroke; fill: none; filter: drop-shadow(0 6px 10px rgba(211,18,42,.35)); }
.plot .line-b { stroke: var(--ink-2); stroke-opacity: .45; stroke-width: 2; stroke-dasharray: 6 6; vector-effect: non-scaling-stroke; fill: none; }
.ygrid { position: absolute; left: 0; right: 0; top: 6px; bottom: 26px; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.ygrid div { position: relative; border-top: 1px dashed var(--line); height: 0; }
.ygrid span { position: absolute; left: 0; top: -9px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ygrid div { margin-left: 44px; } .ygrid span { left: -44px; }
.xlabels { position: absolute; left: 44px; right: 0; bottom: 0; display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.xlabels span { width: 0; display: flex; justify-content: center; white-space: nowrap; }
.cursor { position: absolute; top: 6px; bottom: 26px; width: 1px; background: linear-gradient(transparent, var(--brand) 20%, var(--brand) 80%, transparent); opacity: 0; transition: opacity .2s, left .15s var(--ease); pointer-events: none; }
.dot { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--surface); border: 3px solid var(--brand); box-shadow: 0 0 0 6px rgba(211,18,42,.15); opacity: 0; transition: opacity .2s, left .15s var(--ease), top .15s var(--ease); pointer-events: none; }
.dot.b { border-color: var(--ink-2); box-shadow: none; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-width: 2px; }
.tip {
  position: absolute; top: 0; padding: 10px 12px; border-radius: 12px; background: var(--navy); color: #fff; font-size: 12px;
  box-shadow: 0 14px 30px -10px rgba(0,0,0,.45); opacity: 0; transform: translateY(6px); pointer-events: none; min-width: 150px;
  transition: opacity .2s, transform .2s var(--ease), left .15s var(--ease);
}
:root[data-theme="dark"] .tip { background: #232B44; }
.tip b { display: block; font-size: 12px; color: rgba(255,255,255,.6); font-weight: 600; margin-bottom: 4px; }
.tip p { display: flex; justify-content: space-between; gap: 14px; }
.tip p i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.chart.hover .cursor, .chart.hover .dot, .chart.hover .tip { opacity: 1; transform: none; }

/* Donut */
.donut-wrap { position: relative; width: 210px; height: 210px; margin: 0 auto 18px; }
.donut-wrap svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.donut-wrap circle { fill: none; stroke-width: 22; transition: stroke-dasharray 1.4s var(--ease), stroke-width .3s var(--ease), opacity .3s; cursor: pointer; }
.donut-wrap circle.track { stroke: var(--surface-2); cursor: default; }
.donut-wrap circle:not(.track):hover { stroke-width: 28; }
.donut-wrap.dim circle:not(.track):not(:hover) { opacity: .35; }
.donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.donut-center strong { font-size: 32px; letter-spacing: -.03em; font-weight: 760; font-variant-numeric: tabular-nums; }
.donut-center span { font-size: 12px; color: var(--muted); }
.donut-legend { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 9px; }
.donut-legend li { display: grid; grid-template-columns: 10px 1fr auto auto; gap: 10px; align-items: center; font-size: 13px; }
.donut-legend i { width: 10px; height: 10px; border-radius: 3px; }
.donut-legend b { font-variant-numeric: tabular-nums; font-weight: 650; }
.donut-legend em { font-style: normal; color: var(--muted); font-size: 12px; width: 36px; text-align: right; }

/* Calendario */
.cal-nav { display: flex; gap: 6px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal .dow { font-size: 11px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding-bottom: 6px; }
.cal .d {
  position: relative; aspect-ratio: 1 / .92; border-radius: 12px; display: grid; place-items: center; font-size: 13px; font-weight: 550;
  font-variant-numeric: tabular-nums; transition: background .2s, transform .25s var(--spring); cursor: pointer;
}
.cal .d:hover { background: var(--surface-2); transform: scale(1.08); }
.cal .d.out { color: var(--muted); opacity: .45; }
.cal .d.we { color: var(--muted); }
.cal .d.today { color: #fff; background: linear-gradient(135deg, var(--brand-2), var(--brand)); box-shadow: 0 8px 18px -6px rgba(211,18,42,.6); font-weight: 750; }
.cal .d.today::after { content: ""; position: absolute; inset: -4px; border-radius: 15px; border: 2px solid var(--brand); opacity: .35; animation: ripple 2.4s var(--ease) infinite; }
.cal .dots { position: absolute; bottom: 5px; left: 0; right: 0; display: flex; justify-content: center; gap: 3px; }
.cal .dots i { width: 5px; height: 5px; border-radius: 50%; }
.cal .today .dots i { background: #fff !important; }
.cal-key { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 14px; font-size: 12px; color: var(--muted); }
.cal-key span { display: inline-flex; align-items: center; gap: 6px; }
.cal-key i { width: 8px; height: 8px; border-radius: 50%; }
.ev-vista { background: var(--brand); } .ev-plazo { background: var(--amber); } .ev-reunion { background: var(--blue); } .ev-firma { background: var(--teal); }

/* Agenda */
.agenda { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.agenda li {
  display: grid; grid-template-columns: 54px 1fr; gap: 12px; padding: 12px; border-radius: 14px; background: var(--surface-2);
  border: 1px solid transparent; position: relative; transition: border-color .2s, transform .3s var(--ease);
}
.agenda li:hover { border-color: var(--line); transform: translateX(4px); }
.agenda .when { text-align: center; border-right: 1px solid var(--line); padding-right: 10px; }
.agenda .when b { display: block; font-size: 15px; font-variant-numeric: tabular-nums; }
.agenda .when small { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.agenda h3 { font-size: 13.5px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.agenda h3 i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.agenda p { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 5px; margin-top: 3px; }
.agenda p svg { width: 13px; height: 13px; }
.tag { margin-left: auto; white-space: nowrap; font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 6px; text-transform: uppercase; letter-spacing: .04em; }
.tag.now { background: var(--brand); color: #fff; animation: pulse 2s infinite; }

/* Embudo */
.funnel { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.funnel li { display: grid; gap: 7px; }
.funnel .fl { display: flex; justify-content: space-between; font-size: 13px; }
.funnel .fl span { color: var(--ink-2); font-weight: 550; }
.funnel .fl b { font-variant-numeric: tabular-nums; }
.funnel .fl em { font-style: normal; color: var(--muted); font-weight: 500; font-size: 12px; margin-left: 6px; }
.bar { height: 10px; border-radius: 10px; background: var(--surface-2); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: 10px; transition: width 1.4s var(--ease); background: var(--c, var(--brand)); position: relative; overflow: hidden; }
.bar i::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent); transform: translateX(-100%); animation: sheen 2.8s ease-in-out 2s infinite; }

/* Tabla */
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-btn { padding: 6px 12px; border-radius: 99px; font-size: 12.5px; font-weight: 600; color: var(--muted); border: 1px solid var(--line); transition: all .2s; }
.chip-btn:hover { color: var(--ink); }
.chip-btn.is-on { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.table-wrap { overflow-x: auto; margin: 0 -22px -22px; }
.table { width: 100%; border-collapse: collapse; min-width: 720px; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 650; padding: 10px 14px; background: var(--surface-2); border-block: 1px solid var(--line); }
.table th:first-child, .table td:first-child { padding-left: 22px; }
.table th:last-child, .table td:last-child { padding-right: 22px; }
.table td { padding: 13px 14px; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: middle; white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .2s; cursor: pointer; }
.table tbody tr:hover { background: var(--surface-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; }
.ref { font-weight: 650; font-variant-numeric: tabular-nums; }
.ref small { display: block; color: var(--muted); font-weight: 500; font-size: 11.5px; }
.who { display: flex; align-items: center; gap: 10px; }
.who b { font-weight: 600; display: block; }
.who small { color: var(--muted); font-size: 11.5px; }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 650; white-space: nowrap; background: color-mix(in srgb, var(--c) 12%, transparent); color: var(--c); }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.prog { display: flex; align-items: center; gap: 10px; min-width: 120px; }
.prog .bar { flex: 1; height: 6px; }
.prog small { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; width: 32px; text-align: right; }

/* Feed */
.live { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); margin-right: 7px; box-shadow: 0 0 0 0 rgba(24,169,87,.6); animation: livePulse 1.8s infinite; vertical-align: 1px; }
.feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; position: relative; }
.feed::before { content: ""; position: absolute; left: 17px; top: 10px; bottom: 10px; width: 2px; background: linear-gradient(var(--line), transparent); }
.feed li { display: grid; grid-template-columns: 36px 1fr; gap: 12px; padding: 9px 0; position: relative; }
.feed li.new { animation: feedIn .7s var(--spring) both; }
.feed .fi2 { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--c); z-index: 1; }
.feed .fi2 svg { width: 16px; height: 16px; }
.feed p { font-size: 13px; line-height: 1.4; }
.feed p b { font-weight: 650; }
.feed small { color: var(--muted); font-size: 11.5px; }

/* Clientes */
.clients { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.clients li { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px; border-radius: 14px; transition: background .2s; }
.clients li:hover { background: var(--surface-2); }
.clients b { display: block; font-size: 13.5px; font-weight: 640; }
.clients small { color: var(--muted); font-size: 12px; }
.clients .amt { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.clients .amt small { display: block; font-weight: 500; }

/* Copiloto */
.copilot {
  color: #fff; border: 0; display: flex; flex-direction: column;
  background: radial-gradient(120% 140% at 0% 0%, #2B1A86 0%, transparent 50%), radial-gradient(100% 120% at 100% 100%, #7A0B1B 0%, transparent 55%), #0E1424;
}
.copilot::before { background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,.08), transparent 45%); }
.copilot-glow { position: absolute; inset: -1px; z-index: -1; border-radius: inherit; padding: 1px; background: conic-gradient(from var(--a, 0deg), transparent 0 70%, #FF4B5C 80%, #7A5CFF 90%, transparent); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: spinBorder 5s linear infinite; }
.copilot-h { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; }
.copilot-h h2 { font-size: 16px; font-weight: 680; }
.copilot-h p { font-size: 12.5px; color: rgba(255,255,255,.6); }
.copilot-ico { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: linear-gradient(135deg, #FF4B5C, #7A5CFF); box-shadow: 0 10px 24px -8px rgba(122,92,255,.7); }
.copilot-ico svg { animation: twinkle 3s ease-in-out infinite; }
.copilot-text { font-size: 14.5px; line-height: 1.65; color: rgba(255,255,255,.88); min-height: 96px; flex: 1; }
.copilot-text b { color: #fff; }
.copilot-text .caret { display: inline-block; width: 2px; height: 1.1em; background: #FF4B5C; vertical-align: -3px; margin-left: 2px; animation: blink 1s steps(1) infinite; }
.copilot-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0; }
.copilot-chips button { padding: 7px 12px; border-radius: 99px; font-size: 12.5px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); color: rgba(255,255,255,.85); transition: background .2s, transform .2s var(--ease); }
.copilot-chips button:hover { background: rgba(255,255,255,.16); transform: translateY(-1px); }
.copilot-input { display: flex; gap: 8px; align-items: center; padding: 6px 6px 6px 16px; border-radius: 14px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14); }
.copilot-input input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: #fff; font-size: 13.5px; }
.copilot-input input::placeholder { color: rgba(255,255,255,.45); }
.copilot-input .icon-btn { background: linear-gradient(135deg, #FF4B5C, #D3122A); color: #fff; border: 0; width: 36px; height: 36px; }

.foot { text-align: center; color: var(--muted); font-size: 12px; padding-top: 8px; }

/* Paleta de comandos */
.cmdk { position: fixed; inset: 0; z-index: 90; background: rgba(9, 12, 21, .45); backdrop-filter: blur(6px); display: grid; justify-items: center; align-items: start; padding: 12vh 16px 16px; animation: fadeIn .2s ease both; }
.cmdk-box { width: min(640px, 100%); border-radius: 20px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 40px 100px -30px rgba(0,0,0,.55); overflow: hidden; animation: popIn .35s var(--spring) both; }
.cmdk-in { display: flex; align-items: center; gap: 12px; padding: 0 18px; height: 60px; border-bottom: 1px solid var(--line); color: var(--muted); }
.cmdk-in input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 16px; color: var(--ink); }
.cmdk-list { list-style: none; margin: 0; padding: 8px; max-height: 50vh; overflow-y: auto; }
.cmdk-list .grp { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 650; padding: 10px 12px 6px; }
.cmdk-list .it { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; cursor: pointer; font-size: 13.5px; }
.cmdk-list .it small { margin-left: auto; color: var(--muted); font-size: 12px; }
.cmdk-list .it svg { color: var(--muted); }
.cmdk-list .it.sel { background: var(--surface-2); }
.cmdk-list .it.sel svg { color: var(--brand); }

/* Toasts */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 80; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; pointer-events: none; }
.toast {
  display: flex; gap: 12px; align-items: center; padding: 12px 16px 12px 12px; border-radius: 16px; max-width: 360px;
  background: var(--navy); color: #fff; box-shadow: 0 20px 40px -14px rgba(0,0,0,.5); pointer-events: auto;
  animation: toastIn .5s var(--spring) both;
}
:root[data-theme="dark"] .toast { background: #232B44; }
.toast.out { animation: toastOut .4s var(--ease) forwards; }
.toast .ti { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.1); color: #5CF0A2; }
.toast b { display: block; font-size: 13px; }
.toast small { color: rgba(255,255,255,.6); font-size: 12px; }

/* ═══════════ Keyframes ═══════════ */
@keyframes rise { from { opacity: 0; transform: translateY(24px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes stepIn { from { opacity: 0; transform: translateX(26px); } to { opacity: 1; transform: none; } }
@keyframes drift { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(80px, 60px) scale(1.15); } 100% { transform: translate(-40px, 120px) scale(.95); } }
@keyframes floaty { 0%, 100% { translate: 0 0; } 50% { translate: 0 -14px; } }
@keyframes shine { to { background-position: -200% 0; } }
@keyframes grow { from { transform: scaleY(0); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@keyframes ripple { 0% { opacity: .6; transform: scale(.9); } 100% { opacity: 0; transform: scale(1.35); } }
@keyframes pop { 0% { transform: scale(.85); } 100% { transform: scale(1); } }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes load { to { width: 100%; } }
@keyframes loginOut { to { opacity: 0; transform: scale(.96); filter: blur(8px); } }
@keyframes warpIn { from { clip-path: circle(0 at var(--x) var(--y)); } to { clip-path: circle(150% at var(--x) var(--y)); } }
@keyframes logoIn { to { opacity: 1; transform: scale(1); } }
@keyframes warpOut { 0% { clip-path: circle(150% at 50% 50%); } 100% { clip-path: circle(0 at 50% 50%); } }
@keyframes logoOut { to { opacity: 0; transform: scale(1.6); filter: blur(10px); } }
@keyframes cardIn { from { opacity: 0; transform: translateY(40px) scale(.96) rotateX(8deg); filter: blur(10px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes slideIn { from { transform: translateX(-100%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fadeDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: translateY(-14px) scale(.96); } }
@keyframes reveal { to { clip-path: inset(0 0 0 0); } }
@keyframes wave { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(16deg); } 20%, 40% { transform: rotate(-8deg); } }
@keyframes sheen { 0% { transform: translateX(-100%); } 60%, 100% { transform: translateX(100%); } }
@keyframes livePulse { 70% { box-shadow: 0 0 0 8px rgba(24,169,87,0); } 100% { box-shadow: 0 0 0 0 rgba(24,169,87,0); } }
@keyframes feedIn { from { opacity: 0; transform: translateY(-14px) scale(.96); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(20px) scale(.9); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(40px); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes twinkle { 0%, 100% { transform: scale(1) rotate(0); } 50% { transform: scale(1.15) rotate(12deg); } }
@property --a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes spinBorder { to { --a: 360deg; } }

/* ═══════════ Responsive ═══════════ */
@media (max-width: 1560px) {
  .r-table { grid-template-columns: 1fr; }
  .feed { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); column-gap: 24px; }
  .feed::before { display: none; }
}
@media (max-width: 1380px) {
  .r-cal { grid-template-columns: 1fr 1fr; }
  .funnel-card { grid-column: 1 / -1; }
  .funnel { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px 28px; }
}
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .r-chart, .r-table, .r-bottom { grid-template-columns: 1fr; }
  .search { width: auto; flex: 1; max-width: 360px; }
  .search kbd { display: none; }
}
@media (max-width: 1000px) {
  .login { grid-template-columns: 1fr; }
  .login-hero { display: none; }
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: 280px; transform: translateX(-105%); transition: transform .45s var(--ease); box-shadow: var(--shadow-lg); }
  .app.is-in .sidebar { animation: none; }
  .sidebar.open { transform: none; }
  .sidebar.open + .scrim { opacity: 1; pointer-events: auto; }
  .only-mobile { display: grid; }
  .search { display: none; }
  .greet { flex: 1; }
  .tb-actions .btn span { display: none; }
  .tb-actions .btn { width: 40px; padding: 0; }
}
@media (max-width: 720px) {
  .r-cal { grid-template-columns: 1fr; }
  .greet h1 { font-size: 17px; overflow: hidden; text-overflow: ellipsis; }
  .greet h1 .wave { display: none; }
  .greet p { display: none; }
  .topbar { gap: 10px; }
  .tb-actions { gap: 6px; }
  #theme { display: none; }
  .kpi-value { font-size: 28px; }
  .card { padding: 18px; }
  .table-wrap { margin: 0 -18px -18px; }
  .spark { width: calc(100% + 36px); margin: 10px -18px 0; }
  .card-h { flex-wrap: wrap; }
  .legend-total { margin-left: 0; width: 100%; }
  .otp { gap: 6px; } .otp input { height: 54px; font-size: 22px; } .otp-sep { width: 6px; }
}
@media (max-width: 480px) {
  .kpis { grid-template-columns: 1fr; }
  .sso { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; }
}
