/* ====================================================================
   Galaxy AML – Premium UI  (Vuexy-inspired)
   ==================================================================== */

/* ---------- Fuentes locales (sin CDN) ---------- */
@import url('/fonts/dmsans.css');

/* ---------- Custom Properties ---------- */
:root {
  --brand: #7c3aed;
  --brand-2: #06b6d4;
  --brand-3: #ec4899;
  --brand-light: rgba(124, 58, 237, .08);
  --brand-ring: rgba(124, 58, 237, .35);
  --bg: #f4f5fa;
  --bg-subtle: #eef0f6;
  --card: #ffffff;
  --card-hover: #fafbff;
  --text-primary: #2e263d;
  --text-secondary: #6e6b7b;
  --text-muted: #a5a2b0;
  --border: rgba(46, 38, 61, .08);
  --border-hover: rgba(124, 58, 237, .22);
  --shadow-sm: 0 2px 8px rgba(46, 38, 61, .06);
  --shadow-md: 0 4px 18px rgba(46, 38, 61, .1);
  --shadow-lg: 0 8px 30px rgba(46, 38, 61, .14);
  --shadow-brand: 0 4px 18px rgba(124, 58, 237, .25);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --gradient-hero: linear-gradient(135deg, #312e81 0%, #7c3aed 40%, #06b6d4 80%, #22d3ee 100%);
  --gradient-accent: linear-gradient(135deg, #7c3aed, #06b6d4);
  --gradient-pink: linear-gradient(135deg, #ec4899, #8b5cf6);
  --transition-fast: .18s cubic-bezier(.4, 0, .2, 1);
  --transition-smooth: .35s cubic-bezier(.4, 0, .2, 1);
  --transition-spring: .45s cubic-bezier(.34, 1.56, .64, 1);
}

/* ---------- Dark Mode Overrides ---------- */
html.dark {
  --bg: #0f111a;
  --bg-subtle: #171923;
  --card: #1f2330;
  --card-hover: #262b3a;
  --text-primary: #e4e6eb;
  --text-secondary: #b0b3b8;
  --text-muted: #65676b;
  --border: rgba(255, 255, 255, .08);
  --border-hover: rgba(124, 58, 237, .4);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .3);
  --shadow-md: 0 4px 18px rgba(0, 0, 0, .4);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, .5);
}

/* Dark mode specific component adjustments */
html.dark .navbar {
  background: rgba(31, 35, 48, .95);
  border-color: rgba(255, 255, 255, .06);
}
html.dark .nav-dropdown-menu,
html.dark #menuSettings,
html.dark #menuBell {
  background: #1f2330;
  border-color: rgba(255, 255, 255, .08);
}
html.dark .nav-dropdown-item:hover,
html.dark .navpill:hover {
  background: rgba(124, 58, 237, .15);
}
html.dark .tab.is-active {
  background: #262b3a;
}
html.dark .batch-item {
  background: #1f2330;
}
html.dark input,
html.dark select,
html.dark textarea,
html.dark .form-input {
  background: #171923;
  color: #e4e6eb;
}
html.dark .text-neutral-800 {
  color: #e4e6eb !important;
}
html.dark .text-neutral-700 {
  color: #d1d5db !important;
}
html.dark .text-neutral-600 {
  color: #9ca3af !important;
}
html.dark .text-neutral-500 {
  color: #6b7280 !important;
}
html.dark .bg-white {
  background-color: #1f2330 !important;
}
html.dark .hover\:bg-neutral-50:hover {
  background-color: #262b3a !important;
}
html.dark .border {
  border-color: rgba(255, 255, 255, .08) !important;
}

/* ---------- Base Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.55;
  font-size: 14px;
}
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
ul, ol { list-style: none; }
img { max-width: 100%; height: auto; }

/* ---------- Shell ---------- */
.app-shell { max-width: 1320px; margin: 0 auto; padding: 0 32px; }

body > main.app-shell {
  padding-top: 2.6rem !important;
  padding-bottom: 3.4rem !important;
}

/* ====================================================================
   NAVBAR – Glassmorphism premium
   ==================================================================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(20px) saturate(1.8);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  border-bottom: 1px solid rgba(124, 58, 237, .1);
  box-shadow: 0 10px 30px rgba(46, 38, 61, .05);
  margin-bottom: 0;
  overflow: visible !important;
  transition: box-shadow var(--transition-fast);
}
.navbar:hover {
  box-shadow: 0 2px 20px rgba(124, 58, 237, .06);
}

/* Brand */
.brand { display: flex; align-items: center; gap: .75rem; font-weight: 800; }
.brand img { display: block; height: 2.2rem; width: auto; transition: transform var(--transition-smooth); }
.brand:hover img { transform: scale(1.04); }

