/* =====================================================================
   MoneyPrex · Design System
   Paleta extraida del logo oficial:
     cyan #00BFF0 · magenta #F050C0 · purpura #9B4DD8 · negro #010003
   ===================================================================== */

/* ---------- Tokens: DARK (default, el logo es neon sobre negro) -------- */
:root,
[data-theme="dark"] {
  --bg-primary:     #0A0B10;
  --bg-secondary:   #12141C;
  --bg-tertiary:    #1A1D28;
  --surface:        #12141C;
  --surface-raised: #171A24;
  --border:         #262A38;
  --border-strong:  #333849;

  --text-primary:   #F0F2F8;
  --text-secondary: #9AA0B4;
  --text-muted:     #626878;

  --accent:         #00BFF0;
  --accent-hover:   #35D2FA;
  --accent-text:    #04121A;
  --accent-soft:    rgba(0,191,240,.12);
  --accent-2:       #F050C0;
  --accent-2-soft:  rgba(240,80,192,.12);
  --accent-3:       #9B4DD8;

  --danger:         #FF4D5E;
  --success:        #22C55E;
  --warning:        #F5A623;

  --shadow:         rgba(0,0,0,.55);
  --glow:           rgba(0,191,240,.30);
  --ripple:         rgba(255,255,255,.22);
  --grid-line:      rgba(255,255,255,.028);
}

/* ---------- Tokens: LIGHT ---------------------------------------------- */
[data-theme="light"] {
  --bg-primary:     #FFFFFF;
  --bg-secondary:   #F4F6FA;
  --bg-tertiary:    #E9EDF5;
  --surface:        #FFFFFF;
  --surface-raised: #FFFFFF;
  --border:         #D5DBE6;
  --border-strong:  #B9C2D2;

  --text-primary:   #0A0B10;
  --text-secondary: #4A5163;
  --text-muted:     #757D91;

  --accent:         #0A7EA4;
  --accent-hover:   #086A8B;
  --accent-text:    #FFFFFF;
  --accent-soft:    rgba(10,126,164,.10);
  --accent-2:       #C21E8A;
  --accent-2-soft:  rgba(194,30,138,.10);
  --accent-3:       #7B35B8;

  --danger:         #C42B3A;
  --success:        #14804A;
  --warning:        #B26205;

  --shadow:         rgba(16,24,40,.10);
  --glow:           rgba(10,126,164,.18);
  --ripple:         rgba(0,0,0,.13);
  --grid-line:      rgba(10,11,16,.030);
}

/* Gradiente de marca — identico en ambos modos (viene del logo) */
:root { --brand-grad: linear-gradient(115deg, #00BFF0 0%, #9B4DD8 52%, #F050C0 100%); }

/* ---------- Reset ------------------------------------------------------ */
*, *::before, *::after {
  box-sizing: border-box;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
input, textarea, select, [contenteditable="true"] {
  -webkit-user-select: text;
  -moz-user-select: text;
  user-select: text;
}

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  background: var(--bg-primary);
  color: var(--text-primary);
  overscroll-behavior-y: none;
  transition: background .25s ease, color .25s ease;
}

h1,h2,h3,h4 { margin: 0; font-weight: 600; line-height: 1.25; }
h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
h4 { font-size: 15px; }
p  { margin: 0; }
a  { color: var(--accent); text-decoration: none; }
button { cursor: pointer; font-family: inherit; font-size: inherit; }
img { max-width: 100%; }

.label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  font-weight: 600;
}
.grad-text {
  background: var(--brand-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.muted { color: var(--text-muted); }
.sec   { color: var(--text-secondary); }

/* ---------- Iconos Lucide --------------------------------------------- */
.lucide, [data-lucide] { width: 18px; height: 18px; stroke-width: 2; flex-shrink: 0; }
.ico-sm  [data-lucide], [data-lucide].ico-sm  { width: 15px; height: 15px; }
.ico-lg  [data-lucide], [data-lucide].ico-lg  { width: 24px; height: 24px; }
.ico-xl  [data-lucide], [data-lucide].ico-xl  { width: 34px; height: 34px; }

/* ---------- Ripple ----------------------------------------------------- */
.ripple { position: relative; overflow: hidden; }
.ripple-wave {
  position: absolute;
  border-radius: 50%;
  background: var(--ripple);
  transform: scale(0);
  animation: ripple-anim .6s linear;
  pointer-events: none;
}
@keyframes ripple-anim { to { transform: scale(4); opacity: 0; } }

/* ---------- Botones ---------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 44px;
  padding: .6rem 1.1rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .01em;
  transition: transform .12s ease, filter .2s ease, background .2s ease, border-color .2s ease;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; pointer-events: none; }

.btn-primary {
  background: var(--accent);
  color: var(--accent-text);
  box-shadow: 0 4px 18px var(--glow);
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-brand {
  background: var(--brand-grad);
  color: #FFFFFF;
  box-shadow: 0 6px 22px var(--glow);
}
.btn-brand:hover { filter: brightness(1.08); }

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border);
}
.btn-secondary:hover { border-color: var(--border-strong); }

.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { color: var(--text-primary); background: var(--bg-tertiary); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { min-height: 36px; padding: .35rem .75rem; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }

/* ---------- Icon button ------------------------------------------------ */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  transition: color .2s, border-color .2s, background .2s;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Inputs ----------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1rem; }
.field > label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); font-weight: 600; }

