/* Filament CSS Variables for Dark Mode Support */
:root {
    --fi-modal-bg: 255, 255, 255;
    --fi-modal-border: 229, 231, 235;
    --fi-modal-header-bg: 249, 250, 251;
    --fi-modal-header-text: 17, 24, 39;
    --fi-modal-icon-bg: 243, 244, 246;
    --fi-modal-icon-border: 229, 231, 235;
    --fi-modal-icon-color: 75, 85, 99;
    --fi-modal-title-color: 17, 24, 39;
    --fi-modal-subtitle-color: 107, 114, 128;
    --fi-content-bg: 255, 255, 255;
    --fi-content-text: 17, 24, 39;
    --fi-content-border: 229, 231, 235;
}

.dark {
    --fi-modal-bg: 31, 41, 55;
    --fi-modal-border: 55, 65, 81;
    --fi-modal-header-bg: 17, 24, 39;
    --fi-modal-header-text: 243, 244, 246;
    --fi-modal-icon-bg: 55, 65, 81;
    --fi-modal-icon-border: 75, 85, 99;
    --fi-modal-icon-color: 156, 163, 175;
    --fi-modal-title-color: 243, 244, 246;
    --fi-modal-subtitle-color: 156, 163, 175;
    --fi-content-bg: 31, 41, 55;
    --fi-content-text: 243, 244, 246;
    --fi-content-border: 55, 65, 81;
}

/* Enhanced Invoice Items Table Styles */
.invoice-container {
    background: var(--invoice-bg, #ffffff);
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    margin-bottom: 2rem;
}

/* Enhanced Header Styles */
.invoice-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.invoice-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/><circle cx="10" cy="60" r="0.5" fill="white" opacity="0.1"/><circle cx="90" cy="40" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.invoice-header-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    z-index: 1;
}

.invoice-header-icon {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 0.75rem;
    padding: 0.75rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.invoice-header-icon svg {
    width: 2rem;
    height: 2rem;
    color: white;
}

.invoice-header-text {
    flex: 1;
}

.invoice-title {
    font-size: 1.875rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.invoice-subtitle {
    font-size: 1rem;
    opacity: 0.9;
    margin: 0;
    font-weight: 400;
}

/* Enhanced Details Section - Filament Compatible */
.invoice-details-card {
    background: rgb(var(--fi-content-bg));
    padding: 1.5rem;
    border-bottom: 1px solid rgb(var(--fi-content-border));
}

.dark .invoice-details-card {
    background: rgb(var(--fi-content-bg));
    border-bottom-color: rgb(var(--fi-content-border));
}

.invoice-details-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .invoice-details-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.invoice-details-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    border: 1px solid var(--invoice-border, #e2e8f0);
    transition: all 0.2s ease-in-out;
}

.invoice-details-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.15);
}

.invoice-details-total {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-color: #0ea5e9;
}

.invoice-details-icon {
    background: var(--invoice-icon-bg, #f1f5f9);
    border-radius: 0.5rem;
    padding: 0.75rem;
    color: var(--invoice-icon-color, #64748b);
}

.invoice-details-total .invoice-details-icon {
    background: #0ea5e9;
    color: white;
}

.invoice-details-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.invoice-details-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--invoice-label, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.invoice-details-value {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--invoice-value, #1e293b);
}

.invoice-total-amount {
    font-size: 1.25rem;
    color: #0ea5e9;
    font-weight: 700;
}
/* Enhanced Table Section - Filament Compatible */
.invoice-table-section {
    padding: 1.5rem;
    background: rgb(var(--fi-content-bg));
}

.dark .invoice-table-section {
    background: rgb(var(--fi-content-bg));
}

.invoice-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--invoice-border, #e2e8f0);
}

.invoice-table-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--invoice-title, #1e293b);
    margin: 0;
}

.invoice-table-count {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--invoice-count-bg, #f1f5f9);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    border: 1px solid var(--invoice-border, #e2e8f0);
}

.invoice-items-count {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--invoice-count-color, #0ea5e9);
}