/* Brand badge (fallback) */
.brand-badge {
  width: 38px; height: 38px; border-radius: 12px;
  background: var(--gradient-accent);
  box-shadow: var(--shadow-brand);
  transition: transform var(--transition-spring);
}
.brand:hover .brand-badge { transform: rotate(12deg) scale(1.08); }

/* Search */
.search-wrap { position: relative; }
.search-wrap .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--text-muted); }
.input {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: .62rem 1rem .62rem 2.4rem;
  background: var(--bg-subtle);
  font-size: .9rem;
  color: var(--text-primary);
  transition: all var(--transition-fast);
}
.input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
  background: #fff;
}

/* Icon Buttons */
.icon-btn {
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-subtle);
  border: 1.5px solid transparent;
  position: relative;
  transition: all var(--transition-fast);
  color: var(--text-secondary);
}
.icon-btn:hover {
  background: var(--brand-light);
  border-color: var(--border-hover);
  color: var(--brand);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.icon-btn .dot {
  position: absolute; top: 7px; right: 7px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--brand-3);
  box-shadow: 0 0 0 3px rgba(236, 72, 153, .2);
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 3px rgba(236, 72, 153, .2); }
  50% { box-shadow: 0 0 0 6px rgba(236, 72, 153, .05); }
}

.badge-dot {
  position: absolute; top: -6px; right: -6px;
  background: var(--brand); color: #fff; border-radius: 999px;
  font-size: .6rem; font-weight: 700; padding: 2px 7px;
  border: 2px solid #fff;
  animation: badge-bounce .6s cubic-bezier(.34, 1.56, .64, 1);
}
@keyframes badge-bounce {
  0% { transform: scale(0); }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.avatar {
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  overflow: hidden; border: 2px solid var(--border);
}

/* Menu Pills */
.menu-row {
  display: flex; align-items: center; gap: .55rem;
  overflow: visible; padding-bottom: .2rem;
}
.navpill {
  display: inline-flex; align-items: center; gap: .5rem;
  min-height: 42px;
  padding: .58rem .95rem; border-radius: var(--radius-sm);
  color: var(--text-secondary);
  background: transparent;
  border: 1.5px solid transparent;
  font-weight: 600; font-size: .8rem;
  white-space: nowrap;
  transition: all var(--transition-fast);
  position: relative;
}
.navpill svg { width: 18px; height: 18px; flex-shrink: 0; }
.navpill:hover {
  background: var(--brand-light);
  color: var(--brand);
  transform: translateY(-1px);
}
.navpill.active {
  background: var(--brand);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--shadow-brand);
}
.navpill.active svg { color: #fff; }

/* Nav Dropdown Menus */
.nav-dropdown-wrap { position: relative; z-index: 200; }
.nav-dropdown-trigger { cursor: pointer; }
.nav-chevron {
  width: 14px; height: 14px; flex-shrink: 0;
  transition: transform var(--transition-fast);
  opacity: .5;
}
.nav-dropdown-trigger[aria-expanded="true"] .nav-chevron {
  transform: rotate(180deg);
  opacity: .9;
}
.nav-dropdown-trigger[aria-expanded="true"] {
  background: var(--brand-light);
  color: var(--brand);
}
.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 220px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 40px rgba(46, 38, 61, .18);
  padding: .4rem;
  z-index: 9999;
  animation: dropdown-enter .2s cubic-bezier(.4, 0, .2, 1);
}
.nav-dropdown-menu.hidden { display: none; }
@keyframes dropdown-enter {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.nav-dropdown-item {
  display: flex; align-items: center; gap: .6rem;
  padding: .6rem .85rem;
  border-radius: var(--radius-sm);
  font-size: .82rem; font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}
.nav-dropdown-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: .6; }
.nav-dropdown-item:hover {
  background: var(--brand-light);
  color: var(--brand);
}
.nav-dropdown-item:hover svg { opacity: 1; color: var(--brand); }
.nav-dropdown-item.active {
  background: rgba(124, 58, 237, .1);
  color: var(--brand);
  font-weight: 600;
}
.nav-dropdown-item.active svg { opacity: 1; color: var(--brand); }

/* Parent pill shows active when child route is active */
.nav-dropdown-trigger.has-active-child {
  background: rgba(124, 58, 237, .08);
  color: var(--brand);
}

/* ====================================================================
   CARD BASE
   ==================================================================== */