.input, input[type="text"], input[type="password"], input[type="email"],
input[type="number"], input[type="date"], input[type="url"], select, textarea {
  width: 100%;
  min-height: 46px;
  padding: .65rem .85rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.6; }
.input:focus, input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }

.password-field { position: relative; }
.password-field input { padding-right: 48px; }
.toggle-password {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; border-radius: 8px;
  color: var(--text-muted);
}
.toggle-password:hover { color: var(--accent); }

/* ---------- Layout ----------------------------------------------------- */
.vista-container { max-width: 1240px; margin: 0 auto; padding: 2rem 1.5rem; }
.app-layout { display: flex; min-height: 100vh; }

.app-sidebar {
  width: 244px;
  flex-shrink: 0;
  padding: 1.25rem 1rem;
  border-right: 1px solid var(--border);
  background: var(--bg-secondary);
  display: flex;
  flex-direction: column;
  gap: .35rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.app-content { flex: 1; min-width: 0; padding: 1.75rem 1.5rem 2.5rem; }

.sidebar-brand { display: flex; align-items: center; gap: .6rem; padding: .25rem .5rem 1.25rem; }
.sidebar-brand img { width: 36px; height: 36px; object-fit: contain; filter: drop-shadow(0 0 10px var(--glow)); }
.sidebar-brand span { font-weight: 700; font-size: 16px; letter-spacing: -.01em; }

.nav-item {
  display: flex; align-items: center; gap: .7rem;
  min-height: 44px;
  padding: .55rem .7rem;
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  border-left: 2px solid transparent;
  transition: background .18s, color .18s;
}
.nav-item:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 600;
}
.nav-sep { height: 1px; background: var(--border); margin: .75rem .25rem; }

/* ---------- Topbar ----------------------------------------------------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.75rem; flex-wrap: wrap;
}
.topbar-title h1 { font-size: 24px; letter-spacing: -.02em; }
.topbar-title p { color: var(--text-muted); font-size: 13px; margin-top: .15rem; }
.topbar-actions { display: flex; align-items: center; gap: .6rem; }

.user-chip {
  display: flex; align-items: center; gap: .55rem;
  padding: .35rem .75rem .35rem .4rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-secondary);
  font-size: 13px;
}
.user-chip .avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--brand-grad); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}

/* ---------- Panel / superficies (composicion asimetrica) --------------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem;
  position: relative;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap;
}
.panel-head h3 { display: flex; align-items: center; gap: .5rem; }

/* Grilla asimetrica del dashboard */
.grid-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.grid-split { display: grid; grid-template-columns: 1.55fr 1fr; gap: 1rem; align-items: start; }

