html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

@media print {
  @page {
    size: letter landscape;
    margin: 6mm 8mm 6mm 8mm;
  }

  header, footer, nav, .d-print-none, form, .nav-tabs, .btn {
    display: none !important;
  }

  body {
    background-color: #fff !important;
    color: #000 !important;
    font-size: 8pt !important;
    margin: 0 !important;
    padding: 0 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .container, .container-fluid {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  main {
    padding: 0 !important;
    margin: 0 !important;
  }

  .card {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 0 10px 0 !important;
    background: transparent !important;
  }

  .card-header {
    background-color: transparent !important;
    border-bottom: 1px solid #333 !important;
    padding: 4px 0 !important;
  }

  .card-body {
    padding: 0 !important;
  }

  /* Tablas de Reportes y Libros Legales */
  table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 7.5pt !important;
    page-break-inside: auto !important;
  }

  thead {
    display: table-header-group !important;
  }

  tfoot {
    display: table-footer-group !important;
  }

  tr {
    page-break-inside: avoid !important;
    page-break-after: auto !important;
  }

  th, td {
    padding: 2.5px 3.5px !important;
    border: 1px solid #777 !important;
    color: #000 !important;
    background-color: transparent !important;
  }

  thead th {
    background-color: #eaeaea !important;
    font-weight: 700 !important;
    border-bottom: 2px solid #000 !important;
    text-align: center !important;
  }

  tfoot td {
    background-color: #f4f4f4 !important;
    font-weight: 700 !important;
    border-top: 2px solid #000 !important;
  }

  /* No truncar texto al imprimir */
  .text-truncate {
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: normal !important;
    max-width: none !important;
  }

  .table-responsive {
    overflow: visible !important;
    display: block !important;
    max-width: 100% !important;
  }

  /* Cajas de resumen y liquidación F-07 */
  .box-liquidacion-f07 {
    page-break-inside: avoid !important;
    width: 48% !important;
    margin-left: auto !important;
    margin-top: 15px !important;
    border: 1px solid #333 !important;
  }

  .box-liquidacion-f07 td {
    border: none !important;
    border-bottom: 1px solid #ddd !important;
    padding: 3px 6px !important;
  }
}

/* ==========================================================================
   F1 Interactive Help Balloon (NexoFinSV Smart Guide)
   ========================================================================== */
.f1-help-balloon {
    position: absolute;
    z-index: 9999;
    max-width: 360px;
    min-width: 280px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 14px 38px rgba(15, 23, 42, 0.28), 0 3px 8px rgba(0,0,0,0.12);
    border: 1px solid #cbd5e1;
    animation: f1HelpFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: #1e293b;
    pointer-events: auto;
}

@keyframes f1HelpFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.f1-help-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #ffffff;
    padding: 10px 14px;
    border-top-left-radius: 11px;
    border-top-right-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.f1-help-badge {
    background: rgba(59, 130, 246, 0.28);
    border: 1px solid rgba(147, 197, 253, 0.45);
    color: #bfdbfe;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.f1-help-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
    transition: color 0.15s ease;
}
.f1-help-close:hover {
    color: #ffffff;
}

.f1-help-body {
    padding: 12px 14px;
    font-size: 0.85rem;
    line-height: 1.45;
}

.f1-help-field-title {
    font-weight: 700;
    color: #0f172a;
    font-size: 0.94rem;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.f1-help-desc {
    color: #334155;
    margin-bottom: 10px;
}

.f1-help-example-box {
    background: #f8fafc;
    border: 1px dashed #94a3b8;
    border-radius: 6px;
    padding: 6px 10px;
    margin-bottom: 8px;
    font-size: 0.8rem;
    color: #0f172a;
}

.f1-help-legal-box {
    background: #eff6ff;
    border-left: 3px solid #2563eb;
    border-radius: 4px;
    padding: 6px 9px;
    font-size: 0.78rem;
    color: #1e40af;
    margin-bottom: 8px;
}

.f1-help-footer {
    background: #f8fafc;
    padding: 6px 14px;
    border-bottom-left-radius: 11px;
    border-bottom-right-radius: 11px;
    border-top: 1px solid #f1f5f9;
    font-size: 0.72rem;
    color: #64748b;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.f1-highlight-field {
    outline: none !important;
    border-color: #2563eb !important;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.35) !important;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.f1-help-balloon::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
}

.f1-help-balloon.pos-bottom::after {
    top: -8px;
    left: 24px;
    border-width: 0 8px 8px 8px;
    border-color: transparent transparent #0f172a transparent;
}

.f1-help-balloon.pos-top::after {
    bottom: -8px;
    left: 24px;
    border-width: 8px 8px 0 8px;
    border-color: #f8fafc transparent transparent transparent;
}

/* ==========================================================================
   NexoFinSV Copilot - Asistente Virtual Flotante ERP
   ========================================================================== */

/* Botón Disparador Flotante */
.nexofin-copilot-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    color: #ffffff;
    border: none;
    cursor: pointer;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.45), 0 2px 6px rgba(0,0,0,0.15);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
}

.nexofin-copilot-btn:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.55), 0 4px 10px rgba(0,0,0,0.2);
}

.nexofin-copilot-btn:active {
    transform: scale(0.96);
}

/* Pulso animado en el botón */
.copilot-pulse-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    background-color: #22c55e;
    border: 2px solid #ffffff;
    border-radius: 50%;
    animation: copilotPulse 2s infinite;
}

