/* ERP360 - Versión: v230 */

/* FINANCE PREMIUM MODULE STYLES */.finance-container { padding: 1.5rem; max-width: 1600px; margin: 0 auto; min-height: 100vh; background: #f8fafc; color: #1e293b; }

.finance-header { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  margin-bottom: 1.5rem; 
  background: white;
  padding: 1.25rem 2rem;
  border-radius: 24px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.03);
  border: 1px solid rgba(0,0,0,0.04);
  position: relative;
  overflow: hidden;
}
.finance-header::before {
  content: ''; position: absolute; top: 0; left: 0; width: 6px; height: 100%; background: var(--color-primary);
}
.finance-title-group h1 { 
  font-family: 'Outfit', sans-serif; 
  font-size: 1.8rem; 
  font-weight: 900; 
  color: #0f172a; 
  margin: 0;
  letter-spacing: -0.04em;
  line-height: 1;
}
.finance-subtitle { color: #64748b; font-size: 0.85rem; margin-top: 0.25rem; font-weight: 500; }

.tab-nav { 
  display: flex; 
  background: #f1f5f9; 
  padding: 0.4rem; 
  border-radius: 16px; 
  gap: 0.5rem;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.05);
}
.tab-link { 
  padding: 0.6rem 1.25rem; 
  border-radius: 12px; 
  font-weight: 800; 
  font-size: 0.85rem; 
  cursor: pointer; 
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
  border: none; 
  background: transparent; 
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: 0.01em;
}
.tab-link i { width: 16px; height: 16px; opacity: 0.7; }
.tab-link.active { 
  background: white; 
  color: var(--color-primary); 
  box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}
.tab-link.active i { opacity: 1; }

/* BANNERS ESTADÍSTICOS PREMIUM EN PESTAÑAS */
.finance-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 20px;
  padding: 1rem 1.75rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.02);
  border: 1px solid rgba(0,0,0,0.04);
  animation: fadeIn 0.4s ease-out;
}
.finance-banner-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.finance-banner-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.finance-banner-text {
  display: flex;
  flex-direction: column;
}
.finance-banner-label {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.15rem;
}
.finance-banner-desc {
  font-size: 0.8rem;
  opacity: 0.8;
  font-weight: 500;
}
.finance-banner-value {
  font-size: 1.8rem;
  font-weight: 900;
  font-family: 'Outfit', sans-serif;
  letter-spacing: -0.02em;
}

