/* ════════════════════════════════════════════════════
   ADFLOW AI — Estilos principales · LIQUID MODE
   Archivo: css/style.css
════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── TOKENS ─────────────────────────────────────── */
:root {
  --bg:  #05070D;
  --bg2: #0C1018;
  --bg3: #111827;
  --bg4: #1a2236;

  /* Superficies liquid glass */
  --gl:   rgba(255,255,255,.045);          /* vidrio base       */
  --gl2:  rgba(255,255,255,.08);           /* vidrio elevado    */
  --glb:  rgba(255,255,255,.11);           /* borde de vidrio   */
  --spec: inset 0 1px 0 rgba(255,255,255,.14),
          inset 0 -1px 0 rgba(255,255,255,.03); /* brillo especular */
  --blur: blur(22px) saturate(170%);
  --blur-heavy: blur(34px) saturate(190%);

  --b:   rgba(255,255,255,.08);
  --b2:  rgba(0,230,180,.30);
  --g:   #00E6B4;
  --gd:  rgba(0,230,180,.10);
  --gg:  rgba(0,230,180,.24);
  --p:   #7C6FFF;
  --pk:  #FF4D8D;
  --y:   #FFB800;
  --r:   #FF4D4D;
  --t1:  #F0F4FF;
  --t2:  #93A3C4;
  --t3:  #52607A;
  --sb:  248px;
  --tb:  62px;
  --f:   'Montserrat', sans-serif;
  --fm:  'JetBrains Mono', monospace;
  --r8:  12px;
  --r12: 18px;
}

/* ── RESET ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--f);
  background: var(--bg);
  color: var(--t1);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: var(--f); }
input, select, textarea { font-family: var(--f); }
canvas { display: block; max-width: 100%; }

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 99px; }

/* ── LIQUID BACKGROUND ──────────────────────────── */
.liquid-bg {
  position: fixed; inset: 0; z-index: -1;
  overflow: hidden; pointer-events: none;
  background:
    radial-gradient(ellipse 80% 60% at 70% -10%, rgba(124,111,255,.10), transparent 60%),
    var(--bg);
}
.lb {
  position: absolute; border-radius: 50%;
  filter: blur(90px); opacity: .5;
  will-change: transform;
}
.lb1 {
  width: 640px; height: 640px; top: -220px; right: -160px;
  background: radial-gradient(circle, rgba(0,230,180,.22), transparent 65%);
  animation: drift1 26s ease-in-out infinite alternate;
}
.lb2 {
  width: 560px; height: 560px; bottom: -200px; left: -140px;
  background: radial-gradient(circle, rgba(124,111,255,.20), transparent 65%);
  animation: drift2 32s ease-in-out infinite alternate;
}
.lb3 {
  width: 420px; height: 420px; top: 40%; left: 55%;
  background: radial-gradient(circle, rgba(255,77,141,.10), transparent 65%);
  animation: drift3 38s ease-in-out infinite alternate;
}
@keyframes drift1 { to { transform: translate(-120px, 90px)  scale(1.15); } }
@keyframes drift2 { to { transform: translate(110px, -80px)  scale(1.1);  } }
@keyframes drift3 { to { transform: translate(-90px, -120px) scale(1.2);  } }

@media (prefers-reduced-motion: reduce) {
  .lb { animation: none; }
}

/* ── SCREENS ────────────────────────────────────── */
.screen { display: none; }
.screen.active { display: block; }

/* ════════════════════════════════════════════════════
   AUTH
════════════════════════════════════════════════════ */
#auth-screen {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  position: relative; overflow: hidden;
}

.auth-bg-1 {
  position: fixed; top: -200px; right: -200px;
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(0,230,180,.09) 0%, transparent 65%);
  pointer-events: none; border-radius: 50%;
  filter: blur(40px);
}
.auth-bg-2 {
  position: fixed; bottom: -200px; left: -100px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(124,111,255,.08) 0%, transparent 65%);
  pointer-events: none; border-radius: 50%;
  filter: blur(40px);
}

.auth-card {
  width: 100%; max-width: 448px;
  background: var(--gl2);
  backdrop-filter: var(--blur-heavy);
  -webkit-backdrop-filter: var(--blur-heavy);
  border: 1px solid var(--glb);
  border-radius: 26px;
  padding: 42px;
  box-shadow: var(--spec), 0 28px 80px rgba(0,0,0,.55);
  position: relative; z-index: 1;
  animation: slideUp .45s ease;
}

.auth-logo {
  display: flex; align-items: center; gap: 11px;
  justify-content: center; margin-bottom: 34px;
}
.auth-logo-icon {
  width: 42px; height: 42px; border-radius: 13px;
  background: linear-gradient(135deg, var(--g), var(--p));
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 0 26px var(--gg);
}
.auth-logo-text { font-size: 24px; font-weight: 900; letter-spacing: -.6px; }
.auth-logo-text em { color: var(--g); font-style: normal; }