.invoice-items-label {
    font-size: 0.875rem;
    color: var(--invoice-label, #64748b);
    font-weight: 500;
}

.invoice-table-container {
    overflow-x: auto;
    border-radius: 0.75rem;
    border: 1px solid rgb(var(--fi-content-border));
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    background: rgb(var(--fi-content-bg));
}

.dark .invoice-table-container {
    border-color: rgb(var(--fi-content-border));
    background: rgb(var(--fi-content-bg));
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px 0 rgba(0, 0, 0, 0.2);
}

.invoice-table {
    width: 100%;
    border-collapse: collapse;
    background: rgb(var(--fi-content-bg));
    margin: 0;
}

.dark .invoice-table {
    background: rgb(var(--fi-content-bg));
}

.invoice-table th {
    padding: 1rem 1.25rem;
    text-align: left;
    background: rgb(var(--fi-modal-header-bg));
    border-bottom: 2px solid rgb(var(--fi-content-border));
    font-size: 0.875rem;
    font-weight: 600;
    color: rgb(var(--fi-modal-header-text));
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: sticky;
    top: 0;
    z-index: 10;
}

.dark .invoice-table th {
    background: rgb(var(--fi-modal-header-bg));
    color: rgb(var(--fi-modal-header-text));
    border-bottom-color: rgb(var(--fi-content-border));
}

.invoice-th-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.invoice-th-content svg {
    width: 1rem;
    height: 1rem;
    color: var(--invoice-icon-color, #64748b);
}

.invoice-table td {
    padding: 1.25rem;
    border-bottom: 1px solid rgb(var(--fi-content-border));
    vertical-align: middle;
    color: rgb(var(--fi-content-text));
}

.dark .invoice-table td {
    border-bottom-color: rgb(var(--fi-content-border));
    color: rgb(var(--fi-content-text));
}

/* Removed duplicate rule - using enhanced version below */

/* Enhanced Product Display - Filament Compatible */
.invoice-product-card {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.invoice-product-icon {
    background: rgb(var(--fi-modal-icon-bg));
    border-radius: 0.5rem;
    padding: 0.75rem;
    color: rgb(var(--fi-modal-icon-color));
    flex-shrink: 0;
    border: 1px solid rgb(var(--fi-modal-icon-border));
}

.invoice-product-info {
    flex: 1;
    min-width: 0;
}

.invoice-product-name {
    font-size: 1rem;
    font-weight: 600;
    color: rgb(var(--fi-content-text));
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.invoice-product-barcode {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: rgb(var(--fi-modal-subtitle-color));
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.dark .invoice-product-icon {
    background: rgb(var(--fi-modal-icon-bg));
    color: rgb(var(--fi-modal-icon-color));
    border-color: rgb(var(--fi-modal-icon-border));
}

.dark .invoice-product-name {
    color: rgb(var(--fi-content-text));
}

.dark .invoice-product-barcode {
    color: rgb(var(--fi-modal-subtitle-color));
}

/* Removed duplicate rule - using Filament-compatible version above */

.invoice-product-info {
    flex: 1;
    min-width: 0;
}

.invoice-product-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--invoice-value, #1e293b);
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.invoice-product-barcode {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--invoice-label, #64748b);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.invoice-product-barcode svg {
    width: 0.75rem;
    height: 0.75rem;
    color: var(--invoice-icon-color, #94a3b8);
}

/* Enhanced Unit Badge - Filament Compatible */
.invoice-unit-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    background: rgb(var(--fi-modal-icon-bg));
    color: rgb(var(--fi-modal-icon-color));
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid rgb(var(--fi-modal-icon-border));
}

.dark .invoice-unit-badge {
    background: rgb(var(--fi-modal-icon-bg));
    color: rgb(var(--fi-modal-icon-color));
    border-color: rgb(var(--fi-modal-icon-border));
}

/* Enhanced Quantity Display - Filament Compatible */
.invoice-quantity-display {
    text-align: center;
}

.invoice-quantity-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    background: rgb(var(--fi-modal-icon-bg));
    color: rgb(var(--fi-modal-icon-color));
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 700;
    border: 1px solid rgb(var(--fi-modal-icon-border));
}

.dark .invoice-quantity-number {
    background: rgb(var(--fi-modal-icon-bg));
    color: rgb(var(--fi-modal-icon-color));
    border-color: rgb(var(--fi-modal-icon-border));
}

/* Enhanced Price Display - Filament Compatible */
.invoice-price-display {
    font-size: 1rem;
    font-weight: 600;
    color: rgb(var(--fi-content-text));
    text-align: right;
}

.invoice-total-display {
    font-size: 1.125rem;
    font-weight: 700;
    color: rgb(var(--fi-content-text));
    text-align: right;
}

.dark .invoice-price-display {
    color: rgb(var(--fi-content-text));
}

.dark .invoice-total-display {
    color: rgb(var(--fi-content-text));
}

/* Enhanced Type Badge */
.invoice-item-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.invoice-item-type-badge.regular {
    background: rgb(var(--fi-modal-icon-bg));
    color: rgb(var(--fi-modal-icon-color));
    border: 1px solid rgb(var(--fi-modal-icon-border));
}

.invoice-item-type-badge.bonus {
    background: rgb(var(--fi-modal-icon-bg));
    color: rgb(var(--fi-modal-icon-color));
    border: 1px solid rgb(var(--fi-modal-icon-border));
}

.dark .invoice-item-type-badge.regular {
    background: rgb(var(--fi-modal-icon-bg));
    color: rgb(var(--fi-modal-icon-color));
    border-color: rgb(var(--fi-modal-icon-border));
}

.dark .invoice-item-type-badge.bonus {
    background: rgb(var(--fi-modal-icon-bg));
    color: rgb(var(--fi-modal-icon-color));
    border-color: rgb(var(--fi-modal-icon-border));
}

/* Sortable Table Headers */
.invoice-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease-in-out;
    position: relative;
}

.invoice-table th.sortable:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-1px);
}

.dark .invoice-table th.sortable:hover {
    background: rgba(255, 255, 255, 0.05);
}

.invoice-th-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.sort-icon {
    transition: all 0.2s ease-in-out;
    opacity: 0.5;
}

.invoice-table th.sortable:hover .sort-icon {
    opacity: 0.8;
}

.invoice-table th.sortable.active .sort-icon {
    opacity: 1;
    color: rgb(var(--fi-modal-icon-color));
}

/* Sort Animation */
.sort-animation {
    animation: slideInFromTop 0.3s ease-out forwards;
}

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced Table Interactions */
.invoice-table-row {
    transition: all 0.2s ease-in-out;
    border-bottom: 1px solid rgb(var(--fi-content-border));
}

.invoice-table-row:hover {
    background: rgb(var(--fi-modal-header-bg));
    transform: scale(1.01);
    box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.1);
}