/* Variaciones de colores para Banners */
.banner-liquidez {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: white;
  border: none;
}
.banner-liquidez .finance-banner-icon { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }
.banner-liquidez .finance-banner-label { color: #94a3b8; }
.banner-liquidez .finance-banner-desc { color: #64748b; }
.banner-liquidez .finance-banner-value { color: #38bdf8; }

.banner-cobrar {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}
.banner-cobrar .finance-banner-icon { background: #d1fae5; color: #059669; }
.banner-cobrar .finance-banner-label { color: #059669; }
.banner-cobrar .finance-banner-desc { color: #065f46; opacity: 0.7; }
.banner-cobrar .finance-banner-value { color: #047857; }

.banner-pagar {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #9f1239;
}
.banner-pagar .finance-banner-icon { background: #ffe4e6; color: #e11d48; }
.banner-pagar .finance-banner-label { color: #e11d48; }
.banner-pagar .finance-banner-desc { color: #9f1239; opacity: 0.7; }
.banner-pagar .finance-banner-value { color: #be123c; }

.finance-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5rem; margin-bottom: 3.5rem; }
.stat-card { 
  padding: 2.5rem; 
  border-radius: 32px; 
  background: white; 
  border: 1px solid rgba(0,0,0,0.04);
  box-shadow: 0 20px 40px rgba(0,0,0,0.02);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 200px;
  transition: transform 0.3s;
}
.stat-card:hover { transform: translateY(-5px); }
.stat-card.accent { 
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%); 
  color: white; 
  border: none;
}
.stat-label { font-size: 0.75rem; font-weight: 800; text-transform: uppercase; color: #94a3b8; letter-spacing: 0.12em; margin-bottom: 0.5rem; display: flex; align-items: center; gap: 0.5rem; }
.stat-card.accent .stat-label { color: rgba(255,255,255,0.6); }
.stat-value { font-size: 2.8rem; font-weight: 900; font-family: 'Outfit', sans-serif; letter-spacing: -0.04em; }
.stat-trend { margin-top: auto; font-size: 0.85rem; padding-top: 1.5rem; border-top: 1px solid #f1f5f9; color: #64748b; font-weight: 600; display: flex; align-items: center; gap: 0.5rem; }
.stat-card.accent .stat-trend { border-top-color: rgba(255,255,255,0.1); color: rgba(255,255,255,0.5); }/* SISTEMA DE PÍLDORAS BANCARIAS SLIM (Alternativa 1) */
.bank-pills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2.5rem;
}
.bank-pill-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: white;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 16px;
  padding: 0.6rem 1.15rem;
  min-height: 62px;
  height: auto;
  min-width: 290px;
  flex: 1 1 calc(25% - 1rem); /* Hace que quepan unas 4 en horizontal en pantallas grandes */
  cursor: pointer;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 5px rgba(0,0,0,0.015);
}
@media (max-width: 1200px) {
  .bank-pill-item { flex: 1 1 calc(33.33% - 1rem); }
}
@media (max-width: 768px) {
  .bank-pill-item { flex: 1 1 100%; }
}
.bank-pill-item:hover,
.bank-pill-item:focus-within {
  transform: translateY(-2px);
  border-color: rgba(0,0,0,0.12);
  box-shadow: 0 8px 15px -3px rgba(0,0,0,0.05);
  z-index: 10;
}
.bank-pill-item.active {
  border-color: var(--color-primary);
  background: #f0fdf4; /* Tono de verde suave acorde a ERP360 primary #10b981 */
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.08);
}
.bank-pill-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 135px;
  flex: 1;
  flex-shrink: 0;
}
.bank-pill-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #f1f5f9;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  flex-shrink: 0;
  font-family: 'Outfit', sans-serif;
  transition: all 0.3s;
  border: 1px solid rgba(0,0,0,0.03);
}
.bank-pill-item.active .bank-pill-avatar {
  background: var(--color-primary);
  color: white;
}
.bank-pill-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.bank-pill-name {
  font-size: 0.85rem;
  font-weight: 800;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}
.bank-pill-number {
  font-size: 0.7rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.1rem;
}
.bank-pill-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: 0.75rem;
}
.bank-pill-balance {
  font-size: 1.1rem;
  font-weight: 900;
  font-family: 'Outfit', sans-serif;
  color: #0f172a;
  white-space: nowrap;
}
.bank-pill-item.active .bank-pill-balance {
  color: #047857; /* Verde esmeralda para el saldo activo */
}

.log-section { background: white; border-radius: 32px; padding: 2.5rem; border: 1px solid rgba(0,0,0,0.05); box-shadow: 0 4px 20px rgba(0,0,0,0.02); }
.bank-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.8rem;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 0.8rem;
  font-weight: 700;
  color: #475569;
}
.bank-dot { width: 8px; height: 8px; border-radius: 50%; }

.wizard-step { background: white; border-radius: 32px; padding: 3rem; border: 1px solid rgba(0,0,0,0.05); margin-bottom: 2.5rem; position: relative; }
.wizard-step-title { font-size: 1.5rem; font-weight: 900; font-family: 'Outfit', sans-serif; margin-bottom: 2.5rem; display: flex; align-items: center; gap: 1.25rem; color: #0f172a; }
.step-number { width: 36px; height: 36px; border-radius: 12px; background: var(--color-primary); color: white; display: flex; align-items: center; justify-content: center; font-size: 1rem; font-weight: 900; }

.bulk-footer-sticky {
  position: sticky;
  bottom: 2rem;
  background: rgba(15, 23, 42, 0.95);
  /* backdrop-filter: blur(12px); */
  color: white;
  padding: 2rem 3rem;
  border-radius: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  z-index: 100;
  margin-top: 4rem;
  border: 1px solid rgba(255,255,255,0.1);
}

/* Dropdown Menus en Tarjetas */
.dropdown-container { position: relative; z-index: 1001; }
.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  min-width: 180px;
  border-radius: 12px;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--color-border);
  padding: 8px;
  z-index: 1000;
  display: none;
  animation: fadeIn 0.2s ease;
}
.dropdown-container:focus-within .dropdown-menu,
.dropdown-container:hover .dropdown-menu { display: block !important; }
.dropdown-menu button {
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--color-text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s;
}
.dropdown-menu button:hover { background: #f1f5f9; color: var(--color-primary); }
.dropdown-menu hr { border: 0; border-top: 1px solid #f1f5f9; margin: 6px 0; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

.monto-egre { color: #f43f5e; font-weight: 900; }
.monto-ingre { color: #10b981; font-weight: 900; }

@keyframes float { 0% { transform: translateY(0px); } 50% { transform: translateY(-10px); } 100% { transform: translateY(0px); } }
.float-animate { animation: float 4s ease-in-out infinite; }

.premium-table-v230 { width: 100%; border-collapse: separate; border-spacing: 0 0.5rem; }
.premium-table-v230 th { padding: 1rem; font-size: 0.75rem; font-weight: 800; text-transform: uppercase; color: #94a3b8; text-align: left; }
.premium-table-v230 td { background: white; padding: 1.25rem 1rem; border-top: 1px solid #f1f5f9; border-bottom: 1px solid #f1f5f9; }
.premium-table-v230 td:first-child { border-left: 1px solid #f1f5f9; border-radius: 12px 0 0 12px; }
.premium-table-v230 td:last-child { border-right: 1px solid #f1f5f9; border-radius: 0 12px 12px 0; }

.tr-row:hover td { background: #f8fafc; }

.type-pill { 
  padding: 0.35rem 0.75rem; 
  border-radius: 8px; 
  font-size: 0.7rem; 
  font-weight: 800; 
  text-transform: uppercase;
}
.pill-compra { background: #eff6ff; color: #2563eb; }
/* Cuentas Pendientes specialized styles */
.cuentas-pendientes-view {
  animation: fadeIn 0.4s ease-out;
}

.entidad-section {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.entidad-section:hover {
  border-color: var(--color-primary-light) !important;
  box-shadow: var(--shadow-md);
}

.entidad-header:hover {
  background-color: #f1f5f9 !important;
}

/* Premium Table V230 adjustments */
.premium-table-v230 tr.vencido {
  background-color: rgba(239, 68, 68, 0.03);
}

.premium-table-v230 tr.vencido:hover {
  background-color: rgba(239, 68, 68, 0.06) !important;
}

.premium-table-v230 tr.vencido td {
  border-left: 3px solid #ef4444;
}

.icon-btn-lite {
  background: none;
  border: none;
  color: #94a3b8;
  padding: 6px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.icon-btn-lite:hover {
  background-color: #f1f5f9;
  color: var(--color-primary);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.pill-rendicion { background: #fef2f2; color: #dc2626; }
.pill-anticipo { background: #f0fdf4; color: #16a34a; }

@media (max-width: 1024px) {
  .cards-container { grid-template-columns: 1fr; }
  .finance-stats { grid-template-columns: 1fr; }
}

/* Dropdown Menu for Bank Cards */
.dropdown-container {
  position: relative;
  display: inline-block;
}
.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  min-width: 200px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  border-radius: 16px;
  padding: 0.75rem;
  z-index: 1000;
  border: 1px solid #f1f5f9;
  list-style: none;
  margin-top: 0.5rem;
}
.dropdown-container:hover .dropdown-menu {
  display: block;
  animation: ripple-in 0.3s ease;
}
.dropdown-menu button {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 1rem;
  border: none;
  background: transparent;
  color: #475569;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border-radius: 10px;
  transition: all 0.2s;
  text-align: left;
}
.dropdown-menu button:hover {
  background: #f8fafc;
  color: var(--color-primary);
  padding-left: 1.25rem;
}
.dropdown-menu button i {
  width: 16px;
  height: 16px;
  opacity: 0.7;
}
.dropdown-menu hr {
  margin: 0.5rem 0;
  border: none;
  border-top: 1px solid #f1f5f9;
}

/* Small Action Buttons for Table */
.btn-icon-lite.small {
  width: 32px;
  height: 32px;
  padding: 6px;
}
.btn-icon-lite.small i {
  width: 14px;
  height: 14px;
}
.text-danger { color: #f43f5e !important; }
.text-danger:hover { background: #fff1f2 !important; }


.force-desktop {
  width: 100vw !important;
}

.force-desktop #app-container {
  display: flex !important;
  flex-direction: row !important;
}

.force-desktop .mobile-header {
  display: none !important;
}

.force-desktop .sidebar {
  position: static !important;
  left: 0 !important;
  display: flex !important;
  width: 280px !important;
}

.force-desktop .main-content {
  padding: 32px 48px !important;
}

.force-desktop .grid-cols-2 {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
}

.grid-cols-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.grid-cols-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.grid-cols-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.grid-cols-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; }

@media (max-width: 768px) {
  .grid-cols-2, .grid-cols-3, .grid-cols-4, .grid-cols-5, .grid-purchase-detail {
    grid-template-columns: 1fr !important;
  }
}

.grid-purchase-detail {
  display: grid;
  grid-template-columns: 3fr 1fr 1fr;
  gap: 1rem;
}

.force-desktop .modal-content {
  max-width: 1300px !important;
  width: 95% !important;
}

.force-desktop .form-container,
.force-desktop .crud-view {
  max-width: 1300px !important;
}

.force-desktop .sidebar-backdrop {
  display: none !important;
}

.force-mobile .mobile-header { display: flex !important; }
.force-mobile .hide-mobile { display: none !important; }
.force-mobile .sidebar { position: fixed !important; left: -100% !important; transition: left 0.3s !important; }
.force-mobile .sidebar.open { left: 0 !important; }
.force-mobile .main-content { padding: 16px !important; }
.force-mobile .grid-cols-2 { grid-template-columns: 1fr !important; }

html {
  font-size: 14px;
}

:root {
  --sidebar-width: 280px;
  --color-bg: #f8fafc;
  --color-surface: #ffffff;
  --color-border: #e2e8f0;
  --color-text-main: #0f172a;
  --color-text-muted: #64748b;
  
  /* Vibrant Emerald Palette */
  --color-primary: #10b981;
  --color-primary-rgb: 16, 185, 129;
  --color-primary-hover: #059669;
  --color-primary-dark: #064e3b;
  --color-accent: #34d399;
  
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-error: #ef4444;

  --color-hover: #f1f5f9;
  --font-family: 'Inter', system-ui, -apple-system, sans-serif;
  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --radius-pill: 9999px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.03), 0 8px 24px -4px rgba(0, 0, 0, 0.04);
}

/* Utils Financieros */
.btn-action {
  padding: 10px 20px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px;
}

.btn-action.btn-success { background-color: #10b981; color: white; }
.btn-action.btn-danger { background-color: #ef4444; color: white; }
.btn-action:hover { transform: translateY(-2px); filter: brightness(1.1); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }

.finance-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.finance-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--color-bg);
  color: var(--color-text-main);
  height: 100vh;
  display: flex;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app {
  display: flex;
  width: 100%;
  height: 100vh;
}

/* App Layout - Contenedor Principal Autenticado */
.app-layout {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background-color: var(--color-bg);
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background-color: #064e3b; /* Emerald darker bg */
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 32px 16px;
  overflow-y: auto;
  color: white;
  z-index: 1000;
}

/* Visibility Utils */
@media (min-width: 1024px) {
  .lg-only { display: flex !important; }
  .md-only { display: none !important; }
  .lg-hidden { display: none !important; }
}

@media (max-width: 1023px) {
  .lg-only { display: none !important; }
  .md-only { display: flex !important; }
  .md-hidden { display: none !important; }
}

/* Top Navbar */
.top-navbar {
  min-height: 62px;
  background: linear-gradient(135deg, #064e3b 0%, #032e24 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.18);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 1001;
  flex-shrink: 0;
}

@media (max-width: 1400px) {
  .top-navbar {
    padding: 0 16px;
    gap: 12px;
  }
}

.navbar-brand-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.navbar-brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.15;
}

.navbar-brand.brand-interactive {
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 10px;
  transition: all 0.2s ease;
  user-select: none;
}

.navbar-brand.brand-interactive:hover {
  background: rgba(255, 255, 255, 0.1);
}

.brand-company-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

.brand-chevron {
  width: 13px;
  height: 13px;
  color: #34d399;
  transition: transform 0.2s ease;
}

.brand-chevron.rotate {
  transform: rotate(180deg);
}

/* Menú flotante del Holding */
.holding-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 320px;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 16px 36px -4px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(15, 23, 42, 0.08);
  padding: 10px;
  z-index: 3000;
  border: 1px solid #e2e8f0;
  animation: fadeInDropdown 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.holding-dropdown-header {
  padding: 6px 10px 10px;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 6px;
}

.holding-header-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #065f46;
  background: #d1fae5;
  padding: 2px 8px;
  border-radius: 6px;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.holding-header-sub {
  display: block;
  font-size: 0.76rem;
  color: #64748b;
  font-weight: 500;
}

.holding-items-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.holding-company-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: #ffffff;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.holding-company-btn:hover {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.holding-company-btn.current {
  background: #f0fdf4;
  border-color: #86efac;
}

.holding-btn-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.holding-emoji {
  font-size: 1.35rem;
  line-height: 1;
  flex-shrink: 0;
}

.holding-texts {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.holding-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}

.holding-company-btn.current .holding-title {
  color: #065f46;
}

.holding-sub {
  font-size: 0.72rem;
  color: #64748b;
  margin-top: 1px;
}

.holding-current-tag {
  font-size: 0.7rem;
  font-weight: 700;
  color: #059669;
  background: #d1fae5;
  padding: 2px 6px;
  border-radius: 6px;
}

.holding-arrow {
  width: 15px;
  height: 15px;
  color: #94a3b8;
}

.holding-divider {
  height: 1px;
  background: #f1f5f9;
  margin: 6px 0;
}

.holding-consolidated-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid #e0e7ff;
  background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.holding-consolidated-btn:hover {
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  border-color: #c7d2fe;
}

.holding-consolidated-btn.active {
  background: #e0e7ff;
  border-color: #6366f1;
}

.holding-consolidated-btn .holding-title {
  color: #3730a3;
}

.brand-title {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: white;
}

/* Marca ERP360 (isotipo igual al sitio erp360.cl) */
.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-text-col {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-logo-box {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #10b981, #047857);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 6px 16px -4px rgba(16, 185, 129, 0.45);
}

.brand-logo-box i[data-lucide] {
  width: 20px;
  height: 20px;
}

.brand-accent {
  color: #34d399;
  margin-left: 1px;
}

.brand-company {
  font-size: 0.72rem;
  font-weight: 700;
  color: #34d399;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.navbar-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: flex-start;
  flex-wrap: nowrap;
  overflow: visible;
  padding: 6px 4px 6px 4px;
  margin: 0 16px;
}

.nav-group-container {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.nav-link {
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 7px 16px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1.5px solid transparent;
  background: transparent;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 7px;
}

@media (max-width: 1400px) {
  .nav-link {
    padding: 6px 12px;
    font-size: 0.84rem;
    gap: 6px;
  }
}

.nav-link:hover,
.nav-link.dropdown-open {
  color: white;
  background-color: rgba(255, 255, 255, 0.12);
}

.nav-link.active {
  color: #ffffff;
  background: rgba(16, 185, 129, 0.22);
  border: 1.5px solid #34d399;
  box-shadow: 0 0 14px rgba(52, 211, 153, 0.35);
  font-weight: 700;
}

.nav-link .nav-chevron {
  width: 13px;
  height: 13px;
  margin-left: 2px;
  opacity: 0.65;
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link .nav-chevron.rotate {
  transform: rotate(180deg);
  opacity: 1;
}

.nav-badge {
  background: #ef4444;
  color: white;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 9999px;
  line-height: 1.2;
}

/* Menú flotante moderno para grupos */
.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 260px;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 16px 36px -4px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(15, 23, 42, 0.08);
  padding: 8px;
  z-index: 2500;
  display: flex;
  flex-direction: column;
  gap: 3px;
  border: 1px solid #e2e8f0;
  animation: fadeInDropdown 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-dropdown-menu.align-right {
  left: auto;
  right: 0;
}

.nav-dropdown-mobile-title {
  display: none;
}

@keyframes fadeInDropdown {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: #1e293b;
  font-size: 0.86rem;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: all 0.16s ease;
}

.nav-dropdown-item:hover {
  background-color: #f1f5f9;
  color: #065f46;
}

.nav-dropdown-item.active {
  background-color: #ecfdf5;
  color: #047857;
  font-weight: 700;
}

.nav-dropdown-icon-box {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.16s ease;
}

.nav-dropdown-item:hover .nav-dropdown-icon-box {
  background: #d1fae5;
}

.nav-dropdown-item.active .nav-dropdown-icon-box {
  background: #10b981;
}

.nav-dropdown-icon {
  width: 17px;
  height: 17px;
  color: #64748b;
  transition: color 0.16s ease;
}

.nav-dropdown-item:hover .nav-dropdown-icon {
  color: #059669;
}

.nav-dropdown-item.active .nav-dropdown-icon {
  color: #ffffff;
}

.nav-dropdown-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.nav-dropdown-label {
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  line-height: 1.25;
}

.nav-dropdown-desc {
  font-size: 0.72rem;
  color: #64748b;
  margin-top: 2px;
  line-height: 1.2;
  white-space: normal;
  font-weight: 400;
}

.navbar-right-group {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.company-selector-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px 16px;
  border-radius: 9999px;
  color: white;
  font-size: 0.85rem;
  font-weight: 600;
  backdrop-filter: blur(4px);
  cursor: default;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.company-selector-pill:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(52, 211, 153, 0.4);
}

.navbar-user {
  display: flex;
  align-items: center;
  gap: 12px;
}
.avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.icon-btn-lite {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: all 0.2s;
}

.icon-btn-lite:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

/* Dropdown */
.nav-dropdown {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}

.dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: white;
  min-width: 220px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  border-radius: 12px;
  padding: 8px;
  z-index: 1002;
  border: 1px solid var(--color-border);
}

.nav-dropdown:hover .dropdown-content {
  display: block;
}

.dropdown-content a {
  display: block;
  padding: 10px 16px;
  color: var(--color-text-main);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.dropdown-content a:hover {
  background-color: #f1f5f9;
  color: var(--color-primary);
  transform: translateX(4px);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: flex-end; /* Alinear botón de cerrar a la derecha */
  padding: 10px 12px; /* Reducido sustancialmente */
}

.sidebar-header .logo-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #10b981, #059669);
  border-radius: var(--radius);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.nav-group {
  margin-bottom: 28px;
}

.nav-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 0 12px 12px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px; /* Reducido de 10px a 8px */
  border-radius: var(--radius);
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem; /* Reducido ligeramente */
  margin-bottom: 2px; /* Reducido de 4px a 2px */
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: white;
  transform: translateX(4px);
}

.nav-item.active {
  background: linear-gradient(90deg, #10b981, #059669);
  color: white;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.nav-item svg {
  width: 20px;
  height: 20px;
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px 20px; /* Reducido */
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-version-footer {
  padding: 8px 20px;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.3);
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 180px;
  overflow: hidden;
}

.user-info .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.user-info .details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.user-info .name {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-info .role {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
}

.logout-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s;
}

.logout-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  background-color: var(--color-bg);
}

.content-wrapper {
  flex: 1;
  padding: 24px 32px; /* Reducido para más amplitud */
  overflow-y: auto;
  width: 100%;
}

.top-header {
  height: 72px;
  background-color: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  flex-shrink: 0;
  z-index: 10;
}

/* Shared Layout Utilities */
.text-right { text-align: right !important; }
.search-container { position: relative; display: flex; align-items: center; }
.search-container i { 
  position: absolute; 
  left: 1.25rem; 
  top: 50%; 
  transform: translateY(-50%); 
  color: #94a3b8;
  pointer-events: none;
}
.search-input { padding-left: 3.5rem !important; }

/* Compras Header Polish */
.compras-header {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 1.5rem !important;
  align-items: center !important;
  justify-content: space-between !important;
}
.compras-title-group { flex: 1; min-width: 300px; }
.compras-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }

/* Hidden upload input fix */
.hidden-upload {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.header-search:focus-within {
  border-color: var(--color-primary);
  background-color: white;
  box-shadow: var(--shadow-sm);
}

.header-search input {
  background: none;
  border: none;
  width: 100%;
  font-size: 0.95rem;
  color: var(--color-text-main);
  outline: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  /* Ensure header actions are properly aligned */
}

/* Consistent module header alignment */
.view-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  justify-content: flex-end;
  flex-wrap: wrap; /* Added to prevent overlap */
  height: auto; /* Changed from fixed height */
  min-height: 44px;
  position: relative;
  z-index: 20;
}

.view-header-actions .header-search-container,
.view-header-actions .form-control,
.view-header-actions .btn,
.view-header-actions select,
.view-header-actions input {
  height: 40px !important;
  display: flex !important;
  align-items: center !important;
  margin-bottom: 0 !important;
  box-sizing: border-box !important;
}

.view-header-actions .header-search-container {
  min-width: 300px;
}

.header-search-container {
  position: relative;
  height: 40px;
}

.header-search-container i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--color-text-muted);
  pointer-events: none;
  z-index: 5;
}

.header-search-container input {
  width: 100%;
  height: 100%;
  padding: 0 12px 0 38px;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background-color: var(--color-surface);
  font-size: 0.9rem;
  transition: all 0.2s;
  box-sizing: border-box;
}

.action-buttons-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.action-btn {
  padding: 10px;
  color: var(--color-text-muted);
  border-radius: 12px;
  transition: all 0.2s;
  position: relative;
  border: none;
  background: none;
  cursor: pointer;
}

.action-btn:hover {
  background-color: var(--color-bg);
  color: var(--color-primary);
}

.action-btn .badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background-color: var(--color-error);
  color: white;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--color-surface);
}

.page-header, .view-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start; /* Better alignment for wrapping */
  margin-bottom: 24px;
  gap: 20px;
  flex-wrap: wrap; /* Added to prevent overlap */
}

.view-header-info h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-text-main);
  margin-bottom: 4px;
}

.view-header-info p {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}


.header-search-container input:focus {
  border-color: var(--color-primary);
  background-color: white;
  box-shadow: var(--shadow-sm);
  outline: none;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  border: 1px solid var(--color-border);
  background-color: var(--color-surface);
  color: var(--color-text-main);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
}

.btn:hover {
  background-color: var(--color-hover);
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  border: none;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #059669, #047857);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35);
}

.btn-danger {
  color: white;
  background-color: #ef4444;
  border-color: #ef4444;
}

.btn-danger:hover {
  background-color: #dc2626;
}

.btn-secondary {
  background-color: #64748b;
  color: white;
  border-color: #64748b;
}

.btn-secondary:hover {
  background-color: #475569;
  border-color: #475569;
}

.btn-outline {
  background-color: transparent;
  border-color: var(--color-border);
  color: var(--color-text-main);
  box-shadow: none;
}

.btn-outline:hover {
  background-color: var(--color-hover);
  border-color: #cbd5e1;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.75rem;
  gap: 4px;
}

/* ERP360 - VERSION v230 */
.form-container {
  max-width: 1000px;
  margin: 0 auto;
}

.items-table-container {
  margin-top: 1.5rem;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.totals-card {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.info-box p {
  margin: 4px 0;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal-content {
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  max-width: 900px;
  width: 95%;
}

.modal-huge {
  max-width: 1200px !important;
}

.product-tag-inline {
  display: inline-block;
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  margin: 2px;
  border: 1px solid #e2e8f0;
  color: #475569;
}

.btn-group {
  display: flex;
  gap: 8px;
}

.btn-success {
  color: white;
  background-color: #22c55e;
}

.btn-success:hover {
  background-color: #16a34a;
}

.input-sm {
  padding: 4px 8px;
  font-size: 0.9rem;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}

.badge-success {
  background-color: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.badge-warning {
  background-color: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.badge-info {
  background-color: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.badge-secondary {
  background-color: rgba(100, 116, 139, 0.1);
  color: #64748b;
}

.badge-danger {
  background-color: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* Cards & Tables */
.card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03), 0 8px 20px rgba(0, 0, 0, 0.03);
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.table-container {
  width: 100%;
  overflow-x: auto !important;
  position: relative;
  /* Scrollbar visible siempre en Windows para evitar que se pierdan columnas */
  scrollbar-width: thin;
  scrollbar-color: var(--color-primary) transparent;
}

.table-container::-webkit-scrollbar {
  height: 6px;
}

.table-container::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 9999px;
}

.table-container::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
  border: 1px solid #f1f5f9;
}

.table-container::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  min-width: 800px; /* Asegura un ancho mínimo para que no se amontone */
}

th {
  background-color: #f8fafc;
  padding: 12px 20px;
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--color-text-muted);
  font-weight: 700;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--color-border);
}

td {
  padding: 14px 20px;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-main);
  transition: background-color 0.15s ease;
}

tr:hover td {
  background-color: rgba(16, 185, 129, 0.025);
}

tr:last-child td {
  border-bottom: none;
}

.actions {
  display: flex;
  gap: 6px;
  align-items: center;
  white-space: nowrap;
}
.icon-btn {
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.2);
  cursor: pointer;
  color: #475569;
  padding: 6px;
  border-radius: 8px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  min-height: 32px;
  width: 32px;
  height: 32px;
}
.icon-btn:hover {
  background-color: #f1f5f9;
  color: var(--color-primary);
  border-color: var(--color-primary);
  transform: translateY(-1px);
}
.icon-btn.edit {
  color: #0284c7;
  background: rgba(2, 132, 199, 0.08);
  border-color: rgba(2, 132, 199, 0.25);
}
.icon-btn.edit:hover {
  background: rgba(2, 132, 199, 0.18);
  color: #0369a1;
  border-color: #0284c7;
}
.icon-btn.delete {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.25);
}
.icon-btn.delete:hover {
  color: #dc2626;
  background-color: #fee2e2;
  border-color: #ef4444;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--color-text-main);
}

.form-control, .form-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--color-text-main);
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  transition: all 0.2s;
  background-color: var(--color-surface);
}

select.form-control, select.form-input {
  padding-top: 6px;
  padding-bottom: 6px;
  line-height: 1.4;
  box-sizing: border-box;
}

.form-control:focus, .form-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
}

.input-numeric {
  font-size: 1.1rem;
  font-weight: 600;
  padding: 8px 12px;
  text-align: center;
  color: var(--color-primary);
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 24px;
}

.modal-content {
  background-color: var(--color-surface);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 550px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  animation: modalScale 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalScale {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-lg .modal-content {
  max-width: 900px;
}

.modal-header {
  padding: 24px 32px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text-main);
  letter-spacing: -0.02em;
}

.modal-body {
  padding: 32px;
  overflow-y: auto;
}

.modal-footer {
  padding: 20px 32px;
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background-color: #f8fafc;
  border-radius: 0 0 20px 20px;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-top: 32px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--color-primary);
  color: var(--color-text-main);
  display: inline-block;
}

.grid-cols-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.dynamic-list-item {
  border: 1px solid var(--color-border);
  padding: 24px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  background-color: #f8fafc;
  position: relative;
  transition: all 0.2s;
}

.dynamic-list-item:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-md);
}

.remove-dynamic {
  position: absolute;
  top: 12px;
  right: 12px;
}

/* Modifiers - Layout tweaks for mobile */
.mobile-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background-color: #064e3b;
  color: white;
  z-index: 40;
}

.sidebar-backdrop {
  display: none;
}

@media (max-width: 768px) {
  .mobile-header { display: flex; }
  .hide-mobile { display: none !important; }

  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: -100%;
    z-index: 100;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .sidebar.open { left: 0; }

  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(15, 23, 42, 0.6);
    /* backdrop-filter: blur(2px); */
    z-index: 90;
  }
  .sidebar-backdrop.open { display: block; }

  .main-content { padding: 16px; }
  .grid-cols-2 { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 16px; }

  /* OC tabla/cards responsive */
  .oc-table-desktop { display: none !important; }
  .oc-cards-mobile { display: block !important; }

  /* Formulario OC en móvil */
  .form-container { max-width: 100%; }
  .form-grid { grid-template-columns: 1fr !important; }
}

/* === OC Cards (Vista Móvil) === */
.oc-cards-mobile {
  display: none; /* Oculto en escritorio, se muestra solo en móvil via media query */
  padding: 12px;
}

.oc-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s;
}

.oc-card:last-child { margin-bottom: 0; }

.oc-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: linear-gradient(90deg, #f0fdf4, #ecfdf5);
  border-bottom: 1px solid var(--color-border);
}

.oc-card-num {
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-primary);
}