.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px rgba(46, 38, 61, .06);
  border: 1px solid var(--border);
  transition: all var(--transition-smooth);
  position: relative;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gradient-accent);
  opacity: 0;
  transition: opacity var(--transition-smooth);
}
.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-hover);
  transform: translateY(-2px);
}
.card:hover::before { opacity: 1; }

/* ====================================================================
   FORM ELEMENTS
   ==================================================================== */
.form-label {
  display: block;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: .4rem;
  letter-spacing: .01em;
}
.form-input {
  display: block;
  width: 100%;
  padding: .6rem .85rem;
  font-size: .85rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  -webkit-appearance: none;
  appearance: none;
}
.form-input::placeholder {
  color: var(--text-muted);
  opacity: .65;
}
.form-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, .1);
}
.form-hint {
  font-size: .72rem;
  color: var(--text-muted);
  margin-top: .3rem;
}
select.form-input {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236e6b7b' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .7rem center;
  padding-right: 2rem;
}

/* ====================================================================
   SKELETON LOADING
   ==================================================================== */
@keyframes skeleton-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton {
  background: linear-gradient(90deg, #ede9f6 25%, #f3f0fa 50%, #ede9f6 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.8s ease-in-out infinite;
  border-radius: 8px;
  color: transparent !important;
}
.skeleton-text { height: 1rem; margin-bottom: .5rem; }
.skeleton-heading { height: 1.8rem; width: 60%; margin-bottom: .75rem; }
.skeleton-value { height: 2.2rem; width: 80px; }
.skeleton-bar { height: 8px; border-radius: 999px; }
.skeleton-circle { border-radius: 50%; }
.skeleton-card {
  padding: 1.8rem;
  min-height: 160px;
}
.skeleton-card .skeleton-text { width: 75%; }
.skeleton-card .skeleton-text:nth-child(2) { width: 55%; }
.skeleton-card .skeleton-text:nth-child(3) { width: 65%; }

/* ====================================================================
   ANIMATED COUNTERS
   ==================================================================== */
@keyframes count-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.count-animate {
  animation: count-up .5s cubic-bezier(.4, 0, .2, 1) forwards;
}

/* ====================================================================
   BUTTONS
   ==================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .7rem 1.15rem;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: #fff;
  font-weight: 600; font-size: .9rem;
  color: var(--text-primary);
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at center, rgba(124,58,237,.08) 0%, transparent 70%);
  opacity: 0;
  transition: opacity var(--transition-fast);
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  border-color: var(--border-hover);
}
.btn:hover::after { opacity: 1; }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--gradient-accent);
  color: #fff;
  border: none;
  box-shadow: var(--shadow-brand);
}
.btn-primary:hover {
  box-shadow: 0 6px 24px rgba(124, 58, 237, .35);
  filter: brightness(1.08);
}

/* ====================================================================
   HERO CARD
   ==================================================================== */
.hero-card {
  position: relative; color: #fff; padding: 0; border: 0;
  background: transparent; box-shadow: none;
  border-radius: var(--radius-xl);
  overflow: hidden;
  min-height: 260px;
}
.hero-card::before { display: none; }
.hero-card:hover { transform: none; box-shadow: none; }

.hero-gradient {
  position: absolute; inset: 0;
  background: var(--gradient-hero);
  z-index: 0;
}
/* Animated mesh overlay */
.hero-gradient::after {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 80%, rgba(6,182,212,.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(236,72,153,.2) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(124,58,237,.15) 0%, transparent 60%);
  animation: hero-mesh 8s ease-in-out infinite alternate;
}
@keyframes hero-mesh {
  0% { opacity: .6; transform: scale(1); }
  50% { opacity: .9; transform: scale(1.05); }
  100% { opacity: .7; transform: scale(1.02); }
}

/* Floating particles */
.hero-card .hero-particles {
  position: absolute; inset: 0; z-index: 1; overflow: hidden; pointer-events: none;
}
.hero-card .hero-particles span {
  position: absolute;
  width: 4px; height: 4px;
  background: rgba(255,255,255,.25);
  border-radius: 50%;
  animation: float-particle linear infinite;
}
@keyframes float-particle {
  0% { transform: translateY(100%) scale(0); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-100vh) scale(1); opacity: 0; }
}

.hero-content {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; gap: 1.5rem;
  padding: 2.5rem;
}
@media (min-width: 1024px) {
  .hero-content { flex-direction: row; justify-content: space-between; align-items: flex-end; }
}