/* Tarjeta de metrica — corte diagonal, no rectangulo generico */
.metric {
  position: relative;
  overflow: hidden;
  padding: 1.05rem 1.15rem;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 2px solid var(--accent);
}
.metric::after {
  content: '';
  position: absolute; right: -34px; top: -34px;
  width: 96px; height: 96px;
  background: var(--accent-soft);
  transform: rotate(45deg);
  pointer-events: none;
}
.metric.m2 { border-top-color: var(--accent-2); }
.metric.m2::after { background: var(--accent-2-soft); }
.metric.m3 { border-top-color: var(--accent-3); }
.metric-top { display: flex; align-items: center; gap: .45rem; margin-bottom: .5rem; }
.metric-top [data-lucide] { width: 15px; height: 15px; color: var(--text-muted); }
.metric-top span { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); font-weight: 600; }
.metric-val {
  font-size: 30px; font-weight: 700; line-height: 1.1;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.metric-sub { font-size: 12px; color: var(--text-muted); margin-top: .3rem; }

/* ---------- Tablas ----------------------------------------------------- */
.tabla-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--border); }
table.tabla { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 520px; }
table.tabla th {
  text-align: left; padding: .7rem .9rem;
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted); font-weight: 600;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.tabla td { padding: .75rem .9rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.tabla tr:last-child td { border-bottom: none; }
table.tabla tbody tr:hover { background: var(--bg-secondary); }

/* ---------- Badges ----------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .2rem .55rem;
  border-radius: 6px;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em;
  border: 1px solid transparent;
}
.badge-ok     { background: rgba(34,197,94,.14);  color: var(--success); border-color: rgba(34,197,94,.3); }
.badge-off    { background: var(--bg-tertiary);   color: var(--text-muted); border-color: var(--border); }
.badge-warn   { background: rgba(245,166,35,.14); color: var(--warning); border-color: rgba(245,166,35,.3); }
.badge-danger { background: rgba(255,77,94,.14);  color: var(--danger);  border-color: rgba(255,77,94,.3); }
.badge-accent { background: var(--accent-soft);   color: var(--accent);  border-color: var(--accent); }

/* ---------- Estados (nunca 404 ni pantalla vacia) ---------------------- */
.empty-state, .error-state {
  text-align: center;
  padding: 2.5rem 1.25rem;
  border: 1px dashed var(--border-strong);
  border-radius: 14px;
  background: var(--bg-secondary);
}
.empty-state .empty-icon, .error-state .empty-icon {
  width: 56px; height: 56px; margin: 0 auto .85rem;
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
}
.empty-state .empty-icon [data-lucide], .error-state .empty-icon [data-lucide] { width: 26px; height: 26px; }
.error-state .empty-icon { background: rgba(255,77,94,.12); color: var(--danger); }
.empty-state h3, .error-state h3 { margin-bottom: .35rem; }
.empty-state p, .error-state p { color: var(--text-muted); font-size: 14px; margin-bottom: 1.1rem; }

/* Skeleton de carga */
.skeleton {
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: skel 1.3s ease-in-out infinite;
  border-radius: 8px;
}
@keyframes skel { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ---------- Toast ------------------------------------------------------ */
#toast-zone {
  position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%);
  z-index: 9999; display: flex; flex-direction: column; gap: .5rem;
  align-items: center; pointer-events: none; width: max-content; max-width: 92vw;
}
.toast {
  display: flex; align-items: center; gap: .5rem;
  padding: .7rem 1.1rem;
  border-radius: 10px;
  font-size: 14px; font-weight: 500;
  color: #fff;
  box-shadow: 0 8px 28px var(--shadow);
  animation: toast-in .28s cubic-bezier(.2,.9,.3,1.2);
}
.toast [data-lucide] { width: 16px; height: 16px; }
.toast-error   { background: var(--danger); }
.toast-success { background: var(--success); }
.toast-warning { background: var(--warning); color: #1A1000; }
.toast-info    { background: var(--accent); color: var(--accent-text); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Modales ---------------------------------------------------- */
.modal-wrapper {
  position: fixed; inset: 0;
  background: rgba(4,6,12,.72);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 1rem;
  animation: fade-in .18s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%; max-width: 560px;
  max-height: 90vh;
  display: flex; flex-direction: column;
  box-shadow: 0 24px 70px var(--shadow);
  overflow: hidden;
}
.modal-header {
  padding: 1.1rem 1.35rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.modal-body   { flex: 1; overflow-y: auto; padding: 1.35rem; }
.modal-footer {
  padding: 1rem 1.35rem;
  border-top: 1px solid var(--border);
  display: flex; gap: .75rem; justify-content: flex-end;
  background: var(--bg-primary);
  flex-shrink: 0;
}

/* ---------- Footer nav mobile ------------------------------------------ */
.app-footer-nav { display: none; }

.menu-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; }
.menu-grid-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .45rem;
  padding: 1rem .5rem;
  min-height: 88px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 12px; font-weight: 500; text-align: center;
}
.menu-grid-item [data-lucide] { width: 21px; height: 21px; color: var(--accent); }
.menu-grid-item.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* ---------- Splash ----------------------------------------------------- */
#splash {
  position: fixed; inset: 0; z-index: 10000;
  display: none; flex-direction: column; align-items: center; justify-content: center;
  background: #05060B;
  transition: opacity .5s ease;
}
#splash .splash-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 22% 32%, rgba(0,191,240,.20), transparent 45%),
    radial-gradient(circle at 78% 68%, rgba(240,80,192,.18), transparent 45%);
}
#splash .splash-inner { position: relative; text-align: center; padding: 1.5rem; }
#splash img { width: 168px; height: 168px; object-fit: contain; filter: drop-shadow(0 0 34px rgba(0,191,240,.5)); }
#splash h1 { font-size: 30px; margin-top: .75rem; letter-spacing: -.02em; }
#splash p { color: #8A90A4; font-size: 13px; margin: .3rem 0 1.75rem; }
.splash-track { width: 210px; height: 3px; margin: 0 auto; border-radius: 2px; background: #1E2230; overflow: hidden; }
#splash-bar { height: 100%; width: 0%; background: var(--brand-grad); transition: width .1s linear; }

/* ---------- Fondo con grilla tecnica ----------------------------------- */
.tech-bg {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 46px 46px;
}

/* ---------- HOME ------------------------------------------------------- */
.home-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 1rem 1.5rem;
  max-width: 1240px; margin: 0 auto;
}
.home-header .brand { display: flex; align-items: center; gap: .65rem; }
.home-header .brand img { width: 40px; height: 40px; object-fit: contain; filter: drop-shadow(0 0 12px var(--glow)); }
.home-header .brand span { font-weight: 700; font-size: 18px; letter-spacing: -.02em; }