.oc-card-body {
  padding: 12px 16px;
}

.oc-card-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 6px 0;
  border-bottom: 1px solid #f1f5f9;
}
.oc-card-row:last-child { border-bottom: none; }

.oc-card-label {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
  margin-right: 12px;
}

.oc-card-value {
  font-size: 0.9rem;
  color: var(--color-text-main);
  text-align: right;
}

.oc-card-actions {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  background: #f8fafc;
  border-top: 1px solid var(--color-border);
  flex-wrap: wrap;
}

.oc-card-actions .btn {
  flex: 1;
  min-width: 90px;
  justify-content: center;
}


/* === Inventario Movimientos === */
.row-clickable:hover { 
  background: rgba(16, 185, 129, 0.08); 
  cursor: pointer;
}
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* === App Launcher / Menu === */
.app-launcher-wrapper {
  background-color: var(--color-bg);
}

.app-launcher-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
  padding-bottom: 40px;
}

.app-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 18px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 16px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03), 0 6px 16px rgba(0, 0, 0, 0.03);
  position: relative;
  overflow: hidden;
}

.app-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.app-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px -4px rgba(16, 185, 129, 0.12), 0 4px 12px rgba(0, 0, 0, 0.05);
  border-color: rgba(16, 185, 129, 0.4);
}