.hero-copy { max-width: 36rem; display: flex; flex-direction: column; gap: .8rem; }
.hero-eyebrow {
  text-transform: uppercase; letter-spacing: .16em;
  font-size: .72rem; font-weight: 700;
  color: rgba(255,255,255,.7);
  display: inline-flex; align-items: center; gap: .5rem;
}
.hero-eyebrow::before {
  content: '';
  width: 24px; height: 2px;
  background: rgba(255,255,255,.5);
  border-radius: 2px;
}
.hero-title {
  font-size: 1.65rem; font-weight: 800; line-height: 1.18;
  text-shadow: 0 2px 12px rgba(0,0,0,.15);
}
.hero-subtitle {
  font-size: .82rem; color: rgba(255,255,255,.78);
  display: flex; flex-wrap: wrap; gap: .35rem .65rem; align-items: center;
}
.hero-subdued { color: rgba(255,255,255,.58); font-size: .82rem; }

.hero-stats {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}
.hero-stats > div {
  background: rgba(255,255,255,.1);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--radius-md);
  padding: 1rem 1.2rem;
  transition: all var(--transition-fast);
}
.hero-stats > div:hover {
  background: rgba(255,255,255,.18);
  transform: translateY(-2px);
}
.hero-label {
  font-size: .72rem; text-transform: uppercase;
  letter-spacing: .08em; color: rgba(255,255,255,.65);
  font-weight: 600;
}
.hero-value { font-size: 1.65rem; font-weight: 800; display: block; line-height: 1.2; }

.hero-footer {
  position: relative; z-index: 2;
  padding: 0 2.5rem 2.5rem;
  display: flex; flex-wrap: wrap; gap: 1rem 1.5rem;
  justify-content: space-between; align-items: center;
}
.hero-chip {
  background: rgba(0,0,0,.2);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.15);
  color: rgba(255,255,255,.9);
  border-radius: var(--radius-md); padding: .8rem 1.2rem;
  display: flex; flex-direction: column; font-size: .82rem; gap: .25rem;
  min-width: 180px;
  transition: all var(--transition-fast);
}
.hero-chip:hover { background: rgba(0,0,0,.3); }
.hero-chip strong { font-size: 1.4rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.hero-card .btn { border-color: rgba(255,255,255,.2); color: #fff; background: rgba(255,255,255,.12); backdrop-filter: blur(8px); }
.hero-card .btn:hover { background: rgba(255,255,255,.22); }
.hero-card .btn.btn-primary {
  background: rgba(255,255,255,.95); color: var(--brand);
  border: none;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
}
.hero-card .btn.btn-primary:hover { background: #fff; }

/* ====================================================================
   SPOTLIGHT CARD (Totals)
   ==================================================================== */
.spotlight {
  padding: 2rem 2.2rem;
  display: flex; flex-direction: column; gap: 1.4rem;
}
.spotlight-eyebrow {
  text-transform: uppercase; font-size: .72rem;
  letter-spacing: .1em; color: var(--brand);
  font-weight: 700;
  display: inline-flex; align-items: center; gap: .5rem;
}
.spotlight-eyebrow::before {
  content: '';
  width: 8px; height: 8px; border-radius: 3px;
  background: var(--gradient-accent);
}
.spotlight-title { font-size: 1.15rem; font-weight: 700; color: var(--text-primary); }

.spotlight-metrics { display: grid; gap: 1rem; }
.spotlight-metrics > div {
  display: flex; flex-direction: column; gap: .3rem;
  padding: 1rem;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  border-left: 3px solid;
  transition: all var(--transition-fast);
}
.spotlight-metrics > div:nth-child(1) { border-left-color: var(--brand); }
.spotlight-metrics > div:nth-child(2) { border-left-color: var(--brand-3); }
.spotlight-metrics > div:nth-child(3) { border-left-color: var(--brand-2); }
.spotlight-metrics > div:hover {
  background: rgba(124, 58, 237, .05);
  transform: translateX(4px);
}
.spotlight-metrics dt {
  font-size: .72rem; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-muted); font-weight: 600;
}
.spotlight-metrics dd { font-size: 1.25rem; font-weight: 800; color: var(--text-primary); }

.spotlight-footer { border-top: 1px solid var(--border); padding-top: 1rem; }
.spotlight-note { font-size: .82rem; color: var(--text-muted); }

/* ====================================================================
   SECTION HEADERS
   ==================================================================== */
.section-header {
  display: flex; flex-wrap: wrap;
  justify-content: space-between; align-items: center;
  gap: 1.25rem; padding: 1.8rem 2rem;
  border-bottom: 1px solid var(--border);
}
.section-title { font-size: 1.05rem; font-weight: 700; color: var(--text-primary); }
.section-subtitle { font-size: .78rem; color: var(--text-muted); }

/* ====================================================================
   TABS
   ==================================================================== */
.tablist {
  display: flex; gap: .35rem;
  background: var(--bg-subtle);
  padding: .3rem; border-radius: var(--radius-md);
}
.tab {
  padding: .55rem 1.15rem;
  border-radius: var(--radius-sm);
  font-weight: 600; font-size: .85rem;
  color: var(--text-secondary);
  background: transparent; border: 0;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}
.tab:hover { color: var(--brand); background: rgba(124, 58, 237, .06); }
.tab.is-active {
  background: #fff;
  color: var(--brand);
  box-shadow: 0 2px 8px rgba(124, 58, 237, .15);
}
.tab-panel { padding: 1.5rem 2rem 2rem; }
.tab-panel[hidden] { display: none; }

/* ====================================================================
   BATCH LIST
   ==================================================================== */
.batch-list { display: flex; flex-direction: column; gap: .8rem; }
.batch-item {
  padding: 1.2rem 1.4rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  background: #fff;
  display: flex; flex-direction: column; gap: .7rem;
  transition: all var(--transition-smooth);
  position: relative;
  overflow: hidden;
}
.batch-item::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--gradient-accent);
  opacity: 0;
  transition: opacity var(--transition-fast);
}
.batch-item:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
  transform: translateX(4px);
}
.batch-item:hover::before { opacity: 1; }

