/* Ensure line items section is properly styled */
#line-items-section-process {
    margin-top: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 15px;
    background-color: #f9f9f9;
}

#line-items-section-process .section-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 15px;
}

#line-items-section-process .line-items-table-container {
    max-height: 400px;
    overflow-y: auto;
}

#line-items-section-process table {
    width: 100%;
    border-collapse: collapse;
}

#line-items-section-process th {
    background-color: #e9ecef;
    position: sticky;
    top: 0;
    z-index: 10;
}

#line-items-section-process .line-item-numeric {
    text-align: right;
    font-family: monospace;
}

#line-items-section-process .line-item-amount {
    font-weight: bold;
    color: #2c5f2d;
}
/* Line Items Table Styles */
.line-items-section {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 20px;
    margin-top: 20px;
    border: 1px solid #e9ecef;
}

.line-items-section .section-header {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f8f9fa;
}

.line-items-section .section-header h6 {
    color: #495057;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.line-items-section .section-header h6 i {
    color: #007bff;
}

.line-items-section .section-header p {
    color: #6c757d;
    margin: 5px 0 0 0;
    font-size: 0.9em;
}

/* Table Styling */
.line-items-section .table-responsive {
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.line-items-section .table {
    margin-bottom: 0;
    background: #fff;
}

.line-items-section .table thead th {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: #fff;
    border: none;
    padding: 12px 15px;
    font-weight: 600;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
}

.line-items-section .table thead th:after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 60%;
    background: rgba(255,255,255,0.3);
}

.line-items-section .table thead th:last-child:after {
    display: none;
}

.line-items-section .table tbody tr {
    transition: all 0.3s ease;
}

.line-items-section .table tbody tr:hover {
    background-color: #f8f9ff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,123,255,0.1);
}

.line-items-section .table tbody td {
    padding: 12px 15px;
    border-color: #f1f3f4;
    vertical-align: middle;
    font-size: 0.9em;
}

.line-items-section .table tbody tr:nth-child(even) {
    background-color: #fafbfc;
}

.line-items-section .table tbody tr:nth-child(even):hover {
    background-color: #f0f4ff;
}

/* Column-specific styling */
.line-item-numeric {
    text-align: right;
    font-family: 'Courier New', monospace;
    font-weight: 500;
}

.line-item-amount {
    color: #28a745;
    font-weight: 600;
}

.line-item-amount.negative {
    color: #dc3545;
}

/* Special column highlighting */
.line-items-section .table td:first-child {
    font-weight: 500;
   
}

.line-items-section .table td:nth-child(2) {
    
}

/* Description column specific styling */
.line-items-section .table td:contains("Description"),
.line-items-section .table td[data-column="description"] {
    max-width: 250px;
    word-wrap: break-word;
}

/* Status badges for specific values */
.line-items-section .table .status-completed {
    background: #d4edda;
    color: #155724;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 500;
}

.line-items-section .table .status-pending {
    background: #fff3cd;
    color: #856404;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 500;
}

/* Table Actions */
.line-items-section .table-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-start;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

.line-items-section .table-actions .btn {
    border-radius: 20px;
    padding: 6px 15px;
    font-size: 0.85em;
    font-weight: 500;
    transition: all 0.3s ease;
}

.line-items-section .table-actions .btn-outline-primary {
    border-color: #007bff;
    color: #007bff;
}

.line-items-section .table-actions .btn-outline-primary:hover {
    background: #007bff;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,123,255,0.3);
}

.line-items-section .table-actions .btn-outline-secondary {
    border-color: #6c757d;
    color: #6c757d;
}

.line-items-section .table-actions .btn-outline-secondary:hover {
    background: #6c757d;
    color: #fff;
    transform: translateY(-1px);
}

/* Empty state styling */
.line-items-section .table tbody tr.no-data td {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 30px;
    background: #f8f9fa;
}

.line-items-section .table tbody tr.no-data td:before {
    content: "📊";
    font-size: 2em;
    display: block;
    margin-bottom: 10px;
    opacity: 0.5;
}

/* Scrollbar styling for table */
.line-items-section .table-responsive::-webkit-scrollbar {
    height: 8px;
}

.line-items-section .table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.line-items-section .table-responsive::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.line-items-section .table-responsive::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Responsive design */
@media (max-width: 768px) {
    .line-items-section {
        padding: 15px;
        margin-top: 15px;
    }
    
    .line-items-section .table-responsive {
        font-size: 0.85em;
    }
    
    .line-items-section .table thead th {
        padding: 8px 10px;
        font-size: 0.8em;
    }
    
    .line-items-section .table tbody td {
        padding: 8px 10px;
    }
    
    .line-items-section .table-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .line-items-section .table-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Animation for table rows */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.line-items-section .table tbody tr {
    animation: fadeIn 0.3s ease-out;
}

.line-items-section .table tbody tr:nth-child(1) { animation-delay: 0.05s; }
.line-items-section .table tbody tr:nth-child(2) { animation-delay: 0.1s; }
.line-items-section .table tbody tr:nth-child(3) { animation-delay: 0.15s; }
.line-items-section .table tbody tr:nth-child(4) { animation-delay: 0.2s; }
.line-items-section .table tbody tr:nth-child(5) { animation-delay: 0.25s; }

/* Highlight important rows */
.line-items-section .table tbody tr.total-row {
    background: linear-gradient(135deg, #e3f2fd, #f3e5f5);
    font-weight: 600;
}

.line-items-section .table tbody tr.total-row td {
    border-top: 2px solid #007bff;
    border-bottom: 2px solid #007bff;
}

.line-items-section .table tbody tr.total-row td:first-child {
    border-left: 2px solid #007bff;
}

.line-items-section .table tbody tr.total-row td:last-child {
    border-right: 2px solid #007bff;
}

/* Currency symbol styling */
.line-items-section .table .currency-symbol {
    font-size: 0.8em;
    opacity: 0.7;
    margin-right: 2px;
}

/* Tooltip for truncated content */
.line-items-section .table td {
    position: relative;
}

.line-items-section .table td.truncated {
    cursor: help;
}

.line-items-section .table td.truncated:hover:after {
    content: attr(data-full-text);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8em;
    white-space: nowrap;
    z-index: 1000;
}

.line-items-section .table td.truncated:hover:before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
    z-index: 1000;
}

/* Print styles */
@media print {
    .line-items-section {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .line-items-section .table-actions {
        display: none;
    }
    
    .line-items-section .table thead th {
        background: #fff !important;
        color: #000 !important;
        border-bottom: 2px solid #000;
    }
    
    .line-items-section .table tbody tr {
        break-inside: avoid;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .line-items-section {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .line-items-section .table {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .line-items-section .table thead th {
        background: linear-gradient(135deg, #2b6cb0, #2c5282);
    }
    
    .line-items-section .table tbody tr:hover {
        background-color: #4a5568;
    }
    
    .line-items-section .table tbody tr:nth-child(even) {
        background-color: #374151;
    }
    
    .line-items-section .table tbody tr:nth-child(even):hover {
        background-color: #4a5568;
    }
    
    .line-items-section .table td {
        border-color: #4a5568;
    }
}

/* Loading state */
.line-items-section.loading .table tbody {
    opacity: 0.6;
    pointer-events: none;
}

.line-items-section.loading:after {
    content: 'Loading...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #007bff;
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.9em;
}

/* Success state animation */
.line-items-section .table tbody tr.updated {
    animation: highlightUpdate 2s ease;
}

@keyframes highlightUpdate {
    0% {
        background-color: #d4edda;
    }
    100% {
        background-color: transparent;
    }
}