.app-card:hover::before {
  opacity: 1;
}

.app-card-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

.app-card-icon svg {
  width: 32px;
  height: 32px;
}

.app-card:hover .app-card-icon {
  transform: scale(1.1);
}

.app-card-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-text-main);
  transition: color 0.3s ease;
}

.app-card:hover .app-card-title {
  color: var(--color-primary);
}


/* Loading Spinners */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(16, 185, 129, 0.1);
  border-radius: 50%;
  border-top-color: var(--color-primary);
  animation: spin 0.8s linear infinite;
}

.view-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
}

.spinner-large {
  width: 48px;
  height: 48px;
  border: 4px solid var(--color-border);
  border-radius: 50%;
  border-top-color: var(--color-primary);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}


/* Base Utils */
[v-cloak] { display: none !important; }

#login-container {
  min-height: 100vh;
  width: 100vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top right, #064e3b, #022c22);
  color: white;
  text-align: center;
  padding: 20px;
}

#login-container h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, white, #34d399);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.04em;
}

#login-container p {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 2rem;
  max-width: 400px;
}

#login-container button {
  background: white;
  color: #064e3b;
  border: none;
  padding: 16px 40px;
  border-radius: 16px;
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  margin: 0 auto;
}

#login-container button:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 35px rgba(0,0,0,0.4);
  background: #f0fdf4;
}

