/* Estilos personalizados para la Feria Contable Floreal Marotta Escuela 4-014 */
@import url('../vendor/fonts.css');

:root {
  --agro-green: #059669;
  --agro-light: #10b981;
  --floral-pink: #d946ef;
  --gold-accent: #f59e0b;
  --bank-blue: #4f46e5;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  -webkit-tap-highlight-color: transparent;
  /* Fondo con manchas de color suaves (verde, fucsia, ámbar, índigo) en lugar del gris plano */
  background-image:
    radial-gradient(circle at 0% 0%, rgba(16, 185, 129, 0.16) 0, transparent 38%),
    radial-gradient(circle at 100% 12%, rgba(217, 70, 239, 0.14) 0, transparent 36%),
    radial-gradient(circle at 0% 85%, rgba(245, 158, 11, 0.12) 0, transparent 38%),
    radial-gradient(circle at 100% 100%, rgba(79, 70, 229, 0.14) 0, transparent 40%);
  background-attachment: fixed;
}

/* Montos: nunca partir "$F" del número y alinear cifras */
.money {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Ocultar barra de scroll en filas de pestañas */
.scrollbar-none {
  scrollbar-width: none;
}
.scrollbar-none::-webkit-scrollbar {
  display: none;
}

/* Tarjetas blancas con un poco más de presencia */
main .bg-white.rounded-3xl {
  box-shadow: 0 10px 30px -12px rgba(15, 23, 42, 0.18);
}

/* Entrada suave de las vistas al cambiar de pestaña */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
main > div:not(.hidden), main > section {
  animation: fadeUp 0.25s ease-out;
}

/* Tarjeta Billetera Digital */
.wallet-card {
  background: linear-gradient(135deg, #064e3b 0%, #047857 50%, #0d9488 100%);
  position: relative;
  overflow: hidden;
  box-shadow: 0 15px 30px -5px rgba(6, 78, 59, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.15) inset;
}

.wallet-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(217, 70, 239, 0.25) 0%, transparent 70%);
  pointer-events: none;
}

/* Efecto Cheque Escolar Realista */
.cheque-box {
  background: #fdfbf7;
  border: 2px dashed #94a3b8;
  position: relative;
  box-shadow: 0 8px 20px -3px rgba(0, 0, 0, 0.1);
}

.cheque-box::before {
  content: "BANCO CENTRAL ESCOLAR • ESCUELA 4-014 MAYOR JORGE GARCÍA";
  /* En el flujo (no absoluto) para que no se pise con el tipo de instrumento y el sello */
  display: block;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: #64748b;
}

.cheque-title {
  font-family: 'Playfair Display', serif;
}

.cheque-mono {
  font-family: 'Courier Prime', monospace;
}

/* Pagaré Escolar */
.pagare-box {
  background: #fffbeb;
  border: 2px solid #d97706;
  box-shadow: 0 8px 20px -3px rgba(217, 119, 6, 0.15);
}

/* Ticket Térmico de Facturación */
.ticket-paper {
  background: #ffffff;
  font-family: 'Courier Prime', monospace;
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.15);
  position: relative;
}

.ticket-paper::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 0;
  right: 0;
  height: 10px;
  background: radial-gradient(circle, transparent, transparent 50%, #ffffff 50%, #ffffff 100%);
  background-size: 16px 16px;
  transform: rotate(180deg);
}

/* Botones Grandes Táctiles */
.btn-touch {
  min-height: 3.25rem;
  transition: all 0.15s ease-in-out;
}

.btn-touch:active {
  transform: scale(0.97);
}

/* Badges de Estado */
.badge-pending {
  background-color: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.badge-cleared {
  background-color: #d1fae5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.badge-rejected {
  background-color: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

/* Animación de escaneo */
@keyframes scanline {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}

.scan-laser {
  animation: scanline 2s infinite linear;
}

/* ========================================================
   ESTILOS DE IMPRESIÓN Y EXPORTACIÓN A PDF LIMPIOS
   ======================================================== */
@media print {
  /* Los botones para ver el documento de cada asiento no van en el libro impreso */
  .sic-doc-btn { display: none !important; }

  /* Ocultar elementos generales de la app al imprimir */
  body {
    background: #ffffff !important;
    color: #000000 !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  body * {
    visibility: hidden;
  }

  /* Solo hacer visible el área de la factura / ticket */
  #ticketPrintArea, #ticketPrintArea * {
    visibility: visible;
  }

  #modalInvoiceTicket {
    position: static !important;
    background: transparent !important;
    padding: 0 !important;
    display: block !important;
  }

  #ticketPrintArea {
    position: absolute;
    left: 50%;
    top: 10px;
    transform: translateX(-50%);
    width: 320px !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    padding: 16px !important;
    background: #ffffff !important;
    color: #000000 !important;
    box-shadow: none !important;
    border: 1px dashed #475569 !important;
    page-break-inside: avoid;
  }

  .ticket-paper::after {
    display: none !important;
  }

  header, nav, main, footer, button, .btn-touch, .modal-backdrop {
    display: none !important;
  }

  /* Impresión de la Planilla SIC (body.print-sic): mostrar solo esa vista */
  body.print-sic main {
    display: block !important;
    max-width: none !important;
    padding: 0 !important;
  }
  body.print-sic #view-sic,
  body.print-sic #view-sic * {
    visibility: visible;
  }
  body.print-sic #view-sic {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
  }
  body.print-sic #sic-subview-journal,
  body.print-sic #sic-subview-ledgers,
  body.print-sic #sic-subview-stock {
    display: block !important;
    margin-bottom: 16px;
  }
  body.print-sic #view-sic .overflow-x-auto {
    overflow: visible !important;
  }

  /* Impresión limpia de Cheque Bancario */
  #modalChequeDetail, #modalChequeDetail * {
    visibility: visible !important;
  }
}