.hero {
  max-width: 1240px; margin: 0 auto;
  padding: 3.5rem 1.5rem 3rem;
  display: grid; grid-template-columns: 1.15fr .85fr;
  gap: 2.5rem; align-items: center;
}
.hero-kicker {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .3rem .75rem; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg-secondary);
  font-size: 12px; color: var(--text-secondary); margin-bottom: 1.1rem;
}
.hero-kicker [data-lucide] { width: 14px; height: 14px; color: var(--accent); }
.hero h1 { font-size: 46px; line-height: 1.08; letter-spacing: -.03em; margin-bottom: 1rem; }
.hero p.lead { color: var(--text-secondary); font-size: 16px; max-width: 46ch; margin-bottom: 1.75rem; }
.hero-cta { display: flex; gap: .75rem; flex-wrap: wrap; }

.hero-visual {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  padding: 1.15rem;
  transform: rotate(-1.2deg);
  box-shadow: 0 20px 60px var(--shadow);
}
.hero-visual::before {
  content: ''; position: absolute; inset: -1px; border-radius: 18px;
  background: var(--brand-grad); opacity: .5; z-index: -1;
  filter: blur(14px);
}
.flow { display: flex; flex-direction: column; gap: .6rem; }
.flow-step {
  display: flex; align-items: center; gap: .7rem;
  padding: .7rem .85rem; border-radius: 11px;
  background: var(--bg-tertiary); border: 1px solid var(--border);
  font-size: 13px; font-weight: 500;
}
.flow-step .n {
  width: 25px; height: 25px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  background: var(--accent); color: var(--accent-text);
}
.flow-step.alt .n { background: var(--accent-2); color: #fff; }
.flow-arrow { display: flex; justify-content: center; color: var(--text-muted); }
.flow-arrow [data-lucide] { width: 15px; height: 15px; }

.features { max-width: 1240px; margin: 0 auto; padding: 1rem 1.5rem 4rem; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.feature {
  padding: 1.25rem;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom: 2px solid var(--accent);
}
.feature:nth-child(2n) { border-bottom-color: var(--accent-2); }
.feature:nth-child(3n) { border-bottom-color: var(--accent-3); }
.feature .fico {
  width: 40px; height: 40px; border-radius: 11px; margin-bottom: .8rem;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
}
.feature h4 { margin-bottom: .35rem; }
.feature p { font-size: 13px; color: var(--text-muted); }

.home-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
}

/* ---------- LOGIN ------------------------------------------------------ */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; }
.login-aside {
  position: relative;
  padding: 3rem 3rem;
  display: flex; flex-direction: column; justify-content: center;
  background: #06070D;
  color: #F0F2F8;
  overflow: hidden;
}
.login-aside::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 25% 25%, rgba(0,191,240,.22), transparent 48%),
    radial-gradient(circle at 75% 78%, rgba(240,80,192,.20), transparent 48%);
}
.login-aside > * { position: relative; }
.login-aside img { width: 96px; height: 96px; object-fit: contain; filter: drop-shadow(0 0 26px rgba(0,191,240,.45)); }
.login-aside h2 { font-size: 32px; letter-spacing: -.02em; margin: 1.25rem 0 .6rem; }
.login-aside p { color: #9AA0B4; font-size: 15px; max-width: 40ch; }
.login-points { margin-top: 2rem; display: flex; flex-direction: column; gap: .7rem; }
.login-points div { display: flex; align-items: center; gap: .6rem; font-size: 14px; color: #C7CCDA; }
.login-points [data-lucide] { width: 17px; height: 17px; color: #00BFF0; }

.login-main {
  display: flex; align-items: center; justify-content: center;
  padding: 2.5rem 1.5rem;
  background: var(--bg-primary);
}
.login-card { width: 100%; max-width: 384px; }
.login-card > h2 { font-size: 25px; letter-spacing: -.02em; margin-bottom: .35rem; }
.login-card > p.sub { color: var(--text-muted); font-size: 14px; margin-bottom: 1.75rem; }
.login-mobile-brand { display: none; text-align: center; margin-bottom: 1.5rem; }
.login-mobile-brand img { width: 74px; height: 74px; object-fit: contain; filter: drop-shadow(0 0 18px var(--glow)); }

/* ---------- Toolbar de listados (filtros + accion principal) ----------- */
.toolbar {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  margin-bottom: 1.1rem;
}
.toolbar .grow { flex: 1; min-width: 180px; }
.toolbar select, .toolbar .input { min-height: 40px; }
.search-box { position: relative; flex: 1; min-width: 200px; }
.search-box [data-lucide] {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--text-muted); pointer-events: none;
}
.search-box input { padding-left: 38px; min-height: 40px; }

/* ---------- Formularios en grilla --------------------------------------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 1rem; }
.grid-2 .field, .grid-3 .field { min-width: 0; }
.form-sep { height: 1px; background: var(--border); margin: .35rem 0 1.1rem; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: -.6rem; margin-bottom: 1rem; }

/* ---------- Selector de tipo (chips) ------------------------------------ */
.tipo-tabs { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.tipo-tab {
  display: flex; align-items: center; gap: .4rem;
  padding: .5rem .85rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 13px; font-weight: 600;
}
.tipo-tab [data-lucide] { width: 15px; height: 15px; }
.tipo-tab.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* ---------- Switch (activo / inactivo) ---------------------------------- */
.switch { position: relative; display: inline-flex; align-items: center; gap: .55rem; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 44px; height: 24px; margin: 0; cursor: pointer; }
.switch .track {
  width: 44px; height: 24px; border-radius: 999px;
  background: var(--bg-tertiary); border: 1px solid var(--border);
  position: relative; transition: background .18s, border-color .18s; flex-shrink: 0;
}
.switch .track::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--text-muted);
  transition: transform .18s, background .18s;
}
.switch input:checked + .track { background: var(--accent-soft); border-color: var(--accent); }
.switch input:checked + .track::after { transform: translateX(20px); background: var(--accent); }
.switch .switch-label { font-size: 13px; color: var(--text-secondary); font-weight: 500; }

/* ---------- Subida de imagen con preview -------------------------------- */
.upload-box {
  display: flex; align-items: center; gap: 1rem;
  padding: .85rem;
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  background: var(--bg-secondary);
}
.upload-box .preview {
  width: 76px; height: 76px; border-radius: 10px; flex-shrink: 0;
  background: var(--bg-tertiary);
  background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); overflow: hidden;
}
.upload-box .preview [data-lucide] { width: 24px; height: 24px; }
.upload-box .info { flex: 1; min-width: 0; }
.upload-box .info p { font-size: 12px; color: var(--text-muted); margin-top: .25rem; }