#login-container button::before {
  content: "";
  width: 24px;
  height: 24px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath fill='%23EA4335' d='M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z'/%3E%3Cpath fill='%234285F4' d='M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v230.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z'/%3E%3Cpath fill='%23FBBC05' d='M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24s.92 7.54 2.56 10.78l7.97-6.19z'/%3E%3Cpath fill='%2334A853' d='M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z'/%3E%3Cpath fill='none' d='M0 0h48v230H0z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

.loading-screen {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top right, #064e3b, #022c22);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  z-index: 9999;
}

.loader-content {
  text-align: center;
}

.spinner-large {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255,255,255,0.1);
  border-top-color: #34d399;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

.glass-card {
  background: rgba(255, 255, 255, 0.05);
  /* backdrop-filter: blur(12px); */
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 40px;
  border-radius: 24px;
}

@keyframes spin { to { transform: rotate(360deg); } }
@font-face { font-family: 'Outfit'; font-display: swap; }

@media (min-width: 1024px) {
  .lg-hidden { display: none !important; }
}

.outfit { font-family: 'Outfit', sans-serif; }

/* ERP360 Styles v230 */
.search-container {
  position: relative;
  width: 100%;
}
.search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: var(--shadow-xl);
  z-index: 2100;
  max-height: 250px;
  overflow-y: auto;
  margin-top: 4px;
  padding: 8px;
}
.search-dropdown-item {
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.search-dropdown-item:hover {
  background-color: #f1f5f9;
}
.search-dropdown-item .item-main {
  font-weight: 600;
  color: var(--color-text-main);
  font-size: 0.95rem;
}
.search-dropdown-item .item-sub {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.6);
  /* backdrop-filter: blur(4px); */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-container {
  background-color: var(--color-surface);
  border-radius: 20px;
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.modal-xl {
  max-width: 1200px;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: white;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text-main);
  margin: 0;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background-color: #f8fafc;
}

@keyframes scaleIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.animate-scaleIn {
  animation: scaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.badge-notify {
    background: var(--color-error);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}


/* MAESTROS / CATALOGOS GRID */
.maestros-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  padding: 1rem 0;
}

.maestro-card {
  background: white;
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--color-border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.maestro-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 20px -5px rgba(0,0,0,0.1);
  border-color: var(--color-primary-light);
}

.maestro-card-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.maestro-card-icon i {
  width: 28px;
  height: 28px;
}

.maestro-card-info {
  flex: 1;
}

.maestro-card-info h3 {
  margin: 0 0 0.25rem 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e293b;
}

.maestro-card-info p {
  margin: 0;
  font-size: 0.85rem;
  color: #64748b;
  line-height: 1.4;
}

/* VIEW LAYOUTS */
.view-container {
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 1.5rem;
}

.view-header-info h1 {
  margin: 0;
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--color-text-main);
}

