/* Admin Dashboard Styles with Tenant Branding Support */

:root {
    /* Neutral defaults - will be immediately overridden by tenant branding */
    --primary-color: #666666;
    --primary-hover: #555555;
    /* Auto-calculated darker shade for button hover */
    --secondary-color: #888888;
    --accent-color: #999999;
    --text-dark: #333;
    --text-light: #666;
    --bg-light: #f5f5f5;
    --bg-white: #ffffff;
    --border-color: #e0e0e0;
    --danger-color: #d32f2f;
    --warning-color: #f57c00;
}

html {
    background: var(--bg-light);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
}

/* Layout */
.admin-container {
    display: grid;
    grid-template-columns: 250px 1fr;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    transition: grid-template-columns 0.3s ease;
}

.admin-container.sidebar-collapsed {
    grid-template-columns: 70px 1fr;
}


/* Sidebar */
.sidebar {
    background: var(--bg-white);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.sidebar-header {
    padding: 15px 17px;
    border-bottom: 1px solid var(--border-color);
    background: var(--primary-color);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 65px;
}

.sidebar-header h2 {
    font-size: 18px;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity 0.2s ease;
}

.sidebar-collapsed .sidebar-header h2 {
    opacity: 0;
    width: 0;
    pointer-events: none;
}

.sidebar-toggle-btn {
    background: transparent;
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    min-width: 30px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    position: relative;
    /* Ensure z-index works */
    z-index: 100;
    /* Priority over potential overlays */
}

.sidebar-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.sidebar-collapsed #sidebar-toggle .icon {
    transform: rotate(180deg);
}


.sidebar-nav {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.sidebar-footer {
    border-top: 1px solid var(--border-color);
    padding: 10px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-dark);
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
}

.nav-item:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

.nav-item.active {
    background: var(--primary-color);
    color: white;
    border-left: 4px solid var(--accent-color);
}

.nav-item .icon {
    font-size: 20px;
    min-width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-item .icon svg {
    width: 20px;
    height: 20px;
}

.nav-item span:not(.icon) {
    white-space: nowrap;
    overflow: hidden;
    transition: opacity 0.2s ease;
}

.sidebar-collapsed .nav-item span:not(.icon) {
    opacity: 0;
    width: 0;
    pointer-events: none;
}

.sidebar-collapsed .nav-item {
    justify-content: center;
    padding: 12px 0;
}


/* Main Content */
.main-content {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.content-header {
    background: var(--bg-white);
    padding: 20px 30px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.content-header h1 {
    font-size: 28px;
    color: var(--text-dark);
}

.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.content-body {
    padding: 30px;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* When stock view is active, content-body becomes a flex column so
   #stock-table-container can be the sole scroller */
.content-body.stock-active {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding-bottom: 0;
}

/* Views */
.view {
    display: none;
}

.view.active {
    display: block;
}

#stock-view.active {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

/* Fixed, non-scrolling header block (thead + new-product-row) */
#stock-fixed-top {
    flex-shrink: 0;
    overflow-x: hidden;
    /* scroll driven by JS from #stock-table-container */
    border-radius: 8px 8px 0 0;
}

#stock-fixed-top table {
    table-layout: fixed;
    min-width: 1320px;
    width: 100%;
    border-radius: 8px 8px 0 0;
    box-shadow: none;
    overflow: visible;
}


.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
    flex-shrink: 0;
    background: var(--bg-light);
    padding: 10px 0;
    z-index: 100;
}


/* Within the flex stock view the header sticks to top 0 (no outer scroll) */
#stock-view .view-header {
    flex-shrink: 0;
    margin-bottom: 10px;
}


.view-header:is(.view-header-scrolled) {
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.actions {
    display: flex;
    gap: 10px;
}

.search-box {
    position: relative;
    display: inline-block;
}

.search-box input {
    padding: 10px 15px;
    padding-right: 35px; /* Space for the clear button */
    border: 1px solid var(--border-color);
    border-radius: 6px;
    width: 300px;
    font-size: 14px;
}

.search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #999;
    font-weight: bold;
    font-size: 20px;
    display: none;
    line-height: 1;
    user-select: none;
    transition: color 0.2s;
}

.search-clear:hover {
    color: var(--primary-color);
}

/* Dashboard Revamp */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.stat-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.04);
}

.stat-card.primary {
    border-left: 4px solid var(--primary-color);
}

.stat-card.danger {
    border-left: 4px solid #f1416c;
}

.stat-icon {
    font-size: 2rem;
    width: 60px;
    height: 60px;
    background: var(--bg-light);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-details h3 {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: #181c32;
    margin: 4px 0;
}

.stat-subtitle {
    font-size: 0.75rem;
    color: #999;
}

/* Trend Bars */
.trend-bar-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
    min-width: 25px;
    max-width: 45px;
}

.trend-bar {
    width: 100%;
    background: var(--primary-color);
    opacity: 0.6;
    border-radius: 4px 4px 0 0;
    transition: all 0.2s ease-out;
    cursor: pointer;
}