.batch-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.batch-title { font-weight: 700; font-size: 1rem; color: var(--text-primary); }
.batch-meta {
  font-size: .78rem; color: var(--text-muted);
  margin-top: .3rem; display: flex; gap: .5rem; flex-wrap: wrap;
}
.batch-status {
  font-size: .68rem; font-weight: 700;
  padding: .35rem .65rem; border-radius: 999px;
  text-transform: uppercase; letter-spacing: .06em;
}
.batch-body {
  display: flex; align-items: baseline; gap: .6rem;
  font-size: .9rem; color: var(--text-secondary);
}
.batch-number { font-size: 1.4rem; font-weight: 800; color: var(--text-primary); }
.batch-muted { font-size: .85rem; color: var(--text-muted); }
.batch-progress {
  height: 6px; width: 100%; border-radius: 999px;
  background: var(--bg-subtle); overflow: hidden;
}
.batch-progress span {
  display: block; height: 100%; border-radius: inherit;
  transition: width .8s cubic-bezier(.4, 0, .2, 1);
}
.batch-empty {
  padding: 2rem; border-radius: var(--radius-md);
  background: var(--bg-subtle);
  text-align: center; color: var(--text-muted); font-size: .88rem;
}

/* ====================================================================
   BREAKDOWN CARDS
   ==================================================================== */
.breakdown-card {
  padding: 1.8rem;
  display: flex; flex-direction: column; gap: 1.2rem;
}
.breakdown-card header { display: flex; flex-direction: column; gap: .5rem; }
.breakdown-card h3 { font-weight: 700; font-size: 1.05rem; color: var(--text-primary); }
.breakdown-card p { color: var(--text-muted); font-size: .85rem; }

.breakdown-metrics {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem;
}
.breakdown-metrics > div {
  display: flex; flex-direction: column; gap: .25rem;
  padding: .75rem; background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}
.breakdown-metrics > div:hover {
  background: var(--brand-light);
  transform: translateY(-2px);
}
.breakdown-metrics dt {
  font-size: .7rem; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-muted); font-weight: 600;
}
.breakdown-metrics dd { font-size: 1.15rem; font-weight: 700; color: var(--text-primary); }