.view-header-info p {
  margin: 0.25rem 0 0 0;
  color: #64748b;
  font-size: 0.95rem;
}

/* Unauthorized Access Screen Styles */
.unauthorized-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8faf9;
    z-index: 9999;
    padding: 24px;
}

.unauthorized-card {
    background: white;
    padding: 48px;
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.08);
    text-align: center;
    max-width: 480px;
    width: 100%;
    border: 1px solid #e2e8f0;
    animation: fadeIn 0.4s ease-out;
}

.unauthorized-card i {
    display: block;
    margin: 0 auto;
}

.btn-primary {
    background: #10b981;
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-primary:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
}

/* SISTEMA DE IMPORTACIÓN BANCARIA Y SMART MATCHING */
.drag-drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px dashed #cbd5e1;
  border-radius: 20px;
  padding: 2rem;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.drag-drop-zone:hover, .drag-drop-zone.dragover {
  border-color: var(--color-primary);
  background: rgba(16, 185, 129, 0.03);
  transform: translateY(-2px);
}
.drag-drop-zone i {
  color: #94a3b8;
  margin-bottom: 0.75rem;
  transition: color 0.3s, transform 0.3s;
}
.drag-drop-zone:hover i, .drag-drop-zone.dragover i {
  color: var(--color-primary);
  transform: scale(1.1);
}
.preview-table-container {
  margin-top: 1.5rem;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}
