/* Invoice CSS Fixes - Ensure proper dropdown display */

/* CRITICAL FIX: Prevent dropdown from appearing at top of page */
#productDropdown {
    position: relative !important;
    z-index: 1 !important;
    width: 100% !important;
    display: block !important;
}

/* Force all selects in invoice form to stay in position */
#invoiceForm select {
    position: relative !important;
    z-index: auto !important;
    display: block !important;
}

/* Ensure all form-select elements stay in position */
.form-select {
    position: relative !important;
    z-index: auto !important;
}

/* Fix for any absolute positioning conflicts in cards */
.card-body select {
    position: relative !important;
    z-index: auto !important;
}

/* Prevent Bootstrap dropdown menu conflicts */
.dropdown-menu {
    position: absolute !important;
}

/* Ensure invoice form controls are properly positioned */
#invoiceForm input,
#invoiceForm textarea {
    position: relative !important;
}

/* Additional fix for select2 or custom dropdown libraries */
.select2-container {
    position: relative !important;
    z-index: auto !important;
}

/* Invoice items table styling */
#itemsTableBody button.btn-link {
    padding: 0;
    text-decoration: none;
    color: #0d6efd;
    cursor: pointer;
    font-size: 1.2rem !important;
}

#itemsTableBody button.btn-link:hover {
    text-decoration: underline;
}

/* Improve table readability */
.table th {
    white-space: nowrap;
}

.table td {
    vertical-align: middle;
}
.form-select,
.form-control {
    font-size: 1.2rem !important;
}


/* Ensure proper stacking context for invoice form */
    #invoiceForm {
    position: relative;
    z-index: 1;
}

.card-body {
    position: relative;
    z-index: 1;
}

/* Print styles for invoice */
@media print {
    .btn,
    .card.bg-light:last-child,
    .card-header,
    nav,
    footer,
    .no-print {
        display: none !important;
    }
    
    .card {
        border: none !important;
        box-shadow: none !important;
    }
    
    body {
        background: white !important;
    }
}

/* Ensure proper spacing for invoice display */
.invoice-header {
    margin-bottom: 2rem;
}

.invoice-totals {
    margin-top: 2rem;
}

/* Badge styling for custom items */
.badge.bg-warning {
    font-size: 0.7rem;
    padding: 0.25em 0.5em;
}

/* Responsive table for mobile */
@media (max-width: 768px) {
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ADDITIONAL FIX: Override any conflicting Bootstrap or custom styles */
select.form-select,
select.form-control {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
}

/* Ensure container doesn't cause issues */
.container-fluid {
    position: relative;
}

/* Fix for row positioning */
.row {
    position: relative;
}