@keyframes copilotPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(34, 197, 94, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

/* Ventana de Chat Flotante */
.nexofin-copilot-card {
    position: fixed;
    bottom: 92px;
    right: 24px;
    width: 395px;
    max-width: calc(100vw - 32px);
    height: 550px;
    max-height: calc(100vh - 120px);
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.32), 0 4px 12px rgba(0,0,0,0.08);
    border: 1px solid #cbd5e1;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: copilotSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes copilotSlideUp {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Header del Chat */
.copilot-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #ffffff;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.copilot-avatar {
    width: 36px;
    height: 36px;
    background: rgba(37, 99, 235, 0.3);
    border: 1px solid rgba(96, 165, 250, 0.5);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #60a5fa;
}

.copilot-status-dot {
    width: 8px;
    height: 8px;
    background-color: #22c55e;
    border-radius: 50%;
    display: inline-block;
}

.copilot-subtext {
    font-size: 0.72rem;
    color: #94a3b8;
}

.copilot-btn-icon {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    transition: background 0.15s ease, color 0.15s ease;
}

.copilot-btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

/* Cuerpo de Mensajes */
.copilot-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Scrollbar personalizado */
.copilot-body::-webkit-scrollbar {
    width: 6px;
}
.copilot-body::-webkit-scrollbar-track {
    background: #f1f5f9;
}
.copilot-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

/* Burbujas de Mensaje */
.copilot-msg {
    display: flex;
    width: 100%;
}

.bot-msg {
    justify-content: flex-start;
}

.user-msg {
    justify-content: flex-end;
}

.copilot-bubble {
    max-width: 88%;
    padding: 10px 14px;
    font-size: 0.84rem;
    line-height: 1.45;
    border-radius: 14px 14px 14px 2px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #1e293b;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.user-bubble {
    border-radius: 14px 14px 2px 14px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}

.copilot-msg-title {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 6px;
    color: #0f172a;
}

.copilot-msg-text {
    color: #334155;
}

.copilot-actions .btn {
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 6px;
}

/* Chips de Sugerencia Rápida */
.copilot-chips-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #64748b;
    margin-top: 8px;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.copilot-chips {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.copilot-chip {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #334155;
    padding: 5px 9px;
    border-radius: 6px;
    font-size: 0.76rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
}

.copilot-chip:hover {
    background: #e0f2fe;
    border-color: #7dd3fc;
    color: #0369a1;
    transform: translateX(2px);
}

/* Indicador de escritura animado */
.copilot-typing .dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #94a3b8;
    margin-right: 3px;
    animation: copilotBounce 1.3s infinite;
}

.copilot-typing .dot:nth-child(2) {
    animation-delay: 0.2s;
}
.copilot-typing .dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes copilotBounce {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-5px);
    }
}

/* Footer / Input del Chat */
.copilot-footer {
    padding: 10px 14px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
}

.copilot-input {
    border-radius: 20px;
    padding-left: 14px;
    border-color: #cbd5e1;
    font-size: 0.84rem;
}

.copilot-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.copilot-btn-send {
    border-radius: 50%;
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Resaltado de Coincidencias en Respuestas Cipit IA */
.copilot-highlight {
    background: #fef08a;
    color: #854d0e;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.copilot-suggestion-btn {
    text-align: left;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.78rem;
    color: #1e293b;
    transition: all 0.15s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.copilot-suggestion-btn:hover {
    background: #f0fdf4;
    border-color: #22c55e;
    color: #15803d;
    transform: translateX(3px);
}

/* ==========================================================================
   Barra de Navegación Compacta y Responsiva (Evita desbordes horizontales)
   ========================================================================== */
.navbar .nav-link {
    padding-left: 0.35rem !important;
    padding-right: 0.35rem !important;
    font-size: 0.81rem !important;
    white-space: nowrap;
}

.navbar .nav-link i {
    margin-right: 2px !important;
}

.navbar-brand {
    font-size: 1.10rem !important;
    padding-top: 0.2rem !important;
    padding-bottom: 0.2rem !important;
}

/* En laptops de 14", 15.6" y pantallas hasta 1680px (incluye escala 125% y 150% de Windows):
   Ocultar iconos del nivel superior para ahorrar más de 260px y garantizar cero desborde */
@media (max-width: 1680px) {
    .navbar .container-fluid {
        padding-left: 0.6rem !important;
        padding-right: 0.6rem !important;
    }
    .navbar-brand {
        font-size: 1.05rem !important;
        margin-right: 0.4rem !important;
    }
    .navbar-brand i {
        font-size: 1.1rem !important;
        margin-right: 3px !important;
    }
    .navbar-nav .nav-link {
        padding-left: 0.30rem !important;
        padding-right: 0.30rem !important;
        font-size: 0.79rem !important;
    }
    /* Ocultar iconos del nivel superior */
    .navbar-nav > .nav-item > .nav-link > i {
        display: none !important;
    }
}

/* En monitores de 24"+ ultra-anchos (>= 1681px) los iconos del nivel superior se muestran con holgura */
@media (min-width: 1681px) {
    .navbar-nav > .nav-item > .nav-link > i {
        display: inline-block !important;
    }
}

/* Los iconos dentro de los dropdowns desplegables se conservan siempre con sus colores */
.dropdown-menu .dropdown-item i {
    display: inline-block !important;
}