.match-card {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.8rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid transparent;
  transition: all 0.2s;
}
.match-card.suggested {
  background: #f0fdf4;
  border-color: #a7f3d0;
  color: #047857;
}
.match-card.exact {
  background: #ecfdf5;
  border-color: #6ee7b7;
  color: #065f46;
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.06);
}
.match-badge {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
}
.match-badge.suggested {
  background: #d1fae5;
  color: #047857;
}
.match-badge.none {
  background: #f1f5f9;
  color: #64748b;
}
.import-modal-xl {
  max-width: 1200px !important;
  width: 95% !important;
}
.mapping-select {
  height: 38px;
  background: white;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  font-size: 0.8rem;
  padding: 0 0.5rem;
  font-weight: 600;
}

/* === FLUJO DE CAJA PREDICTIVO (FASE 2) === */
.cashflow-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.cashflow-card {
  background: white;
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  border: 1px solid #e2e8f0;
  border-left: 4px solid #cbd5e1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.5rem;
  transition: all 0.25s ease;
}
.cashflow-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
}
.cashflow-card.liquid {
  border-left-color: #3b82f6; /* Blue */
}
.cashflow-card.income {
  border-left-color: #10b981; /* Emerald */
}
.cashflow-card.expense {
  border-left-color: #f43f5e; /* Rose */
}
.cashflow-card.projection {
  border-left-color: #8b5cf6; /* Violet */
  background: linear-gradient(to right, white, #faf5ff);
}
.cashflow-card.deficit {
  border-left-color: #ef4444; /* Alert red */
  background: #fef2f2;
}
.cashflow-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.cashflow-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  color: #0f172a;
}
.cashflow-card.deficit .cashflow-value {
  color: #991b1b;
}
.cashflow-desc {
  font-size: 0.78rem;
  color: #94a3b8;
}