/* ---------- Acciones de fila en tabla ------------------------------------ */
.row-acciones { display: flex; gap: .35rem; justify-content: flex-end; }
.row-acciones .icon-btn { width: 34px; height: 34px; border-radius: 8px; }

/* ---------- API key en tabla --------------------------------------------- */
.key-chip {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .3rem .6rem; border-radius: 8px;
  background: var(--bg-tertiary); border: 1px solid var(--border);
  font-size: 12px;
}
.key-chip [data-lucide] { width: 13px; height: 13px; }

/* ---------- Utilidades ------------------------------------------------- */
.row { display: flex; align-items: center; gap: .6rem; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.wrap { flex-wrap: wrap; }
.mt-0 { margin-top: 0; }  .mt-1 { margin-top: .5rem; }  .mt-2 { margin-top: 1rem; }  .mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.hide { display: none !important; }
.mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.trunc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 1024px) {
  .hero { grid-template-columns: 1fr; gap: 2rem; padding-top: 2.5rem; }
  .hero h1 { font-size: 38px; }
  .hero-visual { transform: none; }
  .grid-split { grid-template-columns: 1fr; }
  .login-page { grid-template-columns: 1fr; }
  .login-aside { display: none; }
  .login-mobile-brand { display: block; }
}

@media (max-width: 768px) {
  h1 { font-size: 24px; }
  .vista-container { padding: 1.25rem 1rem; }
  .app-layout { flex-direction: column; }
  .app-sidebar { display: none; }
  .app-content { padding: 1.25rem 1rem 88px; }
  .hero { padding: 2.25rem 1rem 2rem; }
  .hero h1 { font-size: 31px; }
  .features { padding: 0 1rem 3rem; }
  .home-header { padding: .85rem 1rem; }
  .topbar { margin-bottom: 1.25rem; }
  .topbar-title h1 { font-size: 21px; }
  .metric-val { font-size: 26px; }
  #toast-zone { bottom: 84px; }

  .modal { max-width: 100%; border-radius: 16px 16px 0 0; max-height: 92vh; }
  .modal-wrapper { align-items: flex-end; padding: 0; }

  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .upload-box { flex-direction: column; align-items: flex-start; }

  .app-footer-nav {
    position: fixed; bottom: 0; left: 0; right: 0;
    height: 64px;
    display: flex;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    z-index: 999;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .app-footer-nav a {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px;
    font-size: 10px; font-weight: 500;
    color: var(--text-muted);
    min-height: 44px;
  }
  .app-footer-nav a [data-lucide] { width: 20px; height: 20px; }
  .app-footer-nav a.active { color: var(--accent); }
  .home-hide-mobile { display: none; }
}

@media (max-width: 380px) {
  .menu-grid { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 27px; }
}

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