/* ========================================================
   ESTILOS DE FACTURA ELECTRÓNICA AFIP / ARCA DIDÁCTICA
   ======================================================== */
.afip-invoice-box {
  background: #ffffff;
  color: #1e293b;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  border: 2px solid #0f172a;
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
}

.afip-letter-badge {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 48px;
  height: 52px;
  background: #ffffff;
  border: 2px solid #0f172a;
  border-top: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.afip-letter-badge .letter {
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
  color: #0f172a;
}

.afip-letter-badge .code {
  font-size: 9px;
  font-weight: 800;
  color: #475569;
  line-height: 1;
  margin-top: 2px;
}

/* ========================================================
   ESTILOS DE CHEQUE DE PAGO DIFERIDO BANCARIO REALISTA
   ======================================================== */
.cheque-bancario {
  background-color: #f0fdf4;
  background-image: 
    radial-gradient(#bbf7d0 0.75px, transparent 0.75px),
    radial-gradient(#bbf7d0 0.75px, #f0fdf4 0.75px);
  background-size: 15px 15px;
  background-position: 0 0, 7.5px 7.5px;
  border: 2px solid #166534;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 15px 30px -10px rgba(22, 101, 52, 0.25);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Marca de agua / Trama Guilloché */
.cheque-bancario::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    45deg,
    rgba(22, 101, 52, 0.03) 0px,
    rgba(22, 101, 52, 0.03) 2px,
    transparent 2px,
    transparent 8px
  );
  pointer-events: none;
}

/* Doble raya transversal "NO A LA ORDEN" */
.cheque-cruzado {
  position: absolute;
  top: -20px;
  left: 20px;
  width: 140px;
  height: 50px;
  border-bottom: 2px solid #166534;
  border-top: 2px solid #166534;
  transform: rotate(-35deg);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0.85;
}

.cheque-cruzado span {
  font-size: 8px;
  font-weight: 900;
  color: #166534;
  letter-spacing: 1px;
}

/* Recuadro de Importe en Números */
.cheque-monto-box {
  background: #ffffff;
  border: 2px solid #166534;
  padding: 4px 12px;
  border-radius: 6px;
  font-family: 'Courier New', Courier, monospace;
  font-weight: 900;
  font-size: 14px;
  color: #14532d;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
  letter-spacing: 0.5px;
}

/* Renglón manuscrito en letras */
.cheque-renglon-letras {
  border-bottom: 1px dashed #166534;
  font-weight: 800;
  color: #14532d;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
}

/* Banda magnética CMC7 inferior */
.cheque-cmc7 {
  font-family: "Courier New", Courier, monospace;
  letter-spacing: 3px;
  font-weight: 900;
  font-size: 11px;
  color: #14532d;
  background: rgba(255, 255, 255, 0.7);
  border-top: 1px solid rgba(22, 101, 52, 0.3);
  padding: 6px 10px;
  display: flex;
  justify-content: space-around;
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
}

/* =====================================================================
   REDISEÑO 2026 • estilo "app de billetera": hero con degradé vivo,
   acciones grandes y barra de navegación inferior.
   ===================================================================== */
.font-display {
  font-family: 'Bricolage Grotesque', 'Plus Jakarta Sans', sans-serif;
  letter-spacing: -0.02em;
}

/* Fondo del encabezado: degradé saturado que se "derrite" en la página */
.app-hero {
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(250, 204, 21, 0.35) 0%, transparent 45%),
    radial-gradient(90% 80% at 0% 100%, rgba(217, 70, 239, 0.45) 0%, transparent 55%),
    linear-gradient(160deg, #064e3b 0%, #059669 45%, #0d9488 75%, #4338ca 100%);
  border-radius: 0 0 2.5rem 2.5rem;
  box-shadow: 0 25px 50px -20px rgba(5, 150, 105, 0.55);
  position: relative;
  overflow: hidden;
}
.app-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.14) 1.5px, transparent 1.5px);
  background-size: 22px 22px;
  pointer-events: none;
}
.app-hero > * { position: relative; z-index: 1; }

