/* Prevent theme flash - explicit backgrounds and color-scheme for both modes */
:root {
    color-scheme: light;
}

html {
    background-color: #FAFAFA; /* Light background - MudBlazor surface default */
}

    html[data-dark-mode="true"] {
        color-scheme: dark;
        background-color: #0F172A; /* Matches AppPalettes.Dark.Background */
    }

    html:not([data-dark-mode="true"]) body,
    body {
        background-color: inherit;
    }

    html[data-dark-mode="true"] body {
        background-color: #0F172A;
    }

/* Default styles */
.content-container {
    padding: 1rem;
    border-radius: 4px;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

/* toolbar container for _table filters */
.filter-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* PageHeader: separates form actions (Cancel / Save) from workflow / extra action */
.page-header-toolbar-sep {
    align-self: center;
    width: 1px;
    height: 26px;
    margin: 0 4px 0 10px;
    background: var(--mud-palette-lines-default);
    opacity: 0.75;
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .filter-toolbar > * {
        width: 100% !important;
    }
}

/* Section Headers - Multiple approaches for better compatibility */
.section-header {
    font-weight: bold !important;
    padding-bottom: 0.5rem !important;
    margin-bottom: 0.25rem !important;
}

.mud-typography.section-header {
    font-weight: bold !important;
    padding-bottom: 0.5rem !important;
    margin-bottom: 0.25rem !important;
}

/* Higher specificity for MudText components */
.mud-text.section-header,
.mud-typography-subtitle1.section-header,
.mud-typography.mud-typography-subtitle1.section-header {
    font-weight: bold !important;
    padding-bottom: 0.5rem !important;
    margin-bottom: 0.25rem !important;
}

.section-subtitle {
    font-weight: bold !important;
    padding-bottom: 0.5rem !important;
    margin-bottom: 0.25rem !important;
}

.mud-typography.section-subtitle {
    font-weight: bold !important;
    padding-bottom: 0.5rem !important;
    margin-bottom: 0.25rem !important;
}

/* High specificity section header */
.mud-paper .section-header,
.mud-grid .section-header,
div .section-header {
    font-weight: bold !important;
    padding-bottom: 0.5rem !important;
    margin-bottom: 0.25rem !important;
}

/* Customer information - normalize AutoComplete display text font size (Myanmar script fallback) */
.customer-information-fields .mud-autocomplete .mud-input-slot,
.customer-information-fields .mud-autocomplete .mud-input-slot input,
.customer-information-fields .mud-autocomplete input,
.autocomplete-font-fix .mud-input-slot,
.autocomplete-font-fix .mud-input-slot input,
.autocomplete-font-fix input {
    font-size: 0.8125rem !important;
}

/* Section equal height - for side-by-side layouts in AppGrid */
.section-equal-height {
    width: 100%;
    height: 100%;
    /* Grow to fill remaining space when stacked in a flex column */
    flex: 1 1 auto;
    min-height: 0;
}

    .section-equal-height > * {
        height: 100%;
    }

/* Section content area when FillHeight - fills remaining space, no extra padding */
.section-fill-content {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
}

/* CMS Screen Create/Edit - Sticky preview sidebar */
.screen-preview-sticky {
    width: 100%;
    position: sticky;
    top: 1rem;
    align-self: flex-start;
}

    .screen-preview-sticky .screen-preview-paper {
        border: 1px solid var(--mud-palette-lines-default);
        border-radius: 12px;
        max-width: 100%;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    }

/* Premium Dialog - Shared styles for all premium dialogs (ProductSelection, BrandSelection, etc.)
   Use PremiumDialog component. Change layout in PremiumDialog.razor or styles here to update all dialogs. */
.premium-dialog .mud-dialog-surface,
.product-selection-dialog .mud-dialog-surface {
    max-width: 560px !important;
    padding: 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.premium-dialog .premium-dialog-layout,
.product-selection-dialog .product-selection-paper {
    border: 1px solid var(--mud-palette-lines-default);
}

.premium-dialog .premium-dialog-header .mud-avatar,
.product-selection-dialog .product-selection-header .mud-avatar {
    box-shadow: 0 2px 8px rgba(var(--mud-palette-primary-rgb), 0.25);
}

.premium-dialog .premium-dialog-toolbar .rounded-lg,
.product-selection-dialog .product-selection-toolbar .rounded-lg {
    border-radius: 8px;
}

.premium-dialog .premium-dialog-actions .premium-dialog-count,
.product-selection-dialog .product-selection-count {
    font-weight: 600;
    letter-spacing: 0.02em;
}

.premium-dialog .premium-dialog-actions,
.product-selection-dialog .product-selection-actions {
    border-top: 1px solid var(--mud-palette-lines-default);
    background: var(--mud-palette-background-default);
}

/* Sticky header: header + toolbar stay visible when scrolling content */
.premium-dialog .premium-dialog-layout-sticky {
    display: flex;
    flex-direction: column;
    max-height: 80vh;
    overflow: hidden;
}

.premium-dialog .premium-dialog-sticky-header {
    flex-shrink: 0;
    background: var(--mud-palette-background-paper);
}

/* Compact header/toolbar to maximize visible list items */
.premium-dialog .premium-dialog-header {
    padding: 10px 20px 8px !important;
}

.premium-dialog .premium-dialog-toolbar {
    padding: 6px 16px 8px !important;
}

.premium-dialog .premium-dialog-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

/* Base Dialog - Form dialogs (create/edit/view/delete). Use for ChangePassword, RuleGroup, etc. */
.base-dialog .mud-dialog-surface {
    max-width: 520px !important;
    padding: 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.base-dialog .base-dialog-layout {
    border: 1px solid var(--mud-palette-lines-default);
}

.base-dialog .base-dialog-header .mud-avatar {
    box-shadow: 0 2px 8px rgba(var(--mud-palette-primary-rgb), 0.25);
}

.base-dialog .base-dialog-actions {
    border-top: 1px solid var(--mud-palette-lines-default);
    background: var(--mud-palette-background-paper);
}

/* CMS Screen Layout Builder */
.layout-builder-add-chips {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.layout-empty-state {
    border: 1px dashed var(--mud-palette-lines-default);
    border-radius: 8px;
    background: var(--mud-palette-background-grey);
}

.layout-block-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.layout-block-reorder {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-top: 8px;
}

.layout-block-content {
    flex: 1;
    min-width: 0;
}

.layout-block-card {
    padding: 16px;
    border-radius: 8px;
    border: 1px solid var(--mud-palette-lines-default);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

    .layout-block-card:hover {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }

.layout-block-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

/* Premium Dialog - Additional styling */
.premium-dialog .mud-dialog-surface,
.product-selection-dialog .mud-dialog-surface {
    border-radius: 12px;
    overflow: hidden;
}

.premium-dialog .premium-dialog-actions,
.product-selection-dialog .product-selection-actions {
    background: var(--mud-palette-background-paper);
    border-top: 1px solid var(--mud-palette-lines-default);
}

.premium-dialog .mud-table-container,
.product-selection-dialog .mud-table-container {
    border-radius: 0 0 8px 8px;
}

.premium-dialog .mud-table-row:hover,
.product-selection-dialog .mud-table-row:hover {
    background: var(--mud-palette-action-default-hover) !important;
}

/* Sales order workflow confirmation — uses .premium-dialog surface; adds hero + message panel */
.workflow-confirm-dialog .mud-dialog-surface {
    max-width: 440px !important;
}

.workflow-confirm-dialog .workflow-confirm-dialog__hero {
    background: linear-gradient(
        165deg,
        var(--mud-palette-background-grey) 0%,
        var(--mud-palette-background-paper) 100%
    );
}

.workflow-confirm-dialog .workflow-confirm-dialog__avatar {
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.workflow-confirm-dialog .workflow-confirm-dialog__title {
    letter-spacing: -0.01em;
    line-height: 1.25;
}

.workflow-confirm-dialog .workflow-confirm-dialog__order-ref {
    display: inline-block;
    font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas, monospace;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    padding: 5px 14px;
    border-radius: 999px;
}

.workflow-confirm-dialog .workflow-confirm-dialog__message-panel {
    background: var(--mud-palette-background-grey);
    border: 1px solid var(--mud-palette-lines-default);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.workflow-confirm-dialog .workflow-confirm-dialog__confirm-btn {
    font-weight: 600;
    letter-spacing: 0.02em;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.theme-editor-panels .mud-expansion-panel {
    border-radius: 8px;
    margin-bottom: 8px;
}

    .theme-editor-panels .mud-expansion-panel:last-child {
        margin-bottom: 0;
    }

.theme-panel .mud-expansion-panel-header {
    padding: 8px 16px;
}

.theme-panel .mud-expansion-panel-content {
    padding: 0 16px 16px;
}

/* Product Selection Dialog - Premium styling */
.product-selection-dialog .mud-dialog-title {
    padding: 0;
}

.product-selection-dialog .mud-paper {
    border-radius: 12px;
    overflow: hidden;
}

.product-selection-dialog .product-selection-header .mud-avatar {
    box-shadow: 0 2px 8px rgba(var(--mud-palette-primary-rgb), 0.25);
}

.product-selection-dialog .mud-table {
    border-radius: 0;
}

.product-selection-dialog .product-selection-actions {
    border-top: 1px solid var(--mud-palette-lines-default);
    min-height: 64px;
}

.product-selection-dialog .product-selection-count {
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* Legacy - same behavior, kept for backwards compatibility */
.so-top-section-equal {
    width: 100%;
}

    .so-top-section-equal > * {
        height: 100%;
    }

/* OneBox Components Styles */

.text-right {
    text-align: right;
}

/* Reusable flex utility for right-aligned action rows */
.actions-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

/* Reusable tabs (Bootstrap nav-tabs inspired, MudTabs compatible) */
.app-nav-tabs {
    --app-tabs-border-color: #c7d0db;
    --app-tabs-inactive-color: #6b7280;
    --app-tabs-active-bg: linear-gradient(180deg, #ffffff 0%, #f3f6fb 100%);
    --app-tabs-active-border-blend: #f3f6fb;
}

.app-nav-tabs .mud-tabs-toolbar {
    background: transparent;
    padding: 0 0.75rem;
    margin-bottom: 0;
    border-bottom: 2px solid var(--app-tabs-border-color);
}

.app-nav-tabs .mud-tab {
    min-height: 40px;
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
    border-bottom: 2px solid var(--app-tabs-border-color);
    border-top-left-radius: 0.375rem;
    border-top-right-radius: 0.375rem;
    font-weight: 500;
    color: var(--app-tabs-inactive-color);
    background: var(--app-tabs-inactive-bg);
    margin-bottom: -2px;
    transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
    position: relative;
    z-index: 1;
    text-decoration: none !important;
    box-shadow: none !important;
}

    .app-nav-tabs .mud-tab:hover:not(.mud-disabled):not(.mud-tab-active) {
        color: #495057;
        border-color: #e9ecef #e9ecef var(--app-tabs-border-color);
        border-bottom-color: var(--app-tabs-border-color);
        text-decoration: none !important;
    }

    .app-nav-tabs .mud-tab.mud-tab-active {
        background: var(--app-tabs-active-bg);
        color: var(--mud-palette-primary);
        font-weight: 500;
        border-color: var(--app-tabs-border-color);
        border-bottom-color: var(--app-tabs-active-border-blend);
        text-decoration: none !important;
        box-shadow: none !important;
    }

    .app-nav-tabs .mud-tab:focus-visible {
        outline: 2px solid var(--mud-palette-primary);
        outline-offset: 2px;
    }

    .app-nav-tabs .mud-tab::before,
    .app-nav-tabs .mud-tab::after,
    .app-nav-tabs .mud-tab.mud-tab-active::before,
    .app-nav-tabs .mud-tab.mud-tab-active::after {
        display: none !important;
        content: none !important;
    }

    .app-nav-tabs .mud-tab .mud-tab-content,
    .app-nav-tabs .mud-tab .mud-tab-content * {
        text-decoration: none !important;
        border-bottom: 0 !important;
    }

.app-nav-tabs .mud-tab-slider {
    display: none;
}

.app-nav-tabs .mud-tabs-panels {
    border-top: 0;
    margin-top: 0;
    padding: 0 0 1rem 0;
    background: transparent;
}

/* Keep button labels in natural casing (no forced uppercase). */
.mud-button-root {
    text-transform: none !important;
}

/* Date Range Filter - Theme-aware background */
.date-range-filter-background {
    background-color: #F1F5F9; /* Slate 100 - matches AppPalettes.Light.GrayLighter */
}

html[data-dark-mode="true"] .date-range-filter-background {
    background-color: #1E293B; /* Slate 800 - matches AppPalettes.Dark.BackgroundGray */
}

/* Blazor error UI - professional banner when circuit disconnects or unhandled error occurs */
#blazor-error-ui {
    background: linear-gradient(90deg, #B91C1C 0%, #991B1B 100%);
    color: #fff;
    bottom: 0;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.15);
    display: none;
    font-family: inherit;
    font-size: 0.9375rem;
    left: 0;
    padding: 0.75rem 1.25rem;
    position: fixed;
    right: 0;
    z-index: 10000;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

    #blazor-error-ui .blazor-error-message {
        display: inline-block;
        vertical-align: middle;
        margin-right: 0.5rem;
    }

    #blazor-error-ui .reload {
        background: rgba(255, 255, 255, 0.2);
        border: 1px solid rgba(255, 255, 255, 0.4);
        border-radius: 4px;
        color: #fff;
        padding: 0.375rem 0.75rem;
        text-decoration: none;
        font-weight: 500;
        white-space: nowrap;
    }

        #blazor-error-ui .reload:hover {
            background: rgba(255, 255, 255, 0.3);
            color: #fff;
        }

    #blazor-error-ui .dismiss {
        background: transparent;
        border: none;
        color: #fff;
        cursor: pointer;
        font-size: 1.5rem;
        line-height: 1;
        padding: 0 0.5rem;
        opacity: 0.9;
    }

        #blazor-error-ui .dismiss:hover {
            opacity: 1;
        }

/* Dark mode: slightly softer error bar */
html[data-dark-mode="true"] #blazor-error-ui {
    background: linear-gradient(90deg, #991B1B 0%, #7F1D1D 100%);
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.4);
}

/* Sales Order Invoice - Premium Print Layout */
.sales-order-invoice {
    max-width: 680px;
    margin: 0 auto;
    padding: 24px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: "Segoe UI", "Helvetica Neue", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 13px;
    color: #1e293b;
    line-height: 1.45;
}

/* Light mode: white "page" with shadow for visual separation from background */
html:not([data-dark-mode="true"]) .sales-order-invoice {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
}

.invoice-main {
    flex: 1;
}

/* Box label section - always at bottom */
.invoice-box-label-section {
    margin-top: auto;
    flex-shrink: 0;
}

/* Top accent bar */
.invoice-accent {
    height: 4px;
    background: linear-gradient(90deg, #0f172a 0%, #334155 100%);
    margin: 0 -24px 20px -24px;
}

/* Header */
.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 16px;
}

.invoice-header-brand {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.invoice-label {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    color: #64748b;
}

.invoice-order-no {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
}

.invoice-company {
    text-align: right;
}

    .invoice-company .company-logo {
        max-height: 48px;
        max-width: 120px;
        object-fit: contain;
        margin-bottom: 4px;
    }

    .invoice-company .company-name {
        font-weight: 600;
        font-size: 0.9375rem;
        color: #0f172a;
    }

    .invoice-company .company-address {
        font-size: 0.8125rem;
        color: #64748b;
        margin-top: 2px;
    }

/* Order info row - left: Order Number, Order Date | right: Name, Ph, Payment */
.invoice-order-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 12px;
}

.invoice-order-left {
    display: flex;
    gap: 32px;
}

.invoice-order-right {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.invoice-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.invoice-field-label {
    font-size: 0.8125rem;
    color: #64748b;
}

.invoice-field-value {
    font-size: 0.8125rem;
    font-weight: 700;
    color: #0f172a;
}

.invoice-address-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-top: 8px;
    margin-bottom: 16px;
    border-top: 1px solid #e2e8f0;
}

    .invoice-address-row .invoice-field-label {
        font-size: 0.8125rem;
    }

    .invoice-address-row .invoice-field-value {
        white-space: pre-wrap;
    }

/* Items table */
.invoice-items-label {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: #64748b;
    margin-bottom: 8px;
}

.invoice-main .items-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 16px;
    font-size: 0.8125rem;
}

    .invoice-main .items-table th,
    .invoice-main .items-table td {
        padding: 10px 12px;
        text-align: left;
        border-bottom: 1px solid #e2e8f0;
    }

    .invoice-main .items-table thead th {
        font-size: 0.6875rem;
        font-weight: 600;
        letter-spacing: 0.05em;
        color: #64748b;
        text-transform: uppercase;
        background: #f8fafc;
    }

    .invoice-main .items-table .text-right {
        text-align: right;
    }

    .invoice-main .items-table tbody tr:hover {
        background: #fafafa;
    }

    .invoice-main .items-table td:nth-child(3),
    .invoice-main .items-table td:nth-child(4),
    .invoice-main .items-table td:nth-child(5),
    .invoice-main .items-table td:nth-child(6) {
        text-align: right;
    }

/* Totals */
.invoice-totals {
    margin-top: 16px;
    max-width: 300px;
    margin-left: auto;
    padding: 16px 20px;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

    .invoice-totals .total-row {
        display: flex;
        justify-content: space-between;
        padding: 4px 0;
        font-size: 0.8125rem;
    }

        .invoice-totals .total-row.total-final {
            font-weight: 700;
            font-size: 1rem;
            color: #0f172a;
            border-top: 2px solid #0f172a;
            margin-top: 8px;
            padding-top: 12px;
        }

    .invoice-totals .total-note {
        font-size: 0.75rem;
        color: #64748b;
        margin-top: 8px;
    }

/* Footer */
.invoice-footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
    font-size: 0.8125rem;
    color: #64748b;
    text-align: center;
}

/* Cut line - for box label section */
.invoice-cut-line {
    border-top: 2px dashed #94a3b8;
    margin: 28px 0 12px;
    padding-top: 10px;
}

    .invoice-cut-line .cut-text {
        font-size: 0.75rem;
        color: #94a3b8;
    }

/* Box label - cut off and attach to box */
.invoice-box-label {
    padding: 12px 16px;
    border: 2px solid #0f172a;
    font-size: 0.875rem;
    line-height: 1.5;
}

    .invoice-box-label .box-label-title {
        font-weight: 700;
        font-size: 1rem;
        margin-bottom: 6px;
    }

    .invoice-box-label .box-label-line,
    .invoice-box-label .box-label-address {
        margin: 3px 0;
    }

    .invoice-box-label .box-label-note {
        margin-top: 6px;
        font-size: 0.8125rem;
        color: #64748b;
    }

.no-print {
    margin-top: 0px;
}

/* Dark mode: invoice viewer */
html[data-dark-mode="true"] .sales-order-invoice {
    background: #1e293b;
    color: #f1f5f9;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

html[data-dark-mode="true"] .invoice-accent {
    background: linear-gradient(90deg, #475569 0%, #64748b 100%);
}

html[data-dark-mode="true"] .invoice-order-no,
html[data-dark-mode="true"] .invoice-company .company-name {
    color: #f1f5f9;
}

html[data-dark-mode="true"] .invoice-label,
html[data-dark-mode="true"] .invoice-company .company-address,
html[data-dark-mode="true"] .invoice-items-label,
html[data-dark-mode="true"] .invoice-main .items-table thead th,
html[data-dark-mode="true"] .invoice-totals .total-note,
html[data-dark-mode="true"] .invoice-footer {
    color: #94a3b8;
}

html[data-dark-mode="true"] .invoice-field-label {
    color: #94a3b8;
}

html[data-dark-mode="true"] .invoice-field-value {
    color: #f1f5f9;
}

html[data-dark-mode="true"] .invoice-address-row {
    border-color: #334155;
}

html[data-dark-mode="true"] .invoice-main .items-table th,
html[data-dark-mode="true"] .invoice-main .items-table td {
    border-color: #334155;
}

html[data-dark-mode="true"] .invoice-main .items-table thead th {
    background: #0f172a;
    color: #94a3b8;
}

html[data-dark-mode="true"] .invoice-main .items-table tbody tr:hover {
    background: #334155;
}

html[data-dark-mode="true"] .invoice-totals {
    background: #0f172a;
    border-color: #334155;
}

    html[data-dark-mode="true"] .invoice-totals .total-row {
        color: #e2e8f0;
    }

        html[data-dark-mode="true"] .invoice-totals .total-row.total-final {
            color: #f1f5f9;
            border-color: #64748b;
        }

html[data-dark-mode="true"] .invoice-footer {
    border-color: #334155;
}

html[data-dark-mode="true"] .invoice-cut-line {
    border-color: #475569;
}

    html[data-dark-mode="true"] .invoice-cut-line .cut-text {
        color: #64748b;
    }

html[data-dark-mode="true"] .invoice-box-label {
    border-color: #94a3b8;
    background: #0f172a;
    color: #e2e8f0;
}

    html[data-dark-mode="true"] .invoice-box-label .box-label-title {
        color: #f1f5f9;
    }

    html[data-dark-mode="true"] .invoice-box-label .box-label-note {
        color: #94a3b8;
    }

@media print {
    .no-print {
        display: none !important;
    }

    .sales-order-invoice {
        padding: 16px;
        max-width: none;
        box-shadow: none !important;
        border-radius: 0 !important;
    }

    .invoice-accent {
        margin: 0 -16px 16px -16px;
    }

    .invoice-main .items-table tbody tr:hover {
        background: transparent;
    }

    .invoice-cut-line .cut-text {
        display: block;
    }

    /* Force light theme for print */
    html[data-dark-mode="true"] .sales-order-invoice {
        background: #fff !important;
        color: #1e293b !important;
        box-shadow: none !important;
    }

    html[data-dark-mode="true"] .invoice-accent {
        background: linear-gradient(90deg, #0f172a 0%, #334155 100%) !important;
    }

    html[data-dark-mode="true"] .invoice-order-no,
    html[data-dark-mode="true"] .invoice-company .company-name {
        color: #0f172a !important;
    }

    html[data-dark-mode="true"] .invoice-label,
    html[data-dark-mode="true"] .invoice-company .company-address,
    html[data-dark-mode="true"] .invoice-items-label,
    html[data-dark-mode="true"] .invoice-main .items-table thead th,
    html[data-dark-mode="true"] .invoice-totals .total-note,
    html[data-dark-mode="true"] .invoice-footer {
        color: #64748b !important;
    }

    html[data-dark-mode="true"] .invoice-field-label {
        color: #64748b !important;
    }

    html[data-dark-mode="true"] .invoice-field-value {
        color: #0f172a !important;
    }

    html[data-dark-mode="true"] .invoice-address-row {
        border-color: #e2e8f0 !important;
    }

    html[data-dark-mode="true"] .invoice-main .items-table th,
    html[data-dark-mode="true"] .invoice-main .items-table td {
        border-color: #e2e8f0 !important;
        color: #1e293b !important;
    }

    html[data-dark-mode="true"] .invoice-main .items-table thead th {
        background: #f8fafc !important;
        color: #64748b !important;
    }

    html[data-dark-mode="true"] .invoice-totals {
        background: #f8fafc !important;
        border-color: #e2e8f0 !important;
    }

        html[data-dark-mode="true"] .invoice-totals .total-row {
            color: #1e293b !important;
        }

            html[data-dark-mode="true"] .invoice-totals .total-row.total-final {
                color: #0f172a !important;
                border-color: #0f172a !important;
            }

    html[data-dark-mode="true"] .invoice-box-label {
        background: #fff !important;
        border-color: #1e293b !important;
        color: #1e293b !important;
    }

        html[data-dark-mode="true"] .invoice-box-label .box-label-title {
            color: #0f172a !important;
        }

        html[data-dark-mode="true"] .invoice-box-label .box-label-note {
            color: #64748b !important;
        }
}
