/* Estilos Globales, Temas y Reglas de Impresión - AiloNet Tech (Tema Estilo QuickBooks) */

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

:root {
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Colores QuickBooks */
  --qb-green: #2ca01c;
  --qb-green-hover: #238416;
  --qb-green-active: #1e7312;
  --qb-green-light: #eaf7ec;
  --qb-blue: #0077c5;
  --qb-blue-hover: #005fa3;
  --qb-bg: #f4f5f8;
  --qb-card: #ffffff;
  --qb-sidebar: #242d38;
  --qb-border: #e2e8f0;
  --qb-text-primary: #1e293b;
  --qb-text-muted: #64748b;
}

body {
  font-family: var(--font-sans);
  background-color: var(--qb-bg);
  color: var(--qb-text-primary);
  min-height: 100vh;
}

/* Scrollbar Personalizado Claro */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Enlaces de Navegación Lateral (QuickBooks Dark Charcoal Sidebar) */
.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #94a3b8;
  transition: all 0.2s ease;
  user-select: none;
}

.nav-link:hover {
  color: #ffffff;
  background-color: #2d3748;
}

.nav-link.active {
  color: #ffffff;
  background: #2ca01c;
  box-shadow: 0 4px 12px rgba(44, 160, 28, 0.35);
}

/* Píldoras de Categoría */
.category-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.85rem;
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.category-pill:hover {
  border-color: #2ca01c;
  color: #2ca01c;
}

.category-pill.active {
  background-color: #2ca01c;
  border-color: #2ca01c;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(44, 160, 28, 0.25);
}

.badge-count {
  background: rgba(0, 0, 0, 0.08);
  padding: 0.1rem 0.45rem;
  border-radius: 9999px;
  font-size: 0.7rem;
}

.category-pill.active .badge-count {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* Modales */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 1rem;
}

.modal-content {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 1.25rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalScaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScaleIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Tarjetas y Contenedores */
.card-glass {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
}

/* Telón de fondo para el sidebar en móvil */
#sidebarBackdrop {
  transition: opacity 0.3s ease;
}

/* Scroll táctil suave */
.overflow-x-auto, .overflow-y-auto {
  -webkit-overflow-scrolling: touch;
}

/* Modales optimizados para móviles */
@media (max-width: 640px) {
  .modal-overlay {
    padding: 0.5rem;
  }
  .modal-content {
    border-radius: 1rem;
    max-height: 94vh;
  }
}

/* ===================================================
   REGLAS DE IMPRESIÓN Y GENERACIÓN DE PDF (@MEDIA PRINT)
   =================================================== */
@media print {
  body {
    background-color: #ffffff !important;
    color: #000000 !important;
  }

  /* Ocultar barra lateral, barra superior, botones y todo el UI */
  #sidebar,
  #topbar,
  #toastContainer,
  .no-print,
  .modal-header,
  .modal-footer,
  .modal-overlay:not(#printPreviewModal) {
    display: none !important;
  }

  #printPreviewModal {
    position: static !important;
    background: transparent !important;
    padding: 0 !important;
  }

  #printPreviewModal .modal-content {
    border: none !important;
    box-shadow: none !important;
    max-height: none !important;
    background: transparent !important;
    border-radius: 0 !important;
  }

  .print-document-container {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    background: white !important;
  }

  .ticket-container {
    box-shadow: none !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  table {
    page-break-inside: auto;
  }

  tr {
    page-break-inside: avoid;
    page-break-after: auto;
  }
}

/* Pantalla de Login */
#loginScreen {
  background: radial-gradient(circle at 50% 30%, #242d38 0%, #111822 100%);
  backdrop-filter: blur(8px);
}

/* Barra Inferior Móvil (Bottom Navigation) */
.bottom-nav-btn {
  position: relative;
  transition: transform 0.15s ease, color 0.15s ease;
}

.bottom-nav-btn:active {
  transform: scale(0.92);
}

.bottom-nav-btn.active {
  color: #2ca01c !important;
}

.bottom-nav-btn.active span:first-child {
  transform: scale(1.1);
}