.trend-bar:hover {
    opacity: 0.9;
    transform: scaleX(1.1);
}

.trend-label {
    font-size: 0.65rem;
    color: #666;
    margin-top: 10px;
    white-space: nowrap;
    text-align: center;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn:disabled {
    background: #e0e0e0 !important;
    color: #999 !important;
    cursor: not-allowed;
    border: 1px solid #ccc !important;
    opacity: 0.7;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-success {
    background: #4caf50;
    color: white;
}

.btn-success:hover {
    background: #43a047;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

/* Tables */
table {
    width: 100%;
    background: var(--bg-white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

th {
    background: var(--bg-light);
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: var(--text-dark);
    border-bottom: 2px solid var(--border-color);
}

td {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

tr:hover {
    background: #f9f9f9;
}

tr:last-child td {
    border-bottom: none;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-white);
    padding: 30px;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

/* Wide modal for CSV preview and large content */
.modal-content.modal-wide {
    max-width: 1100px;
    width: 95%;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-light);
}

.modal-close:hover {
    color: var(--text-dark);
}

.modal h2 {
    margin-bottom: 20px;
    color: var(--text-dark);
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-dark);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}

.form-group input[type="checkbox"],
.form-group input[type="radio"] {
    width: auto;
    padding: 0;
    margin: 0;
    cursor: pointer;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

/* Upload  Area */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    background: var(--bg-light);
    cursor: pointer;
    transition: all 0.2s;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: #f0f8f0;
}

.upload-area.dragover {
    border-color: var(--primary-color);
    background: #e8f5e9;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
}

/* Quick Actions */
.quick-actions {
    background: var(--bg-white);
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.quick-actions h2 {
    margin-bottom: 15px;
    font-size: 20px;
}

.quick-actions button {
    margin-right: 10px;
    margin-bottom: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .admin-container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .view-header {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box input {
        width: 100%;
    }
}

/* Utility Classes */
.text-success {
    color: var(--primary-color);
}

.text-danger {
    color: var(--danger-color);
}

.text-warning {
    color: var(--warning-color);
}

.badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: #c8e6c9;
    color: #1b5e20;
}

/* Sync Badge States */
.badge.sync-online {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.badge.sync-offline {
    background: #fff3e0;
    color: #ef6c00;
    border: 1px solid #ffe0b2;
}

.badge.sync-pending {
    background: #e3f2fd;
    color: #1976d2;
    border: 1px solid #bbdefb;
}

.badge.sync-error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.badge-warning {
    background: #fff9c4;
    color: #f57f17;
}

.badge-info {
    background: #bbdefb;
    color: #1565c0;
}

.badge-secondary {
    background: #e0e0e0;
    color: #424242;
}

/* Theme Customization Styles */
.settings-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.settings-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-section p {
    margin-bottom: 20px;
    color: #666;
}

.theme-settings {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.theme-preview-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.theme-preview-box {
    width: 120px;
    height: 60px;
    border-radius: 8px;
    border: 2px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 14px;
    transition: all 0.3s ease;
}

.custom-theme-panel {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-top: 15px;
}

.custom-theme-panel h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
}

.custom-colors-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.color-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.color-input-group label {
    font-weight: bold;
    color: #333;
    font-size: 14px;
}

.color-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

.color-picker {
    width: 50px;
    height: 35px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.color-hex {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: monospace;
    font-size: 14px;
}

.custom-theme-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Responsive for theme customization */
@media (min-width: 768px) {
    .custom-colors-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Stock Management Improvements */
.new-product-row {
    background-color: #f0f7f0;
    border-bottom: 2px solid var(--primary-color) !important;
}

.new-product-row td {
    padding: 10px 15px;
    position: sticky;
    top: 50px;
    /* Sits right beneath the 50px sticky header */
    z-index: 9;
    background-color: #f0f7f0;
    /* Ensure solid background for sticky */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    /* subtle shadow below sticky row */
}

.new-product-row input,
.new-product-row select {
    border: 1px solid var(--primary-color);
    padding: 8px 10px;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.stock-table input,
.stock-table select {
    border: 1px solid transparent;
    padding: 8px 10px;
    border-radius: 4px;
    font-size: 14px;
    background: transparent;
    transition: background-color 0.6s ease, border-color 0.2s ease;
    width: 100%;
}

.stock-table input[type="number"] {
    text-align: center;
}

.stock-table td:hover input,
.stock-table td:hover select {
    background: rgba(0, 0, 0, 0.02);
    border-color: #eee;
}

.stock-table input:focus,
.stock-table select:focus {
    background: white !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 2px rgba(46, 125, 50, 0.1);
    outline: none;
}

/* Success/Error Feedback */
.success-flash {
    background-color: #d4edda !important;
    border-color: #28a745 !important;
    transition: none !important;
    /* Spark immediately */
}

.error-flash {
    background-color: #f8d7da !important;
    border-color: #dc3545 !important;
    transition: none !important;
    /* Spark immediately */
}

/* Hide number spinners */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.category-manager-table th {
    background: #fdfdfd;
    font-size: 13px;
}

.category-manager-table tr:hover {
    background-color: #f8f9fa;
}

.category-manager-table input:focus {
    background: white !important;
    border: 1px solid var(--primary-color) !important;
    padding-left: 10px !important;
}

/* Stock Table Column Widths & Scrolling */
#stock-table-container {
    overflow: auto;
    flex: 1;
    min-height: 0;
    width: 100%;
    border-top: none;
    border-radius: 0 0 8px 8px;
}

.stock-table {
    min-width: 1320px;
    border-collapse: collapse;
    table-layout: fixed;
    width: 100%;
}

.stock-table th {
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
    height: 50px;
    box-sizing: border-box;
    box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.1);
    /* shadow below header */
}

/* Ensure inputs take full width of these constrained cells */
.stock-table input,
.stock-table select {
    width: 100%;
    min-width: 0;
    /* Allow shrinking within cell */
}

/* Category Deletion Preview */
#delete-category-products {
    border: 1px solid #dee2e6;
    line-height: 1.6;
}

#delete-category-products em {
    color: #999;
}

input[name="delete-strategy"] {
    margin-top: 2px;
}

/* Category Inactive States */
.category-inactive {
    opacity: 0.7;
    background-color: #fdfdfd;
}

.category-inactive td:first-child::before {
    content: "⚠️ ";
}

.stock-table tr.category-inactive:hover {
    opacity: 1;
    background-color: #fff9c4;
    /* Pale warning yellow on hover */
}

/* Draggable Rows */
.category-manager-table tr.dragging {
    opacity: 0.5;
    background: #e3f2fd;
    border: 2px dashed #2196f3;
}

.drag-handle {
    cursor: grab;
    color: #ccc;
    padding: 0 10px;
    font-size: 20px;
}

.drag-handle:active {
    cursor: grabbing;
}

/* Product Drag-Drop Visual Feedback */
tr.dragging {
    opacity: 0.4;
    background: #e3f2fd !important;
}

tr.drag-over-above {
    position: relative;
}

tr.drag-over-above::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #4caf50, #81c784, #4caf50);
    z-index: 10;
    box-shadow: 0 0 10px #4caf50;
}

tr.drag-over-below {
    position: relative;
}

tr.drag-over-below::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #4caf50, #81c784, #4caf50);
    z-index: 10;
    box-shadow: 0 0 10px #4caf50;
}

tr.drag-blocked {
    background: #ffcdd2 !important;
    cursor: not-allowed;
}

/* Settings Accordion Styles */
.settings-accordion {
    margin-top: 20px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-white);
}

.accordion-section {
    border-bottom: 1px solid var(--border-color);
}

.accordion-section:last-child {
    border-bottom: none;
}

.accordion-header {
    width: 100%;
    padding: 18px 25px;
    background: #fafafa;
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-align: left;
}

.accordion-header:hover {
    background: #f0f0f0;
}

.accordion-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 12px;
}

.accordion-header .chevron {
    font-size: 12px;
    color: var(--text-light);
    transition: transform 0.3s ease;
}

.accordion-section.active .accordion-header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
}