.auth-title { font-size: 22px; font-weight: 800; text-align: center; letter-spacing: -.5px; margin-bottom: 6px; }
.auth-sub   { font-size: 13px; color: var(--t2); text-align: center; margin-bottom: 30px; line-height: 1.5; }

.auth-tabs {
  display: flex; gap: 4px;
  background: rgba(0,0,0,.25); border: 1px solid var(--b);
  border-radius: var(--r8); padding: 4px; margin-bottom: 26px;
  box-shadow: inset 0 1px 4px rgba(0,0,0,.3);
}
.auth-tab {
  flex: 1; padding: 9px; border-radius: 9px;
  background: transparent; border: none;
  color: var(--t2); font-size: 13px; font-weight: 600;
  transition: all .25s;
}
.auth-tab.on {
  background: var(--gl2); color: var(--g);
  border: 1px solid rgba(0,230,180,.25);
  box-shadow: var(--spec), 0 2px 10px rgba(0,0,0,.25);
}

.demo-badge {
  background: rgba(255,184,0,.08); border: 1px solid rgba(255,184,0,.22);
  color: var(--y); border-radius: var(--r8);
  padding: 10px 14px; font-size: 12px;
  margin-bottom: 20px; text-align: center; line-height: 1.5;
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}
.demo-badge strong { display: block; margin-bottom: 2px; }

.auth-err { background: rgba(255,77,77,.1); border: 1px solid rgba(255,77,77,.3); color: var(--r); border-radius: var(--r8); padding: 11px 14px; font-size: 13px; margin-bottom: 16px; display: none; }
.auth-ok  { background: rgba(0,230,180,.1);  border: 1px solid rgba(0,230,180,.3);  color: var(--g); border-radius: var(--r8); padding: 11px 14px; font-size: 13px; margin-bottom: 16px; display: none; }

.auth-foot { text-align: center; margin-top: 22px; font-size: 12px; color: var(--t3); }
.auth-foot a { color: var(--g); font-weight: 700; cursor: pointer; }

.pw-wrap { position: relative; }
.pw-wrap .fi { padding-right: 44px; }
.pw-eye {
  position: absolute; right: 13px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--t3); font-size: 16px;
  padding: 0; display: flex; align-items: center;
}
.pw-eye:hover { color: var(--t2); }

.auth-btn {
  width: 100%; padding: 13px;
  background: linear-gradient(180deg, #12ffc9, var(--g));
  color: var(--bg);
  border: none; border-radius: var(--r8);
  font-size: 14px; font-weight: 800;
  cursor: pointer; transition: all .25s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 6px 22px rgba(0,230,180,.28);
}
.auth-btn:hover { box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 10px 32px rgba(0,230,180,.4); transform: translateY(-1px); }
.auth-btn:disabled { opacity: .6; transform: none; cursor: not-allowed; }

/* ════════════════════════════════════════════════════
   APP LAYOUT
════════════════════════════════════════════════════ */
.layout { display: flex; min-height: 100vh; }

/* ── SIDEBAR ─────────────────────────────────────── */
.sidebar {
  width: var(--sb);
  background: rgba(10,13,20,.62);
  backdrop-filter: var(--blur-heavy);
  -webkit-backdrop-filter: var(--blur-heavy);
  border-right: 1px solid var(--glb);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0;
  height: 100vh; z-index: 60;
  overflow-y: auto; transition: transform .3s;
  box-shadow: inset -1px 0 0 rgba(255,255,255,.03);
}

.sb-logo { padding: 20px 16px; border-bottom: 1px solid var(--b); display: flex; align-items: center; gap: 10px; }
.sb-logo-icon { width: 34px; height: 34px; border-radius: 11px; background: linear-gradient(135deg, var(--g), var(--p)); display: flex; align-items: center; justify-content: center; font-size: 16px; box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 0 16px var(--gg); flex-shrink: 0; }
.sb-logo-text { font-size: 19px; font-weight: 900; letter-spacing: -.5px; }
.sb-logo-text em { color: var(--g); font-style: normal; }

.sb-nav { flex: 1; padding: 14px 10px; }
.sb-group { font-size: 9px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--t3); padding: 0 8px; margin: 14px 0 5px; font-family: var(--fm); }
.sb-group:first-child { margin-top: 0; }