/* Cifra del saldo con brillo que pasa cada tanto */
.hero-balance {
  background: linear-gradient(100deg, #fff 0%, #fff 40%, #fde68a 50%, #fff 60%, #fff 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shine 5s ease-in-out infinite;
}
@keyframes shine {
  0%, 60% { background-position: 100% 0; }
  100% { background-position: -50% 0; }
}

/* Botones de acción rápidos: ícono grande en "squircle" de color */
.action-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  font-weight: 800;
  font-size: 0.78rem;
  color: #fff;
  transition: transform 0.15s ease;
}
.action-tile:active { transform: scale(0.94); }
.action-tile .tile-icon {
  width: 3.9rem;
  height: 3.9rem;
  border-radius: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 22px -10px rgba(0, 0, 0, 0.55), inset 0 -3px 0 rgba(0, 0, 0, 0.15);
}

/* Barra de navegación inferior fija */
.tabbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: max(0.75rem, env(safe-area-inset-bottom));
  width: calc(100% - 1.5rem);
  max-width: 34rem;
  z-index: 45;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.25rem;
  padding: 0.45rem;
  border-radius: 1.75rem;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(14px);
  box-shadow: 0 20px 40px -12px rgba(15, 23, 42, 0.6);
}
.tabbar-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.55rem 0.2rem;
  border-radius: 1.25rem;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.05;
  text-align: center;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}
.tabbar-btn:active { transform: scale(0.93); }
.tabbar-btn svg { width: 1.35rem; height: 1.35rem; }
.tabbar-btn.is-active { color: #0f172a; }
.tabbar-btn.tab-green.is-active { background: #34d399; }
.tabbar-btn.tab-pink.is-active { background: #f0abfc; }
.tabbar-btn.tab-amber.is-active { background: #fcd34d; }
.tabbar-btn.tab-indigo.is-active { background: #a5b4fc; }
.tabbar-btn.tab-sky.is-active { background: #7dd3fc; }

/* Encabezado de sección dentro de las pestañas */
.section-title {
  font-family: 'Bricolage Grotesque', 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: #0f172a;
}

/* Variantes de color del hero para Stand (fucsia→naranja) y Banco (índigo→violeta) */
.app-hero.hero-stand {
  background:
    radial-gradient(110% 90% at 100% 0%, rgba(250, 204, 21, 0.4) 0%, transparent 45%),
    radial-gradient(90% 80% at 0% 100%, rgba(244, 63, 94, 0.45) 0%, transparent 55%),
    linear-gradient(150deg, #701a75 0%, #c026d3 45%, #db2777 75%, #ea580c 100%);
  box-shadow: 0 25px 50px -20px rgba(192, 38, 211, 0.55);
}
.app-hero.hero-bank {
  background:
    radial-gradient(110% 90% at 100% 0%, rgba(250, 204, 21, 0.3) 0%, transparent 45%),
    radial-gradient(90% 80% at 0% 100%, rgba(16, 185, 129, 0.35) 0%, transparent 55%),
    linear-gradient(150deg, #1e1b4b 0%, #3730a3 45%, #6d28d9 80%, #a21caf 100%);
  box-shadow: 0 25px 50px -20px rgba(67, 56, 202, 0.55);
}

/* Barra de pestañas oscura en línea (stand y banco, que se usan en tablet/PC) */
.tabbar.tabbar-inline {
  position: static;
  transform: none;
  width: 100%;
  max-width: none;
  grid-template-columns: repeat(var(--tabs, 4), 1fr);
}
.tabbar-inline .tabbar-btn { font-size: 0.8rem; padding: 0.7rem 0.3rem; }
@media (min-width: 640px) {
  .tabbar-inline .tabbar-btn { flex-direction: row; gap: 0.45rem; font-size: 0.9rem; }
}
/* Banco: 6 pestañas → 3 columnas en celular, 6 en pantalla grande */
.tabbar.tabbar-inline.tabs-6 { grid-template-columns: repeat(3, 1fr); }
@media (min-width: 1024px) { .tabbar.tabbar-inline.tabs-6 { grid-template-columns: repeat(6, 1fr); } }
/* Banco con 7 pestañas (suma Equipos): 4 columnas en celular, 7 en pantalla grande */
.tabbar.tabbar-inline.tabs-7 { grid-template-columns: repeat(4, 1fr); }
.tabbar.tabbar-inline.tabs-8 { grid-template-columns: repeat(4, 1fr); }
@media (min-width: 1024px) { .tabbar.tabbar-inline.tabs-7 { grid-template-columns: repeat(7, 1fr); } }
@media (min-width: 1024px) { .tabbar.tabbar-inline.tabs-8 { grid-template-columns: repeat(8, 1fr); } }
/* KPI de vidrio sobre el hero */
.kpi-glass {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(10px);
  border-radius: 1.6rem;
  padding: 1rem 1.1rem;
}

/* Formularios de billetera: el cierre y los campos deben quedar accesibles
   también con pantallas bajas o con el teclado del celular abierto. */
.wallet-app :is(#modalConfirmOrderPayment, #modalInstrument, #modalRegisterUser, #modalActivateBusiness,
  #modalTransfer, #modalNewProduct, #modalBusinessTransfer, #modalLogin,
  #modalJoinBusiness, #modalBusinessMembers) > div {
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  overscroll-behavior: contain;
}