.dark .invoice-table-row {
    border-bottom-color: rgb(var(--fi-content-border));
}

.dark .invoice-table-row:hover {
    background: rgb(var(--fi-modal-header-bg));
    box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.3);
}

.invoice-item-type-badge svg {
    width: 0.75rem;
    height: 0.75rem;
}

/* Filament Table Integration */
.invoice-filament-table {
    background: white;
    border-radius: 0.75rem;
    border: 1px solid var(--invoice-border, #e2e8f0);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.invoice-filament-table .fi-ta {
    border: none;
    box-shadow: none;
}

.invoice-filament-table .fi-ta-header {
    background: var(--invoice-th-bg, #f8fafc);
    border-bottom: 2px solid var(--invoice-border, #e2e8f0);
}

.invoice-filament-table .fi-ta-header-cell {
    padding: 1rem 1.25rem;
    font-weight: 600;
    color: var(--invoice-th, #475569);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.875rem;
}

.invoice-filament-table .fi-ta-row {
    border-bottom: 1px solid var(--invoice-border, #f1f5f9);
    transition: all 0.2s ease-in-out;
}

.invoice-filament-table .fi-ta-row:hover {
    background: var(--invoice-row-hover, #f8fafc);
    transform: scale(1.01);
    box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.1);
}

.invoice-filament-table .fi-ta-cell {
    padding: 1.25rem;
    vertical-align: middle;
}

.invoice-filament-table .fi-ta-cell:first-child {
    padding-left: 1.5rem;
}

.invoice-filament-table .fi-ta-cell:last-child {
    padding-right: 1.5rem;
}

/* Enhanced Filament Table Badges */
.invoice-filament-table .fi-badge {
    font-weight: 600;
    border-radius: 0.5rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

.invoice-filament-table .fi-badge-fi-color-success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.invoice-filament-table .fi-badge-fi-color-primary {
    background: #f0f9ff;
    color: #0ea5e9;
    border: 1px solid #bae6fd;
}

.invoice-filament-table .fi-badge-fi-color-info {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

/* Enhanced Filament Table Icons */
.invoice-filament-table .fi-ta-icon {
    width: 1rem;
    height: 1rem;
    margin-right: 0.5rem;
}

/* Enhanced Filament Table Text */
.invoice-filament-table .fi-ta-text {
    font-weight: 600;
    color: var(--invoice-value, #1e293b);
}

.invoice-filament-table .fi-ta-description {
    font-size: 0.875rem;
    color: var(--invoice-label, #64748b);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    margin-top: 0.25rem;
}

/* Modal-specific styles - Filament Compatible */
.invoice-details-modal {
    background: rgb(var(--fi-modal-bg));
    border-radius: 0.75rem;
    overflow: hidden;
    border: 1px solid rgb(var(--fi-modal-border));
    box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Dark mode support */
.dark .invoice-details-modal {
    background: rgb(var(--fi-modal-bg));
    border-color: rgb(var(--fi-modal-border));
    box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
}

.invoice-details-modal .invoice-header {
    background: rgb(var(--fi-modal-header-bg));
    color: rgb(var(--fi-modal-header-text));
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid rgb(var(--fi-modal-border));
}

/* Dark mode header */
.dark .invoice-details-modal .invoice-header {
    background: rgb(var(--fi-modal-header-bg));
    color: rgb(var(--fi-modal-header-text));
    border-bottom-color: rgb(var(--fi-modal-border));
}

/* Removed decorative background for cleaner Filament look */

.invoice-details-modal .invoice-header-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    z-index: 1;
}

.invoice-details-modal .invoice-header-icon {
    background: rgb(var(--fi-modal-icon-bg));
    border-radius: 0.5rem;
    padding: 0.75rem;
    border: 1px solid rgb(var(--fi-modal-icon-border));
}

.invoice-details-modal .invoice-header-icon svg {
    width: 1.5rem;
    height: 1.5rem;
    color: rgb(var(--fi-modal-icon-color));
}

/* Dark mode icon */
.dark .invoice-details-modal .invoice-header-icon {
    background: rgb(var(--fi-modal-icon-bg));
    border-color: rgb(var(--fi-modal-icon-border));
}

.dark .invoice-details-modal .invoice-header-icon svg {
    color: rgb(var(--fi-modal-icon-color));
}

.invoice-details-modal .invoice-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 0.25rem 0;
    color: rgb(var(--fi-modal-title-color));
    line-height: 1.2;
}

.invoice-details-modal .invoice-subtitle {
    font-size: 0.875rem;
    color: rgb(var(--fi-modal-subtitle-color));
    margin: 0;
    line-height: 1.4;
    font-weight: 400;
}

/* Dark mode text */
.dark .invoice-details-modal .invoice-title {
    color: rgb(var(--fi-modal-title-color));
}

.dark .invoice-details-modal .invoice-subtitle {
    color: rgb(var(--fi-modal-subtitle-color));
}
/* Enhanced Totals Section - Filament Compatible */
.invoice-totals-section {
    padding: 1.5rem;
    background: rgb(var(--fi-modal-header-bg));
    border-top: 1px solid rgb(var(--fi-content-border));
}

.dark .invoice-totals-section {
    background: rgb(var(--fi-modal-header-bg));
    border-top-color: rgb(var(--fi-content-border));
}

.invoice-totals-card {
    background: rgb(var(--fi-content-bg));
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid rgb(var(--fi-content-border));
}

.dark .invoice-totals-card {
    background: rgb(var(--fi-content-bg));
    border-color: rgb(var(--fi-content-border));
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
}

.invoice-totals-header {
    margin-bottom: 2rem;
    text-align: center;
}

.invoice-totals-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--invoice-title, #1e293b);
    margin: 0;
}

.invoice-totals-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .invoice-totals-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.invoice-total-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid var(--invoice-border, #e2e8f0);
    transition: all 0.2s ease-in-out;
}

.invoice-total-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.15);
}

.invoice-total-item.regular-total {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-color: #0ea5e9;
}

.invoice-total-item.bonus-total {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-color: #16a34a;
}

.invoice-total-item.grand-total {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-color: #f59e0b;
    border-width: 2px;
}

.invoice-total-icon {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 0.75rem;
    padding: 1rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

.invoice-total-item.regular-total .invoice-total-icon {
    color: #0ea5e9;
}

.invoice-total-item.bonus-total .invoice-total-icon {
    color: #16a34a;
}

.invoice-total-item.grand-total .invoice-total-icon {
    color: #f59e0b;
}

.invoice-total-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.invoice-total-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--invoice-label, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.invoice-total-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--invoice-value, #1e293b);
}

.invoice-total-item.regular-total .invoice-total-value {
    color: #0ea5e9;
}

.invoice-total-item.bonus-total .invoice-total-value {
    color: #16a34a;
}

.grand-total-amount {
    font-size: 1.5rem;
    color: #f59e0b;
    font-weight: 800;
}

/* Enhanced Empty State */
.invoice-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    background: var(--invoice-empty-bg, #f8fafc);
    border-radius: 1rem;
    margin: 2rem;
}

.invoice-empty-icon {
    background: var(--invoice-empty-icon-bg, #f1f5f9);
    border-radius: 50%;
    padding: 2rem;
    margin-bottom: 1.5rem;
    color: var(--invoice-empty-icon-color, #94a3b8);
}

.invoice-empty-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--invoice-empty-title, #64748b);
    margin: 0 0 0.5rem 0;
}

.invoice-empty-description {
    font-size: 1rem;
    color: var(--invoice-empty-description, #94a3b8);
    margin: 0;
    max-width: 24rem;
}

/* Price Details Styles */
.price-details-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.price-details-card {
    background: var(--price-card-bg, #fff);
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}
.price-details-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--price-title, #111);
    margin-bottom: 1rem;
}
.price-details-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}
@media (min-width: 768px) {
    .price-details-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
.price-details-section-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--price-section-label, #666);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}
.price-details-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.price-details-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.price-details-label {
    font-size: 0.875rem;
    color: var(--price-label, #666);
}
.price-details-value {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--price-value, #111);
}
.price-details-notes {
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--price-value, #111);
    background: var(--price-notes-bg, #f3f4f6);
    padding: 0.75rem;
    border-radius: 0.5rem;
}
.price-change-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}
.price-change-card {
    text-align: center;
    padding: 1rem;
    background: var(--price-change-bg, #f9fafb);
    border-radius: 0.5rem;
}
.price-change-amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--price-change-text, #111);
    margin-bottom: 0.25rem;
}
.price-change-label {
    font-size: 0.875rem;
    color: var(--price-change-label, #666);
}
.price-increase {
    color: #dc2626;
}
.price-decrease {
    color: #16a34a;
}

/* Stock Details Styles */
.stock-details-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.stock-details-card {
    background: var(--stock-card-bg, #fff);
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}
.stock-details-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--stock-title, #111);
    margin-bottom: 1rem;
}
.stock-details-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}
@media (min-width: 768px) {
    .stock-details-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
.stock-details-section-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--stock-section-label, #666);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}
.stock-details-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.stock-details-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.stock-details-label {
    font-size: 0.875rem;
    color: var(--stock-label, #666);
}
.stock-details-value {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--stock-value, #111);
}
.stock-details-notes {
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--stock-value, #111);
    background: var(--stock-notes-bg, #f3f4f6);
    padding: 0.75rem;
    border-radius: 0.5rem;
}
.stock-status-out {
    color: #dc2626;
}
.stock-status-low {
    color: #ca8a04;
}
.stock-status-normal {
    color: #16a34a;
}
.stock-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}
@media (min-width: 768px) {
    .stock-summary-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
.stock-summary-card {
    text-align: center;
    padding: 1rem;
    border-radius: 0.5rem;
}
.stock-summary-incoming {
    background: #f0fdf4;
}
.stock-summary-outgoing {
    background: #fef2f2;
}
.stock-summary-adjustment {
    background: #fffbeb;
}
.stock-summary-total {
    background: #eff6ff;
}
.stock-summary-amount {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}
.stock-summary-incoming .stock-summary-amount {
    color: #16a34a;
}
.stock-summary-outgoing .stock-summary-amount {
    color: #dc2626;
}
.stock-summary-adjustment .stock-summary-amount {
    color: #ca8a04;
}
.stock-summary-total .stock-summary-amount {
    color: #2563eb;
}
.stock-summary-label {
    font-size: 0.875rem;
    color: var(--stock-summary-label, #666);
}
.stock-movements-recent {
    margin-top: 1.5rem;
}
.stock-movements-subtitle {
    font-size: 1rem;
    font-weight: 600;
    color: var(--stock-title, #111);
    margin-bottom: 0.75rem;
}
.stock-movements-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.stock-movement-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--stock-movement-bg, #f9fafb);
    border-radius: 0.5rem;
}
.stock-movement-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.stock-movement-type {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--stock-value, #111);
}
.stock-movement-time {
    font-size: 0.875rem;
    color: var(--stock-label, #666);
}
.stock-movement-quantity {
    font-size: 0.875rem;
    font-weight: 500;
}
.stock-movement-positive {
    color: #16a34a;
}
.stock-movement-negative {
    color: #dc2626;
}

/* Stock Movements Styles */
.stock-movements-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.stock-movements-card {
    background: var(--stock-card-bg, #fff);
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}
.stock-movements-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--stock-title, #111);
    margin-bottom: 1rem;
}
.stock-movements-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.stock-movement-card {
    border: 1px solid var(--stock-movement-border, #e5e7eb);
    border-radius: 0.5rem;
    padding: 1rem;
}
.stock-movement-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}
.stock-movement-content {
    flex: 1;
}
.stock-movement-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}
.stock-movement-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}
.stock-movement-badge-incoming {
    background: #f0fdf4;
    color: #16a34a;
}
.stock-movement-badge-outgoing {
    background: #fef2f2;
    color: #dc2626;
}
.stock-movement-badge-adjustment {
    background: #fffbeb;
    color: #ca8a04;
}
.stock-movement-time {
    font-size: 0.875rem;
    color: var(--stock-label, #666);
}
.stock-movement-details {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
@media (min-width: 768px) {
    .stock-movement-details {
        grid-template-columns: repeat(3, 1fr);
    }
}
.stock-movement-detail {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.stock-movement-detail-label {
    font-size: 0.875rem;
    color: var(--stock-label, #666);
}
.stock-movement-detail-value {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--stock-value, #111);
}
.stock-movement-notes {
    margin-top: 0.75rem;
}
.stock-movement-notes-label {
    font-size: 0.875rem;
    color: var(--stock-label, #666);
}
.stock-movement-notes-content {
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--stock-value, #111);
    background: var(--stock-notes-bg, #f3f4f6);
    padding: 0.5rem;
    border-radius: 0.25rem;
}
.stock-movement-quantity-display {
    text-align: right;
}
.stock-movement-quantity-amount {
    font-size: 1.5rem;
    font-weight: 700;
}
.stock-movement-quantity-unit {
    font-size: 0.75rem;
    color: var(--stock-label, #666);
}
.stock-movements-summary {
    margin-top: 1.5rem;
    background: var(--stock-summary-bg, #f9fafb);
    border-radius: 0.5rem;
    padding: 1rem;
}
.stock-movements-summary-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--stock-title, #111);
    margin-bottom: 0.75rem;
}
.stock-movements-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}
@media (min-width: 768px) {
    .stock-movements-summary-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
.stock-movements-summary-item {
    text-align: center;
}
.stock-movements-summary-amount {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}
.stock-movements-summary-incoming {
    color: #16a34a;
}
.stock-movements-summary-outgoing {
    color: #dc2626;
}
.stock-movements-summary-adjustment {
    color: #ca8a04;
}
.stock-movements-summary-total {
    color: #2563eb;
}
.stock-movements-summary-label {
    font-size: 0.75rem;
    color: var(--stock-summary-label, #666);
}
.stock-movements-empty {
    text-align: center;
    padding: 2rem 0;
}
.stock-movements-empty-title {
    color: var(--stock-empty-title, #666);
    font-size: 1.125rem;
}
.stock-movements-empty-subtitle {
    color: var(--stock-empty-subtitle, #999);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* Barcode Scanner Styles */
.barcode-scanner-container {
    position: relative;
}
.barcode-scanner-input {
    display: block;
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--barcode-border, #d1d5db);
    border-radius: 0.5rem;
    background: var(--barcode-bg, #fff);
    color: var(--barcode-text, #111);
    font-size: 0.875rem;
    transition: all 0.15s ease-in-out;
}
.barcode-scanner-input:focus {
    outline: none;
    border-color: var(--barcode-focus-border, #3b82f6);
    box-shadow: 0 0 0 3px var(--barcode-focus-ring, rgba(59, 130, 246, 0.1));
}
.barcode-scanner-input:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}
.barcode-scanner-input-error {
    border-color: var(--barcode-error-border, #dc2626);
    box-shadow: 0 0 0 3px var(--barcode-error-ring, rgba(220, 38, 38, 0.1));
}
.barcode-scanner-indicator {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    padding-right: 0.75rem;
}
.barcode-scanner-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.barcode-scanner-dot {
    width: 0.5rem;
    height: 0.5rem;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
.barcode-scanner-icon {
    /* width: 1.25rem;
    height: 1.25rem; */
    color: var(--barcode-icon, #9ca3af);
}
.barcode-scanner-helper {
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--barcode-helper, #666);
}
.barcode-scanner-status-text {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--barcode-status, #9ca3af);
}

/* Provider Sale Details Styles */
.provider-sale-details {
    padding: 1rem;
    border-radius: 0.5rem;
    background: var(--provider-card-bg, #fff);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}
.provider-sale-details-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.provider-sale-details-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.provider-sale-details-label {
    font-weight: 600;
    color: var(--provider-label, #374151);
}
.provider-sale-details-value {
    color: var(--provider-value, #111);
}

/* Responsive Design Improvements */
@media (max-width: 768px) {
    .invoice-header {
        padding: 1.5rem;
    }
    
    .invoice-header-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .invoice-title {
        font-size: 1.5rem;
    }
    
    .invoice-details-card {
        padding: 1.5rem;
    }
    
    .invoice-details-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .invoice-table-section {
        padding: 1.5rem;
    }
    
    .invoice-table-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .invoice-table th,
    .invoice-table td {
        padding: 0.75rem;
        font-size: 0.875rem;
    }
    
    .invoice-product-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .invoice-product-icon {
        align-self: center;
    }
    
    .invoice-totals-section {
        padding: 1.5rem;
    }
    
    .invoice-totals-card {
        padding: 1.5rem;
    }
    
    .invoice-totals-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .invoice-total-item {
        padding: 1rem;
    }
    
    .invoice-total-value {
        font-size: 1.125rem;
    }
    
    .grand-total-amount {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .invoice-container {
        margin: 0;
        border-radius: 0;
    }
    
    .invoice-header {
        padding: 1rem;
    }
    
    .invoice-details-card,
    .invoice-table-section,
    .invoice-totals-section {
        padding: 1rem;
    }
    
    .invoice-table-container {
        border-radius: 0.5rem;
    }
    
    .invoice-table th,
    .invoice-table td {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
    
    .invoice-th-content {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .invoice-th-content svg {
        width: 0.875rem;
        height: 0.875rem;
    }
    
    .invoice-product-name {
        font-size: 0.9rem;
    }
    
    .invoice-product-barcode {
        font-size: 0.8rem;
    }
    
    .invoice-quantity-number {
        min-width: 2rem;
        height: 2rem;
        font-size: 0.9rem;
    }
    
    .invoice-item-type-badge {
        padding: 0.375rem 0.5rem;
        font-size: 0.8rem;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --invoice-bg: #1e293b;
        --invoice-details-bg: #0f172a;
        --invoice-title: #fff;
        --invoice-label: #94a3b8;
        --invoice-value: #f1f5f9;
        --invoice-table-bg: #1e293b;
        --invoice-th: #e2e8f0;
        --invoice-th-bg: #334155;
        --invoice-row-hover: #334155;
        --invoice-border: #475569;
        --invoice-tfoot-bg: #334155;
        --invoice-icon-bg: #334155;
        --invoice-icon-color: #94a3b8;
        --invoice-count-bg: #334155;
        --invoice-count-color: #60a5fa;
        --invoice-product-icon-bg: #334155;
        --invoice-unit-bg: #334155;
        --invoice-unit-color: #e2e8f0;
        --invoice-quantity-bg: #1e40af;
        --invoice-quantity-color: #93c5fd;
        --invoice-quantity-border: #3b82f6;
        --invoice-total-color: #10b981;
        --invoice-totals-bg: #0f172a;
        --invoice-empty-bg: #0f172a;
        --invoice-empty-icon-bg: #334155;
        --invoice-empty-icon-color: #64748b;
        --invoice-empty-title: #94a3b8;
        --invoice-empty-description: #64748b;
        
        --price-card-bg: #1f2937;
        --price-title: #fff;
        --price-section-label: #9ca3af;
        --price-label: #9ca3af;
        --price-value: #fff;
        --price-notes-bg: #374151;
        --price-change-bg: #374151;
        --price-change-text: #fff;
        --price-change-label: #9ca3af;
        
        --stock-card-bg: #1f2937;
        --stock-title: #fff;
        --stock-section-label: #9ca3af;
        --stock-label: #9ca3af;
        --stock-value: #fff;
        --stock-notes-bg: #374151;
        --stock-summary-label: #9ca3af;
        --stock-movement-bg: #374151;
        --stock-movement-border: #4b5563;
        --stock-summary-bg: #374151;
        --stock-empty-title: #9ca3af;
        --stock-empty-subtitle: #6b7280;
        
        --barcode-border: #4b5563;
        --barcode-bg: #374151;
        --barcode-text: #fff;
        --barcode-focus-border: #3b82f6;
        --barcode-focus-ring: rgba(59, 130, 246, 0.2);
        --barcode-error-border: #ef4444;
        --barcode-error-ring: rgba(239, 68, 68, 0.2);
        --barcode-icon: #6b7280;
        --barcode-helper: #9ca3af;
        --barcode-status: #6b7280;
        
        --provider-card-bg: #1f2937;
        --provider-label: #9ca3af;
        --provider-value: #fff;
    }
    
    .invoice-badge-regular {
        background: #2a3a8c;
        color: #e3e8ff;
    }
    .invoice-badge-bonus {
        background: #1a7f37;
        color: #e0f7e9;
    }
    .invoice-no-items {
        color: #aaa;
    }
    
    .stock-summary-incoming {
        background: #064e3b;
    }
    .stock-summary-outgoing {
        background: #7f1d1d;
    }
    .stock-summary-adjustment {
        background: #78350f;
    }
    .stock-summary-total {
        background: #1e3a8a;
    }
    
    .stock-movement-badge-incoming {
        background: #064e3b;
        color: #4ade80;
    }
    .stock-movement-badge-outgoing {
        background: #7f1d1d;
        color: #f87171;
    }
    .stock-movement-badge-adjustment {
        background: #78350f;
        color: #fbbf24;
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}


@media (max-width: 640px) {
    /* Hide the real header */
    .fi-ta-content thead {
      display: none !important;
    }
  
    /* Make each row a "card" */
    .fi-ta-table tbody tr {
      display: block !important;
      margin-bottom: 1rem !important;
      border: 1px solid var(--border) !important;
      border-radius: 8px !important;
      background: var(--bg-light) !important;
      overflow: hidden !important;
    }
  
    /* Flex each cell */
    .fi-ta-table tbody tr > td {
      display: flex !important;
      justify-content: space-between !important;
      align-items: center !important;
      padding: 0.75rem 1rem !important;
      border: none !important;
      border-bottom: 1px solid var(--border) !important;
      position: relative !important;
    }
    .fi-ta-table tbody tr > td:last-child {
      border-bottom: none !important;
    }
  
    /* Inject header text from data-label */
    .fi-ta-table tbody tr > td::before {
      content: attr(data-label) !important;
      font-weight: 600 !important;
      color: var(--text-light) !important;
      margin-right: 0.5rem !important;
      white-space: nowrap !important;
    }

    /* Widget Tables Support */
    .fi-wi table thead {
      display: none !important;
    }

    .fi-wi table tbody tr {
      display: block !important;
      margin-bottom: 1rem !important;
      border: 1px solid var(--border) !important;
      border-radius: 8px !important;
      background: var(--bg-light) !important;
      overflow: hidden !important;
    }

    .fi-wi table tbody tr > td {
      display: flex !important;
      justify-content: space-between !important;
      align-items: center !important;
      padding: 0.75rem 1rem !important;
      border: none !important;
      border-bottom: 1px solid var(--border) !important;
      position: relative !important;
    }
    .fi-wi table tbody tr > td:last-child {
      border-bottom: none !important;
    }

    .fi-wi table tbody tr > td::before {
      content: attr(data-label) !important;
      font-weight: 600 !important;
      color: var(--text-light) !important;
      margin-right: 0.5rem !important;
      white-space: nowrap !important;
    }

    /* Relation Manager Tables Support */
    .fi-rm table thead {
      display: none !important;
    }

    .fi-rm table tbody tr {
      display: block !important;
      margin-bottom: 1rem !important;
      border: 1px solid var(--border) !important;
      border-radius: 8px !important;
      background: var(--bg-light) !important;
      overflow: hidden !important;
    }

    .fi-rm table tbody tr > td {
      display: flex !important;
      justify-content: space-between !important;
      align-items: center !important;
      padding: 0.75rem 1rem !important;
      border: none !important;
      border-bottom: 1px solid var(--border) !important;
      position: relative !important;
    }
    .fi-rm table tbody tr > td:last-child {
      border-bottom: none !important;
    }

    .fi-rm table tbody tr > td::before {
      content: attr(data-label) !important;
      font-weight: 600 !important;
      color: var(--text-light) !important;
      margin-right: 0.5rem !important;
      white-space: nowrap !important;
    }

    /* Generic Table Support for any Filament table */
    .fi-table table thead {
      display: none !important;
    }

    .fi-table table tbody tr {
      display: block !important;
      margin-bottom: 1rem !important;
      border: 1px solid var(--border) !important;
      border-radius: 8px !important;
      background: var(--bg-light) !important;
      overflow: hidden !important;
    }

    .fi-table table tbody tr > td {
      display: flex !important;
      justify-content: space-between !important;
      align-items: center !important;
      padding: 0.75rem 1rem !important;
      border: none !important;
      border-bottom: 1px solid var(--border) !important;
      position: relative !important;
    }
    .fi-table table tbody tr > td:last-child {
      border-bottom: none !important;
    }

    .fi-table table tbody tr > td::before {
      content: attr(data-label) !important;
      font-weight: 600 !important;
      color: var(--text-light) !important;
      margin-right: 0.5rem !important;
      white-space: nowrap !important;
    }

    /* Additional selectors for edge cases */
    [class*="fi-wi"] table thead,
    [class*="fi-rm"] table thead,
    [class*="fi-ta"] table thead {
      display: none !important;
    }

    [class*="fi-wi"] table tbody tr,
    [class*="fi-rm"] table tbody tr,
    [class*="fi-ta"] table tbody tr {
      display: block !important;
      margin-bottom: 1rem !important;
      border: 1px solid var(--border) !important;
      border-radius: 8px !important;
      background: var(--bg-light) !important;
      overflow: hidden !important;
    }

    [class*="fi-wi"] table tbody tr > td,
    [class*="fi-rm"] table tbody tr > td,
    [class*="fi-ta"] table tbody tr > td {
      display: flex !important;
      justify-content: space-between !important;
      align-items: center !important;
      padding: 0.75rem 1rem !important;
      border: none !important;
      border-bottom: 1px solid var(--border) !important;
      position: relative !important;
    }

    [class*="fi-wi"] table tbody tr > td:last-child,
    [class*="fi-rm"] table tbody tr > td:last-child,
    [class*="fi-ta"] table tbody tr > td:last-child {
      border-bottom: none !important;
    }

    [class*="fi-wi"] table tbody tr > td::before,
    [class*="fi-rm"] table tbody tr > td::before,
    [class*="fi-ta"] table tbody tr > td::before {
      content: attr(data-label) !important;
      font-weight: 600 !important;
      color: var(--text-light) !important;
      margin-right: 0.5rem !important;
      white-space: nowrap !important;
    }
  }

/* Mobile Bulk Action Message - Make it smaller and prevent truncation */
@media (max-width: 768px) {
  /* Make bulk action message smaller and more compact */
  .fi-ta-content .fi-ta-bulk-actions-message,
  .fi-ta-content .fi-ta-bulk-actions-notification,
  .filament-tables-bulk-actions,
  .fi-ta-bulk-actions,
  .fi-ta-bulk-actions-message,
  .fi-ta-bulk-actions-notification,
  .fi-ta-bulk-actions-info,
  .fi-ta-bulk-actions-header,
  .fi-ta-bulk-actions-content,
  .fi-ta-bulk-actions-footer,
  [class*="bulk-actions-message"],
  [class*="bulk-actions-notification"],
  [class*="bulk-actions-info"] {
    font-size: 0.75rem !important;
    padding: 0.25rem 0.5rem !important;
    margin: 0.25rem 0 !important;
    line-height: 1.2 !important;
    background: rgba(59, 130, 246, 0.1) !important;
    border: 1px solid rgba(59, 130, 246, 0.2) !important;
    border-radius: 0.375rem !important;
    text-align: center !important;
    opacity: 0.8 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
  }
  
  /* Ensure the text doesn't wrap and shows ellipsis if too long */
  .fi-ta-bulk-actions-message span,
  .fi-ta-bulk-actions-notification span,
  [class*="bulk-actions"] span {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: inline-block !important;
    max-width: 100% !important;
  }
}

/* Prevent horizontal scroll in RTL safely */
/* [dir="rtl"] .fi-content,
[dir="rtl"] .fi-body { 
    overflow-x: hidden !important;
} */

/* Ensure widgets never overflow */
/* [dir="rtl"] .fi-wi-stats-overview,
[dir="rtl"] .fi-section {
    max-width: 100% !important;
} */