.ni {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 10px; border-radius: var(--r8);
  font-size: 13px; font-weight: 500; color: var(--t2);
  cursor: pointer; transition: all .2s;
  margin-bottom: 2px; border: 1px solid transparent;
  position: relative; user-select: none;
}
.ni:hover { background: var(--gl); color: var(--t1); border-color: rgba(255,255,255,.06); }
.ni.on {
  background: linear-gradient(180deg, rgba(0,230,180,.14), rgba(0,230,180,.07));
  color: var(--g); border-color: rgba(0,230,180,.22);
  box-shadow: var(--spec);
}
.ni.on::before { content: ''; position: absolute; left: -10px; top: 50%; transform: translateY(-50%); width: 3px; height: 18px; background: var(--g); border-radius: 0 3px 3px 0; box-shadow: 0 0 8px var(--g); }
.ni-ico   { font-size: 15px; width: 20px; text-align: center; flex-shrink: 0; }
.ni-badge { margin-left: auto; font-size: 10px; font-weight: 700; font-family: var(--fm); background: var(--g); color: var(--bg); padding: 1px 6px; border-radius: 99px; box-shadow: 0 0 10px var(--gg); }

.sb-bottom { padding: 12px 10px; border-top: 1px solid var(--b); }
.credits-box { background: var(--gl); border: 1px solid var(--b2); border-radius: var(--r8); padding: 12px; margin-bottom: 10px; box-shadow: var(--spec); }
.credits-label { font-size: 11px; font-weight: 700; color: var(--g); margin-bottom: 7px; }
.prog-track { height: 4px; background: rgba(255,255,255,.07); border-radius: 99px; overflow: hidden; margin-bottom: 5px; }
.prog-fill  { height: 100%; background: linear-gradient(90deg, var(--g), #12ffc9); border-radius: 99px; box-shadow: 0 0 8px var(--gg); transition: width .8s; }
.credits-info { font-size: 10px; color: var(--t3); font-family: var(--fm); }

.user-row { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: var(--r8); cursor: pointer; transition: background .2s; }
.user-row:hover { background: var(--gl); }
.user-avatar { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, var(--p), var(--pk)); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; box-shadow: inset 0 1px 0 rgba(255,255,255,.3); }
.user-name { font-size: 12px; font-weight: 700; }
.user-plan { font-size: 10px; color: var(--g); font-family: var(--fm); }

/* ── TOPBAR ──────────────────────────────────────── */
.topbar {
  height: var(--tb); margin-left: var(--sb);
  border-bottom: 1px solid var(--glb);
  display: flex; align-items: center; padding: 0 26px; gap: 14px;
  position: sticky; top: 0; z-index: 40;
  background: rgba(5,7,13,.55);
  backdrop-filter: var(--blur-heavy);
  -webkit-backdrop-filter: var(--blur-heavy);
}
.topbar-title { font-size: 16px; font-weight: 800; letter-spacing: -.4px; }
.live-pill { display: flex; align-items: center; gap: 5px; background: rgba(0,230,180,.08); border: 1px solid var(--b2); border-radius: 99px; padding: 3px 10px; font-size: 10px; font-weight: 700; color: var(--g); font-family: var(--fm); box-shadow: var(--spec); }
.live-dot  { width: 6px; height: 6px; border-radius: 50%; background: var(--g); animation: pulse 2s infinite; box-shadow: 0 0 6px var(--g); }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--gl); border: 1px solid var(--glb);
  border-radius: 99px; padding: 7px 16px;
  transition: all .25s;
  box-shadow: var(--spec);
}
.search-box:focus-within { border-color: var(--b2); background: var(--gl2); box-shadow: var(--spec), 0 0 0 3px var(--gd); }
.search-box input { background: none; border: none; outline: none; color: var(--t1); font-size: 13px; width: 180px; font-family: var(--f); }
.search-box input::placeholder { color: var(--t3); }
.ic-btn {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--glb); background: var(--gl);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; cursor: pointer; transition: all .2s; position: relative;
  box-shadow: var(--spec);
}
.ic-btn:hover { border-color: var(--b2); background: var(--gl2); }
.notif-dot { position: absolute; top: 4px; right: 4px; width: 7px; height: 7px; border-radius: 50%; background: var(--pk); border: 1.5px solid var(--bg); box-shadow: 0 0 6px var(--pk); }

/* ── MAIN ─────────────────────────────────────────── */
.main-wrap { margin-left: var(--sb); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.content   { padding: 28px; flex: 1; }

/* ── PAGES ───────────────────────────────────────── */
.page    { display: none; animation: slideUp .3s ease; }
.page.on { display: block; }

/* ── PAGE HEADER ─────────────────────────────────── */
.ph         { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; gap: 14px; flex-wrap: wrap; }
.ph h1      { font-size: 20px; font-weight: 800; letter-spacing: -.5px; margin-bottom: 3px; }
.ph p       { font-size: 13px; color: var(--t2); }
.ph-actions { display: flex; gap: 10px; align-items: center; flex-shrink: 0; }

/* ── CARD ────────────────────────────────────────── */
.card {
  background: var(--gl);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glb);
  border-radius: var(--r12);
  overflow: hidden;
  box-shadow: var(--spec), 0 12px 40px rgba(0,0,0,.25);
}
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--b); }
.card-title{ font-size: 14px; font-weight: 700; }
.card-body { padding: 20px; }