/* Gráfico de Proyección SVG Premium */
.projection-chart-container {
  background: radial-gradient(circle at top right, #1e293b, #0f172a);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 2rem;
  margin-bottom: 2.5rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
}
.projection-chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.projection-chart-title {
  color: white;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.3rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.svg-grid-line {
  stroke: rgba(255, 255, 255, 0.05);
  stroke-width: 1;
}
.svg-grid-line.zero {
  stroke: rgba(239, 68, 68, 0.25);
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
}
.svg-axis-label {
  fill: #94a3b8;
  font-size: 10px;
  font-weight: 600;
  font-family: inherit;
}
.svg-line {
  fill: none;
  stroke: #10b981;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 4px 6px rgba(16, 185, 129, 0.2));
  transition: all 0.3s ease;
}
.svg-line.deficit {
  stroke: #f43f5e;
  filter: drop-shadow(0 4px 6px rgba(244, 63, 94, 0.2));
}
.svg-area {
  fill: url(#chart-grad-emerald);
  opacity: 0.15;
  transition: all 0.3s ease;
}
.svg-area.deficit {
  fill: url(#chart-grad-rose);
  opacity: 0.15;
}
.svg-point {
  fill: #10b981;
  stroke: #0f172a;
  stroke-width: 2.5;
  cursor: pointer;
  transition: all 0.2s ease;
}
.svg-point.deficit {
  fill: #f43f5e;
}
.svg-point:hover {
  r: 7;
  stroke-width: 3;
}

/* Tooltip del gráfico */
.chart-tooltip-bubble {
  position: absolute;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 10px 14px;
  border-radius: 12px;
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  pointer-events: none;
  z-index: 10;
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 140px;
  transition: left 0.1s ease, top 0.1s ease;
}
.chart-tooltip-date {
  color: #94a3b8;
  font-size: 0.65rem;
  text-transform: uppercase;
  font-weight: 700;
}
.chart-tooltip-val {
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
  color: #34d399;
}
.chart-tooltip-val.negative {
  color: #fb7185;
}

/* Controles de Simulación e Historial de Vencimientos */
.sim-controls-panel {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}
.sim-control-item {
  flex: 1;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.sim-slider-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #475569;
  display: flex;
  justify-content: space-between;
}
.sim-slider-val {
  color: var(--color-primary);
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
}
.sim-slider-input {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: #cbd5e1;
  border-radius: 3px;
  outline: none;
  margin: 10px 0;
}
.sim-slider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-primary);
  cursor: pointer;
  transition: transform 0.1s ease;
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}
.sim-slider-input::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.sim-checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.25rem;
}
.sim-checkbox-btn {
  background: white;
  border: 1px solid #cbd5e1;
  padding: 0.5rem 1rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}
.sim-checkbox-btn.active {
  background: #f0fdf4;
  border-color: var(--color-primary);
  color: var(--color-primary-dark);
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.08);
}

/* Listado de vencimientos */
.vencimientos-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}
@media (max-width: 1024px) {
  .vencimientos-split {
    grid-template-columns: 1fr;
  }
}
.vencimiento-card-item {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
  transition: all 0.2s ease;
}
.vencimiento-card-item:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}
.vencimiento-card-item.vencido {
  background: #fff8f8;
  border-color: #fecdd3;
}
.vencimiento-card-left {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0; /* Permite truncar texto */
}
.vencimiento-card-title {
  font-weight: 700;
  color: #334155;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vencimiento-card-meta {
  font-size: 0.75rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.vencimiento-card-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
  flex-shrink: 0;
}
.vencimiento-card-amount {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  color: #0f172a;
}
.vencimiento-card-item.vencido .vencimiento-card-amount {
  color: #b91c1c;
}
.vencimiento-badge {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}
.vencimiento-badge.vencido {
  background: #fee2e2;
  color: #b91c1c;
}
.vencimiento-badge.proximo {
  background: #eff6ff;
  color: #1d4ed8;
}
.vencimiento-badge.proximo-critico {
  background: #fff7ed;
  color: #c2410c;
}

/* Rendiciones View - Mobile & Responsive Optimizations */
@media (min-width: 769px) {
  .rendiciones-mobile-only {
    display: none !important;
  }
  .rendiciones-desktop-only {
    display: block !important;
  }
}

@media (max-width: 860px) {
  .rendiciones-mobile-only {
    display: block !important;
  }
  .rendiciones-desktop-only {
    display: none !important;
  }
  .rendiciones-view .view-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.75rem !important;
  }
  .rendiciones-view .view-header-actions {
    flex-direction: column !important;
    width: 100% !important;
    gap: 0.5rem !important;
  }
  .rendiciones-view .action-buttons-group {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    gap: 0.5rem !important;
  }
  .rendiciones-view .action-buttons-group select,
  .rendiciones-view .action-buttons-group button {
    width: 100% !important;
    min-width: unset !important;
  }
  .rendiciones-view .header-search-container {
    width: 100% !important;
  }
  .top-navbar {
    padding: 0 10px !important;
    gap: 8px !important;
    overflow: visible !important;
  }
  .navbar-menu {
    margin: 0 4px !important;
    flex: 1 1 0% !important;
    min-width: 0 !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-x !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
  }
  .navbar-menu::-webkit-scrollbar {
    display: none !important;
  }
  .nav-group-container {
    flex-shrink: 0 !important;
    position: static !important;
  }
  .nav-link {
    padding: 6px 12px !important;
    font-size: 0.82rem !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }
  .nav-dropdown-menu,
  .holding-dropdown-menu {
    position: fixed !important;
    top: 60px !important;
    left: 12px !important;
    right: 12px !important;
    width: auto !important;
    min-width: unset !important;
    max-width: calc(100vw - 24px) !important;
    max-height: 80vh !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    border-radius: 16px !important;
    box-shadow: 0 20px 45px -5px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 0, 0, 0.1) !important;
    z-index: 99999 !important;
    padding: 10px !important;
    gap: 6px !important;
    background: #ffffff !important;
  }
  .nav-dropdown-mobile-title {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 4px 8px 10px 8px !important;
    border-bottom: 1px solid #f1f5f9 !important;
    font-weight: 800 !important;
    font-size: 0.95rem !important;
    color: #064e3b !important;
    margin-bottom: 4px !important;
  }
  .nav-dropdown-item {
    padding: 12px 14px !important;
    font-size: 0.92rem !important;
    border-radius: 10px !important;
  }
  .nav-dropdown-item .nav-dropdown-icon-box {
    width: 36px !important;
    height: 36px !important;
  }
  .nav-dropdown-item .nav-dropdown-label {
    font-size: 0.92rem !important;
    font-weight: 700 !important;
  }
}


/* === COMPRESIÓN RESPONSIVA MODAL INGRESOS === */
.modal-ingreso-compact {
  max-width: 980px !important;
  width: 95vw !important;
  max-height: 90vh !important;
}
.ingreso-form-grid-1 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px 12px;
}
.ingreso-form-grid-2-guia {
  display: grid;
  grid-template-columns: 2fr 1.2fr 1.8fr;
  gap: 8px 12px;
}
.ingreso-form-grid-2-factura {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 8px 12px;
}
@media (max-width: 860px) {
  .ingreso-form-grid-1 {
    grid-template-columns: repeat(2, 1fr);
  }
  .ingreso-form-grid-2-guia, .ingreso-form-grid-2-factura {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 560px) {
  .ingreso-form-grid-1, .ingreso-form-grid-2-guia, .ingreso-form-grid-2-factura {
    grid-template-columns: 1fr;
  }
}