.accordion-section.active .chevron {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease;
    background: var(--bg-white);
}

.accordion-section.active .accordion-content {
    max-height: 2000px;
    /* Large enough to fit content */
    padding: 25px;
    transition: max-height 0.5s ease-in, padding 0.3s ease;
}

/* Refined Form Layouts in Settings */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.settings-sub-header {
    grid-column: 1 / -1;
    margin-top: 10px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
    color: #888;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.help-text {
    font-size: 12px;
    color: #888;
    margin-top: 5px;
    display: block;
}

.settings-actions {
    margin-top: 30px;
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

/* Theme Mini Preview Improvement */
.theme-preview-container {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Report Revamp Styles */
.report-group-header {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 30px 0 15px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.no-data {
    color: var(--text-light);
    font-style: italic;
    text-align: center;
    padding: 30px;
}

.settings-card {
    background: var(--bg-white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Orders View Styles */
#orders-view .filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    padding: 2px 10px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

#orders-view .filter-group span {
    font-weight: 600;
    color: var(--text-light);
    font-size: 0.8rem;
}

#orders-view .filter-group input,
#orders-view .filter-group select {
    border: none;
    padding: 8px 4px;
    background: transparent;
    outline: none;
    font-size: 0.9rem;
}

#orders-view .search-box input {
    width: 350px;
}

/* Modal Body Overlay for Loading */
#invoice-viewer-modal .modal-body iframe {
    transition: opacity 0.3s ease;
}

#invoice-viewer-modal .modal-body.loading::after {
    content: 'Loading Preview...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-light);
    font-weight: 600;
}