/* ── STAT CARDS ──────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--gl);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glb);
  border-radius: var(--r12); padding: 20px;
  transition: all .3s; position: relative; overflow: hidden;
  box-shadow: var(--spec), 0 12px 40px rgba(0,0,0,.25);
}
.stat-card::before {
  content: ''; position: absolute; top: -60%; left: -20%;
  width: 140%; height: 120%;
  background: radial-gradient(ellipse at top, color-mix(in srgb, var(--sc, var(--g)) 10%, transparent), transparent 65%);
  opacity: 0; transition: opacity .35s; pointer-events: none;
}
.stat-card::after { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--sc, var(--g)); opacity: 0; transition: opacity .3s; }
.stat-card:hover { border-color: rgba(255,255,255,.2); transform: translateY(-3px); box-shadow: var(--spec), 0 20px 50px rgba(0,0,0,.35); }
.stat-card:hover::before,
.stat-card:hover::after { opacity: 1; }
.stat-top   { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.stat-label { font-size: 10px; font-weight: 700; color: var(--t2); letter-spacing: .5px; text-transform: uppercase; font-family: var(--fm); }
.stat-icon  { width: 32px; height: 32px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 14px; background: var(--gl2); box-shadow: var(--spec); }
.stat-value { font-size: 26px; font-weight: 800; letter-spacing: -1px; margin-bottom: 5px; }
.stat-diff  { font-size: 11px; font-family: var(--fm); display: flex; align-items: center; gap: 3px; }
.up  { color: var(--g); }
.dn  { color: var(--r); }
.neu { color: var(--t3); }

/* ── GRIDS ───────────────────────────────────────── */
.g2   { display: grid; grid-template-columns: 1fr 360px; gap: 20px; margin-bottom: 24px; }
.g3   { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; margin-bottom: 24px; }
.g2eq { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.fcol { display: flex; flex-direction: column; gap: 16px; }
.mb   { margin-bottom: 24px; }

/* ── BUTTONS ─────────────────────────────────────── */
.btn      { display: inline-flex; align-items: center; gap: 7px; padding: 10px 20px; border-radius: 99px; font-size: 13px; font-weight: 700; border: none; cursor: pointer; transition: all .25s; white-space: nowrap; font-family: var(--f); }
.btn-g    { background: linear-gradient(180deg, #12ffc9, var(--g)); color: var(--bg); box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 4px 18px rgba(0,230,180,.25); }
.btn-g:hover    { box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 8px 26px rgba(0,230,180,.4); transform: translateY(-1px); }
.btn-g:disabled { opacity: .6; transform: none; cursor: not-allowed; }
.btn-gh   { background: var(--gl); color: var(--t2); border: 1px solid var(--glb); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); box-shadow: var(--spec); }
.btn-gh:hover   { color: var(--t1); border-color: rgba(255,255,255,.22); background: var(--gl2); }
.btn-o    { background: transparent; color: var(--t1); border: 1px solid var(--glb); }
.btn-o:hover    { border-color: var(--b2); background: var(--gd); color: var(--g); }
.btn-d    { background: rgba(255,77,77,.1); color: var(--r); border: 1px solid rgba(255,77,77,.22); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
.btn-d:hover    { background: rgba(255,77,77,.18); }
.btn-sm   { padding: 7px 14px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; }

/* ── BADGES ──────────────────────────────────────── */
.badge       { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px; font-size: 11px; font-weight: 700; font-family: var(--fm); box-shadow: var(--spec); }
.badge::before { content: '●'; font-size: 7px; }
.b-g  { background: rgba(0,230,180,.12); color: var(--g); border: 1px solid rgba(0,230,180,.22); }
.b-y  { background: rgba(255,184,0,.1);  color: var(--y); border: 1px solid rgba(255,184,0,.22); }
.b-r  { background: rgba(255,77,77,.1);  color: var(--r); border: 1px solid rgba(255,77,77,.22); }
.b-p  { background: rgba(124,111,255,.12); color: var(--p); border: 1px solid rgba(124,111,255,.22); }
.b-gr { background: var(--gl); color: var(--t2); border: 1px solid var(--glb); }

/* ── FORMS ───────────────────────────────────────── */
.fg { margin-bottom: 16px; }
.fl { display: block; font-size: 12px; font-weight: 700; color: var(--t2); margin-bottom: 6px; }
.fi {
  width: 100%;
  background: rgba(0,0,0,.25);
  border: 1px solid var(--glb);
  border-radius: var(--r8); padding: 11px 14px;
  color: var(--t1); font-size: 13px; font-family: var(--f);
  outline: none; transition: all .25s;
  box-shadow: inset 0 1px 4px rgba(0,0,0,.25);
}
.fi:focus { border-color: var(--g); background: rgba(0,0,0,.35); box-shadow: inset 0 1px 4px rgba(0,0,0,.25), 0 0 0 3px var(--gd); }
.fi::placeholder { color: var(--t3); }
select.fi { appearance: none; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M1 4l5 5 5-5' stroke='%234A5568' fill='none' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 12px; padding-right: 36px; }
select.fi option { background: #1a2236; }
textarea.fi { resize: vertical; min-height: 78px; }
.frow { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }

/* ── TABLE ───────────────────────────────────────── */
.tw { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th  { font-size: 10px; font-weight: 700; color: var(--t3); text-align: left; padding: 10px 16px; border-bottom: 1px solid var(--b); letter-spacing: 1px; text-transform: uppercase; font-family: var(--fm); white-space: nowrap; }
td  { padding: 13px 16px; font-size: 13px; border-bottom: 1px solid var(--b); }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background .15s; cursor: pointer; }
tbody tr:hover { background: rgba(255,255,255,.03); }
.mono { font-family: var(--fm); font-weight: 600; }

/* ── TOGGLE ──────────────────────────────────────── */
.tgl       { position: relative; width: 38px; height: 22px; cursor: pointer; display: inline-block; }
.tgl input { opacity: 0; width: 0; height: 0; }
.tgl-track { position: absolute; inset: 0; background: rgba(0,0,0,.35); border: 1px solid var(--glb); border-radius: 99px; transition: all .25s; box-shadow: inset 0 1px 4px rgba(0,0,0,.3); }
.tgl-track::before { content: ''; position: absolute; left: 2px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; border-radius: 50%; background: linear-gradient(180deg, #fff, #cfd8ea); transition: all .25s; box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.tgl input:checked + .tgl-track { background: linear-gradient(180deg, rgba(0,230,180,.5), rgba(0,230,180,.3)); border-color: var(--g); }
.tgl input:checked + .tgl-track::before { left: calc(100% - 18px); background: linear-gradient(180deg, #fff, #b8fff0); box-shadow: 0 0 10px var(--gg); }

/* ── PROGRESS ────────────────────────────────────── */
.pr-row   { margin-bottom: 12px; }
.pr-head  { display: flex; justify-content: space-between; margin-bottom: 5px; font-size: 12px; }
.pr-label { color: var(--t2); font-weight: 500; display: flex; align-items: center; gap: 7px; }
.pr-val   { font-family: var(--fm); font-weight: 600; }
.pr-track { height: 5px; background: rgba(255,255,255,.07); border-radius: 99px; overflow: hidden; }
.pr-fill  { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--g), #12ffc9); transition: width .8s; }

/* ── PLATFORM ICONS ──────────────────────────────── */
.plat   { width: 26px; height: 26px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; flex-shrink: 0; box-shadow: inset 0 1px 0 rgba(255,255,255,.25); }
.plat-m { background: #1877F2; color: white; }
.plat-g { background: #EA4335; color: white; }
.plat-t { background: #111; color: white; border: 1px solid rgba(255,255,255,.15); }
.plat-l { background: #0A66C2; color: white; }

/* ── DIVIDER ─────────────────────────────────────── */
.dv { height: 1px; background: var(--b); margin: 16px 0; }

/* ── MODAL ───────────────────────────────────────── */
.overlay   { position: fixed; inset: 0; z-index: 200; background: rgba(2,4,10,.55); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%); display: none; align-items: center; justify-content: center; padding: 20px; }
.overlay.on { display: flex; animation: fadeIn .2s; }
.modal {
  background: rgba(16,20,30,.72);
  backdrop-filter: var(--blur-heavy);
  -webkit-backdrop-filter: var(--blur-heavy);
  border: 1px solid var(--glb);
  border-radius: 22px;
  width: min(560px,100%); max-height: 90vh; overflow-y: auto;
  box-shadow: var(--spec), 0 32px 100px rgba(0,0,0,.6);
  animation: slideUp .25s;
}
.modal-head  { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--b); }
.modal-title { font-size: 16px; font-weight: 800; }
.modal-body  { padding: 24px; }
.modal-foot  { padding: 16px 24px; border-top: 1px solid var(--b); display: flex; gap: 10px; justify-content: flex-end; }

/* ── WIZARD ──────────────────────────────────────── */
.wiz { display: flex; margin-bottom: 28px; position: relative; }
.wiz::before { content: ''; position: absolute; top: 16px; left: 32px; right: 32px; height: 1px; background: var(--b); }
.ws     { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: var(--t3); position: relative; z-index: 1; }
.wn     { width: 32px; height: 32px; border-radius: 50%; background: var(--gl2); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border: 2px solid var(--glb); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; transition: all .3s; box-shadow: var(--spec); }
.ws.done .wn { background: var(--gd); border-color: var(--g); color: var(--g); }
.ws.on   .wn { background: linear-gradient(180deg, #12ffc9, var(--g)); border-color: var(--g); color: var(--bg); box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 0 16px var(--gg); }
.ws.on       { color: var(--t1); }
.wp    { display: none; }
.wp.on { display: block; }

/* ── PODIUM ──────────────────────────────────────── */
.podium       { display: grid; grid-template-columns: 1fr 1.12fr 1fr; gap: 14px; align-items: end; margin-bottom: 24px; }
.pod {
  background: var(--gl);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glb);
  border-radius: var(--r12); padding: 20px 16px;
  text-align: center; position: relative;
  box-shadow: var(--spec), 0 12px 40px rgba(0,0,0,.25);
}
.pod.gold     { border-color: rgba(255,184,0,.4); background: linear-gradient(160deg, rgba(255,184,0,.08), var(--gl)); }
.pod.silver   { border-color: rgba(192,192,192,.22); margin-top: 24px; }
.pod.bronze   { border-color: rgba(205,127,50,.22); margin-top: 36px; }
.pod-medal    { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 900; color: white; box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 4px 12px rgba(0,0,0,.4); }
.pod.gold   .pod-medal { background: linear-gradient(135deg,#FFD700,#FFA500); box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 4px 16px rgba(255,184,0,.5); width: 34px; height: 34px; top: -17px; font-size: 16px; }
.pod.silver .pod-medal { background: linear-gradient(135deg,#aaa,#777); }
.pod.bronze .pod-medal { background: linear-gradient(135deg,#e0954d,#b0682a); }
.pod-val      { font-size: 28px; font-weight: 900; letter-spacing: -1px; margin: 12px 0 2px; }
.pod.gold   .pod-val { font-size: 34px; color: var(--y); }
.pod.silver .pod-val { color: #C0C0C0; }
.pod.bronze .pod-val { color: #CD7F32; }

/* ── INSIGHTS ────────────────────────────────────── */
.ins     { border-radius: var(--r8); padding: 12px 14px; margin-bottom: 10px; box-shadow: var(--spec); }
.ins-op  { background: rgba(0,230,180,.06); border: 1px solid rgba(0,230,180,.16); }
.ins-war { background: rgba(255,77,77,.06);  border: 1px solid rgba(255,77,77,.16); }
.ins-inf { background: rgba(124,111,255,.06); border: 1px solid rgba(124,111,255,.16); }
.ins-tag { font-size: 10px; font-weight: 800; letter-spacing: 1px; margin-bottom: 4px; font-family: var(--fm); }
.ins-op  .ins-tag { color: var(--g); }
.ins-war .ins-tag { color: var(--r); }
.ins-inf .ins-tag { color: var(--p); }
.ins-txt { font-size: 12px; color: var(--t2); line-height: 1.55; }

/* ── FILTER TABS ─────────────────────────────────── */
.ftabs { display: flex; gap: 4px; background: rgba(0,0,0,.25); border: 1px solid var(--glb); border-radius: 99px; padding: 4px; width: fit-content; margin-bottom: 20px; box-shadow: inset 0 1px 4px rgba(0,0,0,.3); }
.ftab  { padding: 7px 16px; border-radius: 99px; background: transparent; border: none; color: var(--t2); font-size: 12px; font-weight: 600; cursor: pointer; transition: all .22s; white-space: nowrap; font-family: var(--f); }
.ftab.on { background: var(--gl2); color: var(--g); border: 1px solid rgba(0,230,180,.22); box-shadow: var(--spec), 0 2px 10px rgba(0,0,0,.25); }
.ftab:not(.on):hover { color: var(--t1); background: var(--gl); }

/* ── PROJECTIONS ─────────────────────────────────── */
.pj-card {
  background: var(--gl);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glb);
  border-radius: var(--r12); padding: 22px;
  transition: all .3s;
  box-shadow: var(--spec), 0 12px 40px rgba(0,0,0,.25);
}
.pj-card:hover { border-color: rgba(255,255,255,.2); transform: translateY(-3px); box-shadow: var(--spec), 0 20px 50px rgba(0,0,0,.35); }
.pj-num  { font-size: 30px; font-weight: 900; letter-spacing: -1.5px; margin: 10px 0 4px; }
.pj-lbl  { font-size: 10px; font-weight: 700; color: var(--t2); text-transform: uppercase; letter-spacing: .5px; font-family: var(--fm); }
.pj-sub  { font-size: 11px; font-family: var(--fm); }
.cf-bar  { height: 6px; background: rgba(255,255,255,.07); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.cf-fill { height: 100%; border-radius: 99px; transition: width .8s; }

/* ── RENTABILIDAD / CLIENTES ─────────────────────── */
.verdict {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 22px; border-radius: var(--r12);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glb);
  box-shadow: var(--spec), 0 12px 40px rgba(0,0,0,.25);
  animation: slideUp .3s ease;
}
.v-ico   { font-size: 26px; flex-shrink: 0; }
.v-title { font-size: 15px; font-weight: 800; letter-spacing: -.3px; margin-bottom: 3px; }
.v-sub   { font-size: 12px; color: var(--t2); line-height: 1.55; }
.v-ok  { background: rgba(0,230,180,.07);  border-color: rgba(0,230,180,.3); }
.v-ok  .v-title { color: var(--g); }
.v-mid { background: rgba(255,184,0,.06);  border-color: rgba(255,184,0,.3); }
.v-mid .v-title { color: var(--y); }
.v-bad { background: rgba(255,77,77,.07);  border-color: rgba(255,77,77,.32); }
.v-bad .v-title { color: var(--r); }
.v-neu { background: var(--gl); }

.mc-sec { font-size: 11px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: var(--g); font-family: var(--fm); margin: 22px 0 12px; padding-top: 16px; border-top: 1px solid var(--b); }
.mc-sec:first-of-type { margin-top: 6px; }
.mc-sec span { color: var(--t3); font-weight: 500; letter-spacing: 0; text-transform: none; margin-left: 8px; }

.frow4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 13px; }

.prod-row { display: grid; grid-template-columns: 2.2fr 1fr 1fr .9fr .9fr .8fr auto; gap: 8px; margin-bottom: 8px; align-items: center; }
.prod-row .fi { padding: 9px 10px; font-size: 12px; }

.scen-row { display: flex; align-items: center; gap: 18px; padding: 12px 14px; background: var(--gl); border: 1px solid var(--glb); border-radius: var(--r8); margin-bottom: 8px; box-shadow: var(--spec); }

.client-card { cursor: pointer; transition: all .25s; }
.client-card:hover { transform: translateY(-3px); border-color: var(--b2); box-shadow: var(--spec), 0 20px 50px rgba(0,0,0,.35); }

/* ── GAUGES ──────────────────────────────────────── */
.gauge-card {
  background: var(--gl); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glb); border-radius: var(--r12);
  box-shadow: var(--spec), 0 12px 40px rgba(0,0,0,.25);
  display: flex; align-items: center; justify-content: center; padding: 26px;
}
.gauge {
  width: 190px; height: 190px; border-radius: 50%; position: relative;
  background: conic-gradient(var(--gc) calc(var(--gp) * 1%), rgba(255,255,255,.06) 0);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 34px color-mix(in srgb, var(--gc) 18%, transparent);
}
.gauge::before {
  content: ''; position: absolute; inset: 9px; border-radius: 50%;
  background: var(--bg2);
  box-shadow: inset 0 2px 8px rgba(0,0,0,.4);
}
.gauge-in  { position: relative; text-align: center; padding: 0 18px; }
.gauge-val { font-size: 34px; font-weight: 900; letter-spacing: -1.5px; }
.gauge-lbl { font-size: 11px; color: var(--t2); margin-top: 2px; line-height: 1.4; }
.gauge-sub { font-size: 10px; color: var(--t3); font-family: var(--fm); margin-top: 5px; }

/* ── METRIC GRID ─────────────────────────────────── */
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; }
.mcard {
  background: rgba(0,0,0,.22); border: 1px solid var(--b);
  border-radius: var(--r8); padding: 13px 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}
.mcard-lbl { font-size: 9px; font-weight: 700; color: var(--t3); text-transform: uppercase; letter-spacing: .8px; font-family: var(--fm); }
.mcard-val { font-size: 21px; font-weight: 800; letter-spacing: -.8px; margin-top: 5px; }
.mcard-sub { font-size: 10px; color: var(--t3); font-family: var(--fm); margin-top: 3px; }

/* ── EMBUDO ──────────────────────────────────────── */
.funnel-row { display: flex; align-items: stretch; gap: 0; overflow-x: auto; padding: 4px 0; }
.fstep {
  background: rgba(0,0,0,.22); border: 1px solid var(--b); border-radius: var(--r8);
  padding: 13px 15px; min-width: 128px; flex-shrink: 0; position: relative;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}
.fstep-weak { border-color: rgba(255,77,77,.45); background: rgba(255,77,77,.05); }
.fstep-flag { position: absolute; top: -9px; left: 10px; font-size: 9px; font-weight: 800; background: rgba(255,77,77,.15); color: var(--r); border: 1px solid rgba(255,77,77,.35); border-radius: 99px; padding: 1px 8px; font-family: var(--fm); }

/* ── CAC→LTGP ────────────────────────────────────── */
.ltgp-row { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; font-size: 13px; color: var(--t2); }
.ltgp-row b { color: var(--t1); }

/* ── CONEXIONES + INFORME IA ─────────────────────── */
.cx-block { background: rgba(0,0,0,.22); border: 1px solid var(--b); border-radius: var(--r8); padding: 16px; box-shadow: inset 0 1px 0 rgba(255,255,255,.05); }
.cx-block .fi { padding: 9px 12px; font-size: 12px; }
.rp-md h3 { font-size: 15px; font-weight: 800; margin: 18px 0 8px; color: var(--g); }
.rp-md h4 { font-size: 13px; font-weight: 700; margin: 14px 0 6px; }
.rp-md p  { font-size: 13px; line-height: 1.7; color: var(--t1); margin-bottom: 8px; }
.rp-md ul { margin: 0 0 10px 18px; }
.rp-md li { font-size: 13px; line-height: 1.7; color: var(--t1); margin-bottom: 4px; }
.rp-md b  { color: var(--g); }

/* ── DIAGNÓSTICO 3Q's ────────────────────────────── */
.q-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.q-head h3 { font-size: 17px; font-weight: 800; letter-spacing: -.3px; }
.qnum { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 900; flex-shrink: 0; box-shadow: var(--spec), 0 0 12px var(--gg); }

/* ── WORKFLOW CANVAS ─────────────────────────────── */
.wfc      { background: radial-gradient(circle at 1px 1px, rgba(255,255,255,.04) 1px, transparent 0); background-size: 22px 22px; border: 1px solid var(--glb); border-radius: var(--r8); padding: 28px; min-height: 180px; display: flex; align-items: center; justify-content: center; overflow-x: auto; }
.wf-nodes { display: flex; align-items: center; }
.wf-node  { background: var(--gl2); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border: 1px solid var(--glb); border-radius: var(--r12); padding: 12px 15px; text-align: center; min-width: 95px; cursor: pointer; transition: all .2s; flex-shrink: 0; box-shadow: var(--spec); }
.wf-node:hover { border-color: rgba(255,255,255,.25); transform: translateY(-2px); }
.wf-node.trig  { border-color: rgba(0,230,180,.32); background: rgba(0,230,180,.05); }
.wf-node.cond  { border-color: rgba(255,184,0,.32); background: rgba(255,184,0,.05); }
.wf-node.act   { border-color: rgba(124,111,255,.32); background: rgba(124,111,255,.05); }
.wf-ico  { font-size: 20px; margin-bottom: 5px; display: block; }
.wf-type { font-size: 8px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--t3); font-family: var(--fm); margin-bottom: 3px; }
.wf-name { font-size: 11px; font-weight: 700; }
.wf-arr  { flex: 1; min-width: 24px; height: 2px; background: var(--b); position: relative; flex-shrink: 0; }
.wf-arr::after { content: '›'; position: absolute; right: -9px; top: 50%; transform: translateY(-50%); color: var(--t3); font-size: 18px; line-height: 0; }

/* ── EMPTY STATE ─────────────────────────────────── */
.empty       { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 56px 20px; text-align: center; }
.empty-ico   { font-size: 38px; margin-bottom: 14px; opacity: .45; }
.empty-title { font-size: 15px; font-weight: 700; color: var(--t2); margin-bottom: 6px; }
.empty-sub   { font-size: 13px; color: var(--t3); max-width: 260px; line-height: 1.5; margin-bottom: 18px; }

/* ── TOASTS ──────────────────────────────────────── */
#toasts { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast  { background: rgba(16,20,30,.72); backdrop-filter: var(--blur-heavy); -webkit-backdrop-filter: var(--blur-heavy); border: 1px solid var(--b2); border-radius: var(--r8); padding: 12px 18px; font-size: 13px; font-weight: 500; max-width: 300px; box-shadow: var(--spec), 0 8px 32px rgba(0,0,0,.5); animation: slideUp .25s; }
.toast.err { border-color: rgba(255,77,77,.4); }

/* ── ANIMATIONS ──────────────────────────────────── */
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse   { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

/* ── RESPONSIVE ──────────────────────────────────── */
@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2,1fr); }
  .g2         { grid-template-columns: 1fr; }
  .g3         { grid-template-columns: 1fr 1fr; }
  .podium     { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  :root { --sb: 0px; }
  .sidebar             { transform: translateX(-248px); }
  .sidebar.open        { transform: translateX(0); width: 248px; }
  .main-wrap, .topbar  { margin-left: 0; }
  .stats-grid, .g3     { grid-template-columns: 1fr; }
  .frow                { grid-template-columns: 1fr; }
  .frow4               { grid-template-columns: 1fr 1fr; }
  .prod-row            { grid-template-columns: 1fr 1fr 1fr; }
  .pod.silver,
  .pod.bronze          { margin-top: 0; }
  .g2eq                { grid-template-columns: 1fr; }
  #menu-btn            { display: flex !important; }
}