.breakdown-badge, .badge-pep, .badge-concursal, .badge-onu {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .4rem .85rem; border-radius: 999px;
  font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
}
.badge-pep { background: rgba(16, 185, 129, .12); color: #059669; }
.badge-concursal { background: rgba(245, 158, 11, .12); color: #d97706; }
.badge-onu { background: rgba(6, 182, 212, .12); color: #0891b2; }

/* Status badges */
.status-finished { background: rgba(16, 185, 129, .12); color: #059669; }
.status-running { background: rgba(124, 58, 237, .12); color: var(--brand); animation: status-pulse 2s infinite; }
@keyframes status-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .7; }
}
.status-queued { background: rgba(148, 163, 184, .15); color: #64748b; }
.status-error { background: rgba(239, 68, 68, .12); color: #dc2626; }

/* Progress colors */
.progress-pep { background: linear-gradient(90deg, #10b981, #34d399); }
.progress-concursal { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.progress-onu { background: linear-gradient(90deg, #06b6d4, #22d3ee); }

/* ====================================================================
   CHART & ACTIVITY
   ==================================================================== */
.chart-card {
  min-height: 360px;
  display: flex; flex-direction: column; gap: 1.2rem;
}
.chart-canvas {
  margin-top: .5rem; height: 270px;
  border-radius: var(--radius-lg);
  background: var(--bg-subtle);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.chart-legend {
  display: flex; flex-wrap: wrap; gap: 1rem;
  font-size: .82rem; color: var(--text-secondary);
}
.legend-dot {
  width: 10px; height: 10px; border-radius: 50%;
  display: inline-block; margin-right: .3rem;
}
.legend-processed { background: #7c3aed; }
.legend-detected { background: #ec4899; }

.activity-card { display: flex; flex-direction: column; gap: 1.2rem; }
.activity-feed { display: flex; flex-direction: column; gap: .8rem; margin-top: .3rem; }
.activity-item {
  display: flex; gap: 1rem; align-items: flex-start;
  padding: .8rem; border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}
.activity-item:hover { background: var(--bg-subtle); }
.activity-pill {
  width: 38px; height: 38px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .72rem;
  color: var(--text-primary);
  flex-shrink: 0;
}
.activity-pill-pep { background: rgba(16, 185, 129, .12); color: #059669; }
.activity-pill-concursal { background: rgba(245, 158, 11, .12); color: #d97706; }
.activity-pill-onu { background: rgba(6, 182, 212, .12); color: #0891b2; }

.activity-body { flex: 1; display: flex; flex-direction: column; gap: .2rem; }
.activity-body h4 { font-size: .92rem; font-weight: 600; color: var(--text-primary); }
.activity-meta {
  font-size: .78rem; color: var(--text-muted);
  display: flex; gap: .5rem; flex-wrap: wrap;
}
.activity-empty {
  padding: 1.5rem; border-radius: var(--radius-md);
  background: var(--bg-subtle);
  text-align: center; color: var(--text-muted); font-size: .88rem;
}

/* ====================================================================
   DOWNLOAD OVERLAY
   ==================================================================== */
.dl-overlay {
  position: fixed; inset: 0;
  background: rgba(8, 11, 20, .6);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
}
.dl-overlay.hidden { display: none; }
.dl-box {
  position: relative; width: 200px; height: 200px;
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, #0b0f1a, #141a2a);
  border: 1px solid rgba(124, 58, 237, .2);
  box-shadow: 0 10px 40px rgba(0, 0, 0, .4);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
}
.dl-logo { width: 92px; height: auto; filter: drop-shadow(0 2px 6px rgba(0,0,0,.4)); }
.dl-ring {
  position: absolute; width: 150px; height: 150px; border-radius: 50%;
  border: 3px solid rgba(124, 58, 237, .15);
  border-top-color: rgba(124, 58, 237, .8);
  animation: dl-spin 1.1s linear infinite;
}
.dl-text {
  color: #cbd5e1; font-weight: 700; letter-spacing: .3px; font-size: 14px;
  animation: dl-pulse 1.4s ease-in-out infinite; margin-top: 6px;
}
@keyframes dl-spin { to { transform: rotate(360deg); } }
@keyframes dl-pulse { 0%, 100% { opacity: .75; } 50% { opacity: 1; } }

/* ====================================================================
   FOOTER
   ==================================================================== */
.footer, .app-footer {
  color: var(--text-muted); font-size: .85rem;
}
.app-footer {
  border-top: 1px solid var(--border);
  margin-top: 3rem;
}
.badge { font-size: .72rem; padding: .2rem .55rem; border-radius: 999px; background: var(--brand-light); color: var(--brand); font-weight: 600; }

/* Print */
.no-print { display: block; }
@media print { .no-print { display: none; } }

/* ====================================================================
   DATATABLE
   ==================================================================== */
.datatable-card { padding: 2rem 2.2rem; display: flex; flex-direction: column; gap: 1.75rem; }
.datatable-header { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 1.5rem; }
.datatable-title { font-size: 1.3rem; font-weight: 700; color: var(--text-primary); }
.datatable-subtitle { font-size: .88rem; color: var(--text-muted); max-width: 36rem; }
.datatable-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.datatable-search { position: relative; display: flex; align-items: center; }
.datatable-search .icon { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--text-muted); }
.datatable-input {
  padding: .6rem 1rem .6rem 2.6rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md); min-width: 240px;
  background: var(--bg-subtle);
  transition: all var(--transition-fast);
  font-size: .88rem;
}
.datatable-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
  background: #fff;
}
.datatable-per-page {
  display: flex; align-items: center; gap: .5rem;
  background: var(--bg-subtle);
  padding: .35rem .7rem; border-radius: 999px;
  font-size: .82rem;
}
.datatable-select { border: 0; background: transparent; font-weight: 600; color: var(--brand); padding: .2rem .4rem; outline: none; }
.datatable-wrapper {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.datatable-table { min-width: 880px; width: 100%; border-collapse: separate; border-spacing: 0; }
.datatable-table thead tr { background: var(--bg-subtle); }
.datatable-table th {
  padding: .85rem 1rem; text-align: left;
  font-size: .72rem; text-transform: uppercase;
  letter-spacing: .08em; color: var(--brand); font-weight: 700;
  border-bottom: 1px solid var(--border);
}
.datatable-table th .sort-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .72rem; font-weight: 700; text-transform: inherit;
  letter-spacing: inherit; color: inherit; background: transparent;
  border: 0; padding: 0; cursor: pointer;
}
.datatable-table th .sort-btn::after {
  content: ''; width: 10px; height: 10px;
  mask: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="none"%3E%3Cpath d="M5.5 7.5 10 3l4.5 4.5M14.5 12.5 10 17l-4.5-4.5" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"/%3E%3C/svg%3E') center/contain no-repeat;
  opacity: .4; transition: all var(--transition-fast);
}
.datatable-table th .sort-btn.is-asc::after { transform: rotate(180deg); opacity: .9; }
.datatable-table th .sort-btn.is-desc::after { opacity: .9; }
.datatable-table th .sort-btn:focus-visible { outline: 2px solid var(--brand-ring); outline-offset: 2px; border-radius: 6px; }
.datatable-table td {
  padding: .85rem 1rem; font-size: .92rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  background: #fff;
  transition: background var(--transition-fast);
}
.datatable-table tbody tr:hover td { background: var(--brand-light); }
.datatable-empty { text-align: center; padding: 2.5rem 1rem; font-size: .92rem; color: var(--text-muted); background: var(--bg-subtle); }
.datatable-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.datatable-status { font-size: .82rem; color: var(--text-muted); }
.datatable-pagination { display: flex; align-items: center; gap: .75rem; }
.page-btn {
  border: 1.5px solid var(--border); background: #fff;
  border-radius: var(--radius-md); padding: .55rem 1.1rem;
  font-weight: 600; font-size: .82rem; color: var(--brand);
  transition: all var(--transition-fast);
  min-width: 110px; display: flex; align-items: center; justify-content: center;
}
.page-btn[disabled] { opacity: .4; pointer-events: none; }
.page-btn:not([disabled]):hover {
  box-shadow: var(--shadow-brand); transform: translateY(-2px); border-color: var(--border-hover);
}
.page-list { display: flex; gap: .35rem; flex-wrap: wrap; }
.page-pill {
  min-width: 40px; height: 38px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); background: #fff;
  color: var(--text-secondary); font-weight: 600; font-size: .82rem;
  display: flex; align-items: center; justify-content: center;
  padding: 0 .6rem; transition: all var(--transition-fast);
}
.page-pill:hover { border-color: var(--border-hover); color: var(--brand); }
.page-pill.is-active {
  background: var(--brand); color: #fff;
  border-color: var(--brand); box-shadow: var(--shadow-brand);
}
.badge-type {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .35rem .8rem; border-radius: 999px;
  font-size: .7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
}
.badge-type.pep { background: rgba(16, 185, 129, .12); color: #059669; }
.badge-type.concursal { background: rgba(245, 158, 11, .12); color: #d97706; }
.badge-type.onu { background: rgba(6, 182, 212, .12); color: #0891b2; }
.badge-type.empleados { background: rgba(139, 92, 246, .12); color: #7c3aed; }

.progress-track { width: 140px; height: 8px; border-radius: 999px; background: var(--bg-subtle); overflow: hidden; }
.progress-fill { height: 100%; border-radius: inherit; background: var(--gradient-accent); }

.status-chip {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .35rem .75rem; border-radius: 999px;
  font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
}
.status-chip.finished { background: rgba(16, 185, 129, .12); color: #059669; }
.status-chip.running { background: rgba(124, 58, 237, .12); color: var(--brand); }
.status-chip.queued { background: rgba(148, 163, 184, .15); color: #64748b; }
.status-chip.error { background: rgba(239, 68, 68, .12); color: #dc2626; }

.action-group { display: flex; justify-content: flex-end; gap: .45rem; }
.action-group .btn { padding: .5rem .85rem; border-radius: var(--radius-sm); font-size: .78rem; }

/* ====================================================================
   KPI STAT CARDS (new)
   ==================================================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.2rem;
}
.kpi-stat {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex; align-items: flex-start; gap: 1rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-smooth);
  position: relative;
  overflow: hidden;
}
.kpi-stat::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 3px; background: var(--gradient-accent); opacity: 0;
  transition: opacity var(--transition-smooth);
}
.kpi-stat:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-hover);
}
.kpi-stat:hover::before { opacity: 1; }
.kpi-icon {
  width: 48px; height: 48px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.kpi-icon svg { width: 24px; height: 24px; }
.kpi-icon.purple { background: rgba(124, 58, 237, .1); color: var(--brand); }
.kpi-icon.cyan { background: rgba(6, 182, 212, .1); color: var(--brand-2); }
.kpi-icon.pink { background: rgba(236, 72, 153, .1); color: var(--brand-3); }
.kpi-icon.green { background: rgba(16, 185, 129, .1); color: #059669; }

.kpi-info { display: flex; flex-direction: column; gap: .2rem; }
.kpi-label { font-size: .72rem; color: var(--text-muted); font-weight: 500; }
.kpi-value { font-size: 1.3rem; font-weight: 800; color: var(--text-primary); line-height: 1.2; }
.kpi-trend {
  display: inline-flex; align-items: center; gap: .25rem;
  font-size: .72rem; font-weight: 600; margin-top: .15rem;
}
.kpi-trend.up { color: #059669; }
.kpi-trend.down { color: #dc2626; }

/* Chart improvements */
.chart-box { height: 240px; }

/* ====================================================================
   ENTRANCE ANIMATIONS
   ==================================================================== */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slide-in-left {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

.animate-fade-up {
  animation: fade-up .5s cubic-bezier(.4, 0, .2, 1) forwards;
  opacity: 0;
}
.animate-fade-in {
  animation: fade-in .6s ease forwards;
  opacity: 0;
}

/* Staggered delays */
.delay-1 { animation-delay: .05s; }
.delay-2 { animation-delay: .1s; }
.delay-3 { animation-delay: .15s; }
.delay-4 { animation-delay: .2s; }
.delay-5 { animation-delay: .25s; }
.delay-6 { animation-delay: .3s; }
.delay-7 { animation-delay: .35s; }
.delay-8 { animation-delay: .4s; }

/* ====================================================================
   RESPONSIVE
   ==================================================================== */
@media (max-width: 1024px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .datatable-card { padding: 1.6rem; }
  .datatable-wrapper { border-radius: var(--radius-md); }
  .datatable-table { min-width: 720px; }
}
@media (max-width: 768px) {
  .app-shell { padding: 0 16px; }
  body > main.app-shell { padding-top: 1.6rem !important; }
  .hero-card { border-radius: var(--radius-lg); }
  .hero-content { padding: 2rem; }
  .hero-footer { padding: 0 2rem 2rem; }
  .hero-stats { grid-template-columns: 1fr; }
  .tab-panel { padding: 1.2rem; }
  .breakdown-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-grid { grid-template-columns: 1fr; }
  .section-header { padding: 1.4rem 1.5rem; }
}
@media (max-width: 640px) {
  .datatable-actions { width: 100%; }
  .datatable-search { flex: 1; }
  .datatable-input { width: 100%; }
  .datatable-per-page { width: 100%; justify-content: space-between; }
  .page-btn { min-width: 0; padding: .5rem .9rem; }
  .menu-row { gap: .15rem; }
  .navpill { padding: .4rem .6rem; font-size: .82rem; }
}

/* ====================================================================
   CARD GRADIENT VARIANT
   ==================================================================== */
.card-gradient {
  background:
    radial-gradient(120% 120% at -10% -10%, rgba(124,58,237,.08), transparent 60%),
    radial-gradient(120% 120% at 110% -20%, rgba(6,182,212,.06), transparent 50%),
    var(--card);
}

/* ====================================================================
   KPI legacy support
   ==================================================================== */
.kpi .label { font-size: .78rem; color: var(--text-muted); }
.kpi .value { font-size: 1.85rem; font-weight: 800; }

/* ====================================================================
   TOAST ENHANCEMENTS
   ==================================================================== */
.toast-container {
  position: fixed; top: 1rem; right: 1rem;
  z-index: 2147483647;
  display: flex; flex-direction: column; gap: .5rem;
}
