:root {
    color-scheme: light;
    --nx-primary: #4f46e5;
    --nx-primary-hover: #4338ca;
    --nx-bg: #f4f6f9;
    --nx-surface: #ffffff;
    --nx-surface-muted: #f8fafc;
    --nx-surface-hover: #f1f5f9;
    --nx-border: #cbd5e1;
    --nx-border-strong: #aebdce;
    --nx-text: #172033;
    --nx-text-muted: #60708a;
    --nx-sidebar: #111827;
    --nx-sidebar-muted: #9aa8bd;
    --nx-focus: rgba(79, 70, 229, 0.2);
    --nx-shadow: 0 1px 2px rgba(15, 23, 42, 0.08), 0 5px 14px rgba(15, 23, 42, 0.04);
}

/* Light mode needs firmer surface boundaries on dense operational pages. */
html:not(.dark) .settings-workspace > section,
html:not(.dark) .settings-workspace > .overflow-hidden,
html:not(.dark) .notifications-workspace .rounded-xl {
    border-color: #c5d1df !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08), 0 6px 16px rgba(15, 23, 42, 0.035);
}

html:not(.dark) .settings-workspace .border-slate-200,
html:not(.dark) .notifications-workspace .border-slate-200 {
    border-color: #d0dae6 !important;
}

html:not(.dark) .notifications-workspace .divide-slate-100 > :not([hidden]) ~ :not([hidden]) {
    border-color: #dbe4ee !important;
}

html.dark {
    color-scheme: dark;
    --nx-bg: #0b1220;
    --nx-surface: #121c2d;
    --nx-surface-muted: #172235;
    --nx-surface-hover: #1c2a40;
    --nx-border: #29384e;
    --nx-border-strong: #3b4c64;
    --nx-text: #edf2f7;
    --nx-text-muted: #a9b7ca;
    --nx-focus: rgba(129, 140, 248, 0.28);
    --nx-shadow: 0 1px 2px rgba(0, 0, 0, 0.24), 0 8px 20px rgba(0, 0, 0, 0.12);
}

html,
body {
    min-height: 100%;
}

/* Keep the operational desktop density comfortable at 100% browser zoom. */
@media (min-width: 1024px) {
    html {
        font-size: 90%;
    }
}

body {
    font-family: 'Outfit', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    letter-spacing: 0;
    background: var(--nx-bg);
    color: var(--nx-text);
}

button,
a,
input,
select,
textarea {
    letter-spacing: 0;
}

.app-sidebar a,
.app-sidebar button {
    transition-property: color, background-color, border-color, opacity !important;
    transition-duration: 150ms !important;
}

.sidebar-static-group {
    margin-top: .35rem;
}

.sidebar-group-label {
    display: flex;
    align-items: center;
    gap: .75rem;
    min-height: 2.35rem;
    padding: .45rem 1rem;
    color: #cbd5e1;
    font-size: .78rem;
    font-weight: 700;
}

.sidebar-group-label .material-icons-round {
    color: #718096;
    font-size: 1.15rem;
}

.sidebar-static-links {
    display: grid;
    gap: .15rem;
    margin-left: 2.15rem;
    padding-left: .55rem;
    border-left: 1px solid rgb(71 85 105 / 55%);
}

.sidebar-static-links a {
    min-height: 2.15rem;
    padding-top: .45rem !important;
    padding-bottom: .45rem !important;
}

.nx-submit-pending {
    cursor: wait !important;
    opacity: 0.72;
}

.app-main {
    box-sizing: border-box;
    background: var(--nx-bg);
    padding: .75rem .875rem 1rem;
    min-width: 0;
    max-width: 100%;
}

.app-topbar {
    box-sizing: border-box;
    flex: 0 0 64px !important;
    min-height: 64px !important;
    height: 64px !important;
    overflow: visible;
}

.app-topbar > div:last-child {
    min-height: 40px;
}

.app-sidebar > div:first-child {
    box-sizing: border-box;
    flex: 0 0 64px !important;
    min-height: 64px !important;
    height: 64px !important;
}

.app-content-frame {
    box-sizing: border-box;
    width: min(100%, 1600px);
    margin: 0 auto;
    min-width: 0;
    max-width: 100%;
}

.app-page-alerts:empty { display: none; }
.app-page-alerts > *:not(:empty) { display: block; margin-bottom: .75rem; }

.card,
.nx-panel {
    background: var(--nx-surface) !important;
    border: 1px solid var(--nx-border) !important;
    border-radius: 0.5rem !important;
    box-shadow: var(--nx-shadow) !important;
}

.card:hover {
    transform: none;
    box-shadow: var(--nx-shadow) !important;
}

.btn-primary {
    background-color: var(--nx-primary) !important;
    border-color: var(--nx-primary) !important;
    border-radius: 0.375rem;
    font-weight: 600;
}

.btn-primary:hover {
    background-color: var(--nx-primary-hover) !important;
    transform: none;
    box-shadow: none;
}

input:not([type='checkbox']):not([type='radio']),
select,
textarea,
.input-field,
.field-input,
.report-input {
    border: 1px solid var(--nx-border-strong);
    border-radius: 0.375rem;
    background: var(--nx-surface);
    color: var(--nx-text);
    box-shadow: none;
}

input:not([type='checkbox']):not([type='radio']):focus,
select:focus,
textarea:focus,
.input-field:focus,
.field-input:focus,
.report-input:focus {
    border-color: var(--nx-primary);
    outline: 2px solid transparent;
    outline-offset: 2px;
    box-shadow: 0 0 0 3px var(--nx-focus);
}

input::placeholder,
textarea::placeholder {
    color: #8a98ad;
    opacity: 1;
}

.input-field,
.field-input,
.report-input {
    display: block;
    width: 100%;
    min-height: 2.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.field-label {
    display: block;
    margin-bottom: 0.375rem;
    color: var(--nx-text);
    font-size: 0.875rem;
    font-weight: 500;
}

.field-error {
    display: block;
    margin-top: 0.25rem;
    color: #dc2626;
    font-size: 0.75rem;
}

.report-stat,
.report-section {
    overflow: hidden;
    border: 1px solid var(--nx-border);
    border-radius: 0.5rem;
    background: var(--nx-surface);
    box-shadow: var(--nx-shadow);
}

.report-stat {
    padding: 1rem;
}

.report-stat span,
.report-section-head span,
.report-table small {
    display: block;
    color: var(--nx-text-muted);
    font-size: 0.75rem;
}

.report-stat strong {
    display: block;
    margin-top: 0.375rem;
    color: var(--nx-text);
    font-size: 1.125rem;
}

.report-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid var(--nx-border);
    padding: 1rem 1.25rem;
}

.report-section-head h3 {
    color: var(--nx-text);
    font-size: 1rem;
    font-weight: 700;
}

.report-table {
    width: 100%;
    font-size: 0.8125rem;
}

.report-table th {
    position: sticky;
    top: 0;
    padding: 0.75rem 1rem;
    background: var(--nx-surface-muted);
    color: var(--nx-text-muted);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0;
    text-align: left;
    text-transform: uppercase;
}

.report-table td {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--nx-border);
    color: var(--nx-text);
}

.report-table strong {
    display: block;
    color: var(--nx-text);
    font-weight: 600;
}

.report-table small {
    margin-top: 0.125rem;
}

.report-empty {
    padding: 2rem !important;
    color: var(--nx-text-muted) !important;
    text-align: center !important;
}

.report-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 3.25rem;
    padding: 0.625rem 1rem;
    border-top: 1px solid var(--nx-border);
    color: var(--nx-text-muted);
    font-size: 0.75rem;
}

.report-pager > span:last-child {
    display: flex;
    gap: 0.5rem;
}

.report-pager a,
.report-pager .is-disabled {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--nx-border);
    border-radius: 0.375rem;
    font-weight: 600;
}

.report-pager a {
    color: var(--nx-primary);
    transition: border-color 120ms ease, background-color 120ms ease;
}

.report-pager a:hover {
    border-color: var(--nx-primary);
    background: var(--nx-primary-soft);
}

.report-pager .is-disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
}

.table th,
.table td {
    vertical-align: middle;
}

.table th {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--nx-border);
    background: var(--nx-surface-muted);
    color: var(--nx-text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: uppercase;
}

.table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--nx-border);
    background: transparent;
    color: var(--nx-text);
}

.table tbody tr:last-child td {
    border-bottom: 0;
}

.table tbody tr:hover {
    background: var(--nx-surface-hover);
}

.dataTables_wrapper {
    color: var(--nx-text-muted);
    font-size: 0.875rem;
}

.app-main .dataTables_wrapper {
    min-height: 18rem;
}

.app-main .modal .dataTables_wrapper {
    min-height: 0;
}

.product-pricing-note {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    min-height: 4.25rem;
    padding: .8rem .9rem;
    border: 1px solid;
    border-radius: .5rem;
}

.product-pricing-note .material-icons-round {
    margin-top: .1rem;
    font-size: 1.15rem;
}

.product-pricing-note strong,
.product-pricing-note span {
    display: block;
}

.product-pricing-note strong {
    font-size: .78rem;
    color: var(--nox-text-strong, #1e293b);
}

.product-pricing-note div > span {
    margin-top: .2rem;
    color: #64748b;
    font-size: .7rem;
    line-height: 1.35;
}

.product-data-table {
    min-width: 1080px;
}

.product-data-table th {
    white-space: nowrap;
    letter-spacing: .06em;
}

.product-data-table td {
    vertical-align: middle;
    min-height: 4.5rem;
}

.product-price-main,
.product-cost-main {
    color: #1e293b;
    font-size: .82rem;
    font-weight: 700;
    line-height: 1.2;
}

.product-price-meta {
    margin-top: .28rem;
    color: #64748b;
    font-size: .66rem;
    line-height: 1.3;
    white-space: nowrap;
}

.product-source {
    max-width: 13rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-live-dot {
    display: inline-block;
    width: .38rem;
    height: .38rem;
    margin-right: .25rem;
    border-radius: 999px;
    background: #4f46e5;
    vertical-align: .08em;
}

.product-stock-normal { color: #047857; }
.product-stock-critical { color: #c2410c; }
.product-stock-zero { color: #dc2626; }

.dark .product-pricing-note strong,
.dark .product-price-main,
.dark .product-cost-main { color: #f1f5f9; }

.dark .product-pricing-note div > span,
.dark .product-price-meta { color: #94a3b8; }

.dark .product-stock-normal { color: #34d399; }
.dark .product-stock-critical { color: #fb923c; }
.dark .product-stock-zero { color: #f87171; }

/* Products workspace */
.products-workspace {
    display: grid;
    gap: 1.25rem;
    min-width: 0;
    max-width: 100%;
}

.products-list-shell,
.products-filter-panel { min-width: 0; max-width: 100%; }

.products-workspace-header,
.product-editor-header,
.products-list-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
}

.products-eyebrow {
    color: #4f46e5;
    font-size: .67rem;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.2;
}

.products-workspace-header h2,
.products-list-heading h3,
.product-editor-header h3 {
    margin: .25rem 0 0;
    color: var(--nx-text-strong);
    font-size: 1.6rem;
    font-weight: 750;
    line-height: 1.15;
}

.products-workspace-header p,
.products-list-heading p,
.product-editor-header p {
    max-width: 44rem;
    margin: .4rem 0 0;
    color: var(--nx-text-muted);
    font-size: .82rem;
    line-height: 1.55;
}

.products-header-actions {
    display: flex;
    align-items: end;
    gap: .65rem;
    flex-wrap: wrap;
}

.product-money-input select {
    min-height: 2.5rem;
    border: 1px solid var(--nx-border);
    border-radius: .4rem;
    background: var(--nx-surface);
    color: var(--nx-text);
    font-size: .8rem;
    font-weight: 650;
}

.products-primary-action,
.products-secondary-action,
.products-reset-action,
.products-icon-button,
.products-quick-filter,
.product-row-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    border-radius: .4rem;
    font-weight: 700;
    line-height: 1;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}

.products-primary-action {
    min-height: 2.5rem;
    padding: 0 .95rem;
    border: 1px solid #4f46e5;
    background: #4f46e5;
    color: #fff;
    font-size: .8rem;
    box-shadow: 0 2px 5px rgb(79 70 229 / 18%);
}

.products-primary-action:hover { background: #4338ca; border-color: #4338ca; color: #fff; }
.products-primary-action .material-icons-round { font-size: 1rem; }

.products-feedback {
    display: flex;
    align-items: center;
    gap: .55rem;
    min-height: 2.6rem;
    padding: .6rem .85rem;
    border: 1px solid;
    border-radius: .45rem;
    font-size: .8rem;
    font-weight: 600;
}

.products-feedback-success { border-color: #86efac; background: #f0fdf4; color: #166534; }
.products-feedback-error { border-color: #fecaca; background: #fef2f2; color: #991b1b; }
.products-feedback .material-icons-round { font-size: 1rem; }
.products-feedback > div { display: grid; gap: .15rem; }
.products-feedback strong { font-weight: 750; }
.products-feedback small { color: inherit; font-size: .68rem; font-weight: 500; opacity: .86; }

.products-header-actions > .products-secondary-action { width: auto; min-height: 2.5rem; padding: 0 .85rem; }

.product-import-modal .modal-content {
    border: 1px solid var(--nx-border);
    border-radius: .75rem;
    background: var(--nx-surface);
    color: var(--nx-text);
    box-shadow: 0 24px 65px rgb(15 23 42 / 22%);
}

.product-import-modal .modal-header,
.product-import-modal .modal-footer { border-color: var(--nx-border); }
.product-import-modal .modal-title { margin-top: .15rem; color: var(--nx-text); font-size: 1.05rem; font-weight: 750; }

.product-import-dropzone {
    position: relative;
    display: grid;
    place-items: center;
    gap: .35rem;
    min-height: 10rem;
    padding: 1.25rem;
    overflow: hidden;
    border: 1.5px dashed #818cf8;
    border-radius: .65rem;
    background: #f8faff;
    color: #3730a3;
    cursor: pointer;
    text-align: center;
}

.product-import-dropzone:hover { border-color: #4f46e5; background: #eef2ff; }
.product-import-dropzone > .material-icons-round { font-size: 2.25rem; }
.product-import-dropzone strong { font-size: .9rem; }
.product-import-dropzone small { color: var(--nx-text-muted); font-size: .7rem; }
.product-import-dropzone input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }

.product-import-rules {
    margin-top: 1rem;
    padding: .9rem 1rem;
    border: 1px solid var(--nx-border);
    border-radius: .55rem;
    background: var(--nx-surface-muted);
}

.product-import-rules > strong { font-size: .78rem; }
.product-import-rules ul { display: grid; gap: .4rem; margin: .55rem 0 0; padding-left: 1.15rem; color: var(--nx-text-muted); font-size: .7rem; line-height: 1.45; }
.product-import-modal .modal-footer .products-secondary-action { width: auto; }

.products-overview {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: .75rem;
}

.products-overview-card {
    display: flex;
    align-items: center;
    min-height: 5.3rem;
    gap: .7rem;
    padding: .8rem .9rem;
    border: 1px solid var(--nx-border);
    border-left-width: 3px;
    border-radius: .45rem;
    background: var(--nx-surface);
}

.products-overview-card > .material-icons-round {
    width: 2.1rem;
    height: 2.1rem;
    display: grid;
    place-items: center;
    border-radius: .4rem;
    font-size: 1.1rem;
}

.products-overview-card span:not(.material-icons-round) {
    display: block;
    color: var(--nx-text-muted);
    font-size: .68rem;
    font-weight: 650;
}

.products-overview-card strong {
    display: block;
    margin-top: .16rem;
    color: var(--nx-text-strong);
    font-size: 1.3rem;
    line-height: 1;
}

.products-overview-card small {
    display: block;
    margin-top: .32rem;
    color: var(--nx-text-muted);
    font-size: .58rem;
    line-height: 1.25;
}

.products-overview-primary { border-left-color: #4f46e5; }
.products-overview-primary > .material-icons-round { background: #eef2ff; color: #4f46e5; }
.products-overview-dynamic { border-left-color: #0891b2; }
.products-overview-dynamic > .material-icons-round { background: #ecfeff; color: #0e7490; }
.products-overview-warning { border-left-color: #d97706; }
.products-overview-warning > .material-icons-round { background: #fffbeb; color: #b45309; }
.products-overview-danger { border-left-color: #dc2626; }
.products-overview-danger > .material-icons-round { background: #fef2f2; color: #b91c1c; }
.products-overview-cost { border-left-color: #7c3aed; }
.products-overview-cost > .material-icons-round { background: #f5f3ff; color: #7c3aed; }
.products-overview-revenue { border-left-color: #059669; }
.products-overview-revenue > .material-icons-round { background: #ecfdf5; color: #047857; }

.products-guidance {
    display: flex;
    align-items: center;
    gap: .8rem;
    min-height: 3.5rem;
    padding: .7rem .9rem;
    border: 1px solid var(--nx-border);
    border-radius: .45rem;
    background: var(--nx-surface-muted);
}

.products-guidance > div {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: .45rem;
}

.products-guidance > div > .material-icons-round { color: #4f46e5; font-size: 1rem; }
.products-guidance p { margin: 0; color: var(--nx-text-muted); font-size: .72rem; line-height: 1.3; }
.products-guidance strong { color: var(--nx-text); }
.products-guidance-arrow { color: var(--nx-text-muted); font-size: .95rem; }

.product-editor-panel,
.products-list-shell {
    border: 1px solid var(--nx-border);
    border-radius: .5rem;
    background: var(--nx-surface);
    box-shadow: 0 1px 2px rgb(15 23 42 / 4%);
}

.product-editor-header,
.products-list-heading {
    padding: 1rem 1.1rem;
    border-bottom: 1px solid var(--nx-border);
}

.product-editor-header h3,
.products-list-heading h3 { font-size: 1.08rem; }
.product-editor-header p,
.products-list-heading p { font-size: .74rem; }

.product-editor-header-actions {
    display: flex;
    align-items: center;
    gap: .55rem;
}

.product-keyboard-hint {
    margin-right: .25rem;
    color: var(--nx-text-muted);
    font-size: .64rem;
    white-space: nowrap;
}

.product-keyboard-hint kbd {
    padding: .12rem .3rem;
    border: 1px solid var(--nx-border);
    border-bottom-width: 2px;
    border-radius: .25rem;
    background: var(--nx-surface-hover);
    color: var(--nx-text);
    font: inherit;
    font-weight: 750;
}

.product-editor-cancel {
    width: auto;
    min-width: 6rem;
}

.product-editor-tabs {
    display: flex;
    gap: .3rem;
    overflow-x: auto;
    padding: .55rem 1.1rem 0;
    border-bottom: 1px solid var(--nx-border);
    background: var(--nx-surface-hover);
}

.product-editor-tab {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    min-height: 2.45rem;
    flex: 0 0 auto;
    padding: 0 .75rem;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--nx-text-muted);
    font-size: .7rem;
    font-weight: 720;
}

.product-editor-tab .material-icons-round { font-size: .9rem; }
.product-editor-tab:hover { color: var(--nx-text); }
.product-editor-tab.is-active { border-bottom-color: #4f46e5; color: #4338ca; }

.products-icon-button {
    width: 2rem;
    height: 2rem;
    flex: 0 0 auto;
    border: 1px solid var(--nx-border);
    background: var(--nx-surface);
    color: var(--nx-text-muted);
}

.products-icon-button:hover { background: var(--nx-surface-hover); color: var(--nx-text); }
.products-icon-button .material-icons-round { font-size: 1rem; }

.product-editor-form { padding: 1rem 1.1rem 1.1rem; }
.products-validation { margin-bottom: .75rem; color: #b91c1c; font-size: .78rem; }
.products-validation:empty { display: none; }

.product-editor-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(19rem, .65fr);
    gap: .85rem;
    align-items: start;
}

.product-editor-section {
    min-width: 0;
    padding: .85rem;
    border: 1px solid var(--nx-border);
    border-radius: .45rem;
    background: var(--nx-surface);
}

.product-editor-identity,
.product-editor-pricing,
.product-editor-stock { grid-column: 1; }

.product-editor-pricing { border-top: 3px solid #6366f1; }
.product-editor-stock { border-top: 3px solid #059669; }

.product-editor-section-heading { display: flex; gap: .55rem; margin-bottom: .85rem; }
.product-editor-section-heading > .material-icons-round { margin-top: .08rem; color: #4f46e5; font-size: 1.08rem; }
.product-editor-stock .product-editor-section-heading > .material-icons-round { color: #059669; }
.product-editor-section-heading h4 { margin: 0; color: var(--nx-text-strong); font-size: .84rem; font-weight: 750; }
.product-editor-section-heading p { margin: .16rem 0 0; color: var(--nx-text-muted); font-size: .67rem; line-height: 1.4; }

.product-form-grid { display: grid; gap: .7rem; }
.product-form-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.product-field { min-width: 0; }
.product-field-wide { grid-column: 1 / -1; }
.product-field label { display: block; margin-bottom: .3rem; color: var(--nx-text); font-size: .7rem; font-weight: 700; }
.product-field small { display: block; margin-top: .28rem; color: var(--nx-text-muted); font-size: .64rem; line-height: 1.4; }
.product-field span:not(.material-icons-round) { color: #dc2626; font-size: .65rem; }
.product-field .input-field { min-height: 2.35rem; font-size: .78rem; }
.product-field textarea.input-field { min-height: 4.9rem; resize: vertical; }

.product-code-input { display: grid; grid-template-columns: minmax(0, 1fr) 2.35rem; }
.product-code-input .input-field { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.product-code-input button {
    display: grid;
    place-items: center;
    border: 1px solid var(--nx-border);
    border-left: 0;
    border-radius: 0 .375rem .375rem 0;
    background: var(--nx-surface-hover);
    color: #4f46e5;
}
.product-code-input button:hover { background: #eef2ff; color: #3730a3; }
.product-code-input .material-icons-round { font-size: .9rem; }

.product-money-input { display: grid; grid-template-columns: minmax(0, 1fr) 4.7rem; }
.product-money-input .input-field { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.product-money-input select { border-top-left-radius: 0; border-bottom-left-radius: 0; border-left: 0; padding: 0 .4rem; }

.product-pricing-mode-note {
    display: flex;
    gap: .45rem;
    margin: 0 0 .75rem;
    padding: .55rem .6rem;
    border: 1px solid #c7d2fe;
    border-radius: .4rem;
    background: #eef2ff;
    color: #3730a3;
}

.product-pricing-mode-note .material-icons-round { font-size: .9rem; }
.product-pricing-mode-note p { margin: 0; font-size: .66rem; line-height: 1.4; }

.products-secondary-action {
    min-height: 2.3rem;
    width: 100%;
    padding: 0 .65rem;
    border: 1px solid #c7d2fe;
    background: #fff;
    color: #4338ca;
    font-size: .72rem;
}

.products-secondary-action:hover { background: #eef2ff; color: #3730a3; }
.products-secondary-action .material-icons-round { font-size: .9rem; }
.product-preview-field small { min-height: 2.6rem; }

.product-checkbox {
    display: flex;
    align-items: center;
    gap: .45rem;
    margin-top: .8rem;
    color: var(--nx-text);
    font-size: .72rem;
    font-weight: 650;
}

.product-checkbox input { width: .95rem; height: .95rem; accent-color: #4f46e5; }
.product-editor-submit { width: 100%; margin-top: .95rem; }

.product-discount-matrix {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr) auto);
    align-items: end;
    gap: .35rem;
}

.product-discount-matrix > label {
    position: relative;
    min-width: 0;
    margin: 0;
}

.product-discount-matrix > label > span {
    display: block;
    margin-bottom: .25rem;
    color: var(--nx-text-muted) !important;
    font-size: .61rem !important;
    font-weight: 650;
}

.product-discount-matrix > label > input { padding-right: 1.35rem; }
.product-discount-matrix > label > b {
    position: absolute;
    right: .48rem;
    bottom: .61rem;
    color: var(--nx-text-muted);
    font-size: .66rem;
}

.product-discount-matrix > .material-icons-round {
    align-self: end;
    margin-bottom: .7rem;
    color: #94a3b8;
    font-size: .8rem;
}

.product-finance-hero {
    position: sticky;
    top: 1rem;
    grid-column: 2;
    grid-row: 1 / span 3;
    overflow: hidden;
    border: 1px solid #c7d2fe;
    border-radius: .55rem;
    background: linear-gradient(155deg, #eef2ff 0%, #fff 44%, #ecfdf5 100%);
    box-shadow: 0 12px 30px rgb(67 56 202 / 10%);
}

.product-finance-hero-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
    padding: .9rem;
    border-bottom: 1px solid rgb(199 210 254 / 75%);
}

.product-finance-hero-head h4 {
    margin: .18rem 0 0;
    color: #1e1b4b;
    font-size: .88rem;
    font-weight: 800;
}

.product-live-badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .24rem .42rem;
    border: 1px solid #a7f3d0;
    border-radius: 999px;
    background: #ecfdf5;
    color: #047857;
    font-size: .58rem;
    font-weight: 750;
}

.product-live-badge i {
    width: .38rem;
    height: .38rem;
    border-radius: 999px;
    background: #10b981;
    box-shadow: 0 0 0 .18rem rgb(16 185 129 / 15%);
}

.product-finance-main {
    display: grid;
    gap: .2rem;
    padding: 1.1rem .9rem .85rem;
}

.product-finance-main > span,
.product-finance-profit > span {
    color: #64748b;
    font-size: .62rem;
    font-weight: 750;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.product-finance-main > strong {
    color: #1e1b4b;
    font-size: 1.55rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: -.025em;
}

.product-finance-main > small { color: #64748b; font-size: .62rem; line-height: 1.35; }

.product-finance-breakdown {
    display: grid;
    gap: 0;
    margin: 0 .9rem;
    border-top: 1px solid #dbeafe;
}

.product-finance-breakdown > div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .58rem 0;
    border-bottom: 1px solid #e0e7ff;
    font-size: .67rem;
}

.product-finance-breakdown dt { color: #64748b; font-weight: 650; }
.product-finance-breakdown dd { margin: 0; color: #1e293b; font-weight: 800; font-variant-numeric: tabular-nums; }

.product-finance-profit {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: end;
    gap: .15rem .75rem;
    margin: .85rem .9rem;
    padding: .75rem;
    border: 1px solid #a7f3d0;
    border-radius: .45rem;
    background: rgb(236 253 245 / 80%);
}

.product-finance-profit > strong {
    grid-row: 1 / span 3;
    grid-column: 2;
    color: #047857;
    font-size: 1.05rem;
    font-variant-numeric: tabular-nums;
}

.product-finance-profit > small { color: #059669; font-size: .65rem; font-weight: 700; }
.product-finance-profit[data-profit-state="loss"] { border-color: #fecaca; background: rgb(254 242 242 / 88%); }
.product-finance-profit[data-profit-state="loss"] > strong,
.product-finance-profit[data-profit-state="loss"] > small { color: #b91c1c; }
.product-finance-profit[data-profit-state="placeholder"] {
    border-color: #cbd5e1;
    background: #f8fafc;
}
.product-finance-profit[data-profit-state="placeholder"] > span,
.product-finance-profit[data-profit-state="placeholder"] > strong,
.product-finance-profit[data-profit-state="placeholder"] > small { color: #64748b; }

.product-finance-integrity {
    display: flex;
    align-items: flex-start;
    gap: .45rem;
    margin: .85rem .9rem .9rem;
    padding: .62rem;
    border: 1px solid #c7d2fe;
    border-radius: .4rem;
    background: rgb(255 255 255 / 70%);
    color: #475569;
}

.product-finance-integrity .material-icons-round { color: #4f46e5; font-size: .9rem; }
.product-finance-integrity p { margin: 0; font-size: .61rem; line-height: 1.45; }
.product-finance-integrity strong { color: #3730a3; }

.product-dialog-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(18rem, .55fr); gap: .85rem; }
.product-save-errors.validation-summary-valid { display: none; }
.product-save-errors ul { margin: 0; padding-left: 1.1rem; }
.product-dialog-main { min-width: 0; }
.product-dialog-tabs { display: flex; gap: .25rem; margin-bottom: .75rem; border-bottom: 1px solid var(--nx-border); }
.product-dialog-tab { border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--nx-text-muted); padding: .45rem .65rem; font-size: .7rem; font-weight: 700; }
.product-dialog-tab.is-active { border-bottom-color: #4f46e5; color: #4338ca; }
.product-dialog-section { padding: .8rem; border: 1px solid var(--nx-border); border-radius: .45rem; background: var(--nx-surface); }
.product-dialog-section-title { display: flex; gap: .5rem; margin-bottom: .8rem; }
.product-dialog-section-title > .material-icons-round { color: #4f46e5; font-size: 1.05rem; }
.product-dialog-section-title h4 { margin: 0; color: var(--nx-text-strong); font-size: .84rem; }
.product-dialog-section-title p { margin: .15rem 0 0; color: var(--nx-text-muted); font-size: .65rem; }
.pricing-block {
    margin-top: .7rem;
    padding: .75rem;
    border: 1px solid var(--nx-border);
    border-radius: .45rem;
    background: var(--nx-surface-hover);
}
.pricing-block:first-of-type { margin-top: 0; }
.pricing-block-title {
    display: flex;
    align-items: center;
    gap: .55rem;
    margin-bottom: .7rem;
}
.pricing-block-title > b {
    display: grid;
    width: 1.55rem;
    height: 1.55rem;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #4f46e5;
    color: #fff;
    font-size: .67rem;
}
.pricing-block-title > span { display: grid; gap: .08rem; }
.pricing-block-title strong { color: var(--nx-text-strong); font-size: .72rem; }
.pricing-block-title small { color: var(--nx-text-muted); font-size: .61rem; }
.pricing-four-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .5rem;
}
.pricing-four-grid label {
    display: grid;
    gap: .3rem;
    color: var(--nx-text-muted);
    font-size: .62rem;
    font-weight: 700;
}
.pricing-four-grid input { font-variant-numeric: tabular-nums; }
.pricing-rate-input,
.product-money-input {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
}
.pricing-rate-input input,
.product-money-input input { border-radius: .375rem 0 0 .375rem; }
.pricing-rate-input button,
.product-money-input select {
    min-width: 5.25rem;
    border: 1px solid var(--nx-border);
    border-left: 0;
    border-radius: 0 .375rem .375rem 0;
    background: var(--nx-surface);
    color: #4338ca;
    font-size: .65rem;
    font-weight: 750;
}
.pricing-rate-input button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .2rem;
    padding: 0 .55rem;
}
.pricing-rate-input button .material-icons-round { font-size: .85rem; }
.pricing-rate-input button.is-loading .material-icons-round { animation: nx-spin .8s linear infinite; }
@keyframes nx-spin { to { transform: rotate(360deg); } }
.pricing-override-toggle {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    min-height: 2.35rem;
    margin: 0;
    color: var(--nx-text-muted);
    font-size: .64rem;
    font-weight: 650;
    cursor: pointer;
}
.pricing-override-toggle input { accent-color: #4f46e5; }
.pricing-override-toggle:has(input:disabled) { cursor: not-allowed; opacity: .55; }
.pricing-inline-result {
    margin-top: .55rem;
    color: var(--nx-text-muted);
    font-size: .64rem;
    text-align: right;
}
.pricing-inline-result strong { color: #4338ca; font-variant-numeric: tabular-nums; }
.pricing-mode-explainer {
    margin-top: .6rem;
    padding: .5rem .6rem;
    border-left: 3px solid #818cf8;
    background: rgb(238 242 255 / 70%);
    color: #475569;
    font-size: .62rem;
    line-height: 1.45;
}
.pricing-field-hint {
    display: block;
    min-height: 1.05rem;
    margin-top: .28rem;
    color: var(--nx-text-muted);
    font-size: .59rem;
    line-height: 1.3;
}
[data-manual-sale-field].is-automatic { opacity: .68; }
[data-markup-field].is-automatic { opacity: 1; }
[data-manual-sale-field].is-automatic .form-control:disabled,
[data-manual-sale-field].is-automatic .form-select:disabled {
    border-color: #cbd5e1;
    background: #eef2f7;
    color: #64748b;
    cursor: not-allowed;
    font-style: italic;
}
[data-markup-field].is-automatic .form-control[readonly] {
    border-color: #c7d2fe;
    background: #f8fafc;
    color: #334155;
    cursor: default;
}
.product-final-price {
    display: grid;
    gap: .12rem;
    margin: .8rem .9rem 0;
    padding: .7rem;
    border: 1px solid #c7d2fe;
    border-radius: .45rem;
    background: rgb(238 242 255 / 82%);
}
.product-final-price span { color: #475569; font-size: .62rem; font-weight: 750; text-transform: uppercase; letter-spacing: .035em; }
.product-final-price strong { color: #312e81; font-size: 1.12rem; font-variant-numeric: tabular-nums; }
.product-final-price small { color: #64748b; font-size: .59rem; }
.product-dialog-note { display: flex; gap: .4rem; margin-top: .8rem; padding: .55rem .65rem; border: 1px solid #c7d2fe; border-radius: .35rem; background: #eef2ff; color: #3730a3; font-size: .66rem; }
.product-dialog-note .material-icons-round { font-size: .9rem; }
.product-dialog-hero { position: sticky; top: 0; align-self: start; }
.product-create-modal .modal-body { background: var(--nx-surface-hover); }
.dark .product-dialog-section { background: var(--nx-surface); }
.dark .pricing-block { background: rgb(15 23 42 / 48%); }
.dark .pricing-mode-explainer,
.dark .product-final-price { background: rgb(49 46 129 / 22%); color: #cbd5e1; }
.dark .product-final-price strong { color: #c7d2fe; }
.dark .product-dialog-note { border-color: #4338ca; background: rgb(49 46 129 / .25); color: #c7d2fe; }
@media (max-width: 900px) {
    .product-dialog-layout { grid-template-columns: 1fr; }
    .product-dialog-hero { position: static; order: -1; }
}
@media (max-width: 576px) {
    .pricing-four-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .product-dialog-tabs { overflow-x: auto; }
    .product-dialog-tab { flex: 0 0 auto; }
}

.products-quick-filters {
    display: flex;
    gap: .45rem;
    overflow-x: auto;
    padding: .8rem 1.1rem 0;
    scrollbar-width: thin;
}

.products-quick-filter {
    min-height: 2.1rem;
    flex: 0 0 auto;
    padding: 0 .65rem;
    border: 1px solid var(--nx-border);
    background: var(--nx-surface);
    color: var(--nx-text-muted);
    font-size: .7rem;
}

.products-quick-filter .material-icons-round { font-size: .85rem; }
.products-quick-filter:hover { border-color: #a5b4fc; background: #eef2ff; color: #3730a3; }
.products-quick-filter.is-active { border-color: #4f46e5; background: #4f46e5; color: #fff; }

.products-filter-panel {
    display: grid;
    grid-template-columns: minmax(17rem, 1.6fr) repeat(5, minmax(9rem, 1fr)) auto;
    gap: .55rem;
    padding: .85rem 1.1rem;
}

.product-search-field { position: relative; min-width: 0; }
.product-search-field .material-icons-round { position: absolute; left: .7rem; top: .62rem; color: var(--nx-text-muted); font-size: 1rem; pointer-events: none; }
.product-search-field input,
.products-filter-panel .input-field { width: 100%; min-height: 2.35rem; border-color: var(--nx-border); background: var(--nx-surface); color: var(--nx-text); font-size: .74rem; }
.product-search-field input { padding-left: 2.15rem; border: 1px solid var(--nx-border); border-radius: .4rem; outline: none; }
.product-search-field input:focus { border-color: #818cf8; box-shadow: 0 0 0 3px rgb(99 102 241 / 12%); }

.products-reset-action {
    min-height: 2.35rem;
    padding: 0 .65rem;
    border: 1px solid var(--nx-border);
    background: var(--nx-surface);
    color: var(--nx-text-muted);
    font-size: .72rem;
}

.products-reset-action:hover { background: var(--nx-surface-hover); color: var(--nx-text); }
.products-reset-action .material-icons-round { font-size: .9rem; }

.products-search-help { display: flex; align-items: center; gap: .38rem; margin: 0; padding: 0 1.1rem .8rem; color: var(--nx-text-muted); font-size: .67rem; line-height: 1.35; }
.products-search-help .material-icons-round { color: #6366f1; font-size: .85rem; }

.products-table-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .7rem 1.1rem;
    border-top: 1px solid var(--nx-border);
    background: var(--nx-surface-muted);
}

.products-currency-view {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: .55rem;
}

.products-currency-view > .material-icons-round {
    display: grid;
    flex: 0 0 1.9rem;
    width: 1.9rem;
    height: 1.9rem;
    place-items: center;
    border-radius: .4rem;
    background: #eef2ff;
    color: #4f46e5;
    font-size: 1rem;
}

.products-currency-view-copy {
    display: grid;
    min-width: 15rem;
    gap: .1rem;
}

.products-currency-view-copy strong { color: var(--nx-text); font-size: .72rem; }
.products-currency-view-copy small { max-width: 31rem; overflow: hidden; color: var(--nx-text-muted); font-size: .64rem; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }

.products-segmented-control {
    display: inline-flex;
    padding: .18rem;
    border: 1px solid var(--nx-border);
    border-radius: .45rem;
    background: var(--nx-surface);
}

.products-segmented-control button {
    min-height: 1.9rem;
    padding: 0 .65rem;
    border: 0;
    border-radius: .3rem;
    background: transparent;
    color: var(--nx-text-muted);
    font-size: .67rem;
    font-weight: 750;
}

.products-segmented-control button:hover { color: #4338ca; }
.products-segmented-control button.is-active { background: #4f46e5; color: #fff; box-shadow: 0 1px 2px rgb(15 23 42 / 15%); }

.products-column-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.3rem;
    gap: .4rem;
    padding: 0 .75rem;
    border: 1px solid var(--nx-border);
    border-radius: .4rem;
    background: var(--nx-surface);
    color: var(--nx-text-muted);
    font-size: .7rem;
    font-weight: 750;
}

.products-column-trigger:hover,
.products-column-trigger[aria-expanded='true'] { border-color: #a5b4fc; color: #4338ca; }
.products-column-trigger .material-icons-round { font-size: .9rem; }

.products-table-wrap { width: 100%; min-width: 0; max-width: 100%; overflow: hidden; border-top: 1px solid var(--nx-border); }
.products-table-wrap[data-products-table-shell] { position: relative; min-height: 13rem; }
.products-table-loading { position: absolute; inset: 2.85rem 0 0; z-index: 8; display: none; align-items: center; justify-content: center; gap: .6rem; min-height: 10rem; background: rgb(255 255 255 / 88%); color: #64748b; font-size: .78rem; font-weight: 700; }
.products-table-loading.is-visible { display: flex; }
.products-table-loading > span:first-child { width: 1.15rem; height: 1.15rem; border: 2px solid #c7d2fe; border-top-color: #4f46e5; border-radius: 50%; animation: nx-spin .7s linear infinite; }
.dark .products-table-loading { background: rgb(15 23 42 / 78%); color: #cbd5e1; }
.pos-loading-card { display: grid; min-height: 10.5rem; gap: .75rem; padding: 1rem; border: 1px solid #e2e8f0; border-radius: .6rem; background: #fff; }
.pos-loading-card i,
.pos-loading-row span { display: block; border-radius: .35rem; background: linear-gradient(90deg, #eef2f7 25%, #f8fafc 37%, #eef2f7 63%); background-size: 400% 100%; animation: noxstock-skeleton 1.25s ease infinite; }
.pos-loading-card i:nth-child(1) { width: 72%; height: 1rem; }
.pos-loading-card i:nth-child(2) { width: 52%; height: .7rem; }
.pos-loading-card i:nth-child(3) { width: 86%; height: .7rem; }
.pos-loading-card i:nth-child(4) { width: 40%; height: 1.15rem; margin-top: auto; }
.pos-loading-row td { padding: 1rem 1.25rem; }
.pos-loading-row span { height: .68rem; margin: .42rem 0; }
.pos-loading-row span:nth-child(1) { width: 28%; }
.pos-loading-row span:nth-child(2) { width: 62%; }
.pos-loading-row span:nth-child(3) { width: 42%; }
@keyframes noxstock-skeleton { to { background-position: -400% 0; } }
.pos-product-grid {
    max-height: min(62vh, 42rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
    align-content: start;
}
.pos-product-grid::-webkit-scrollbar { width: .55rem; }
.pos-product-grid::-webkit-scrollbar-track { background: transparent; }
.pos-product-grid::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 999px; background: #cbd5e1; background-clip: padding-box; }
.pos-product-grid .pos-product-card {
    width: 100%;
    display: flex;
    flex-direction: column;
    height: 14rem;
    box-sizing: border-box;
    overflow: hidden;
}
.pos-product-card-heading { min-width: 0; }
.pos-product-card-name { display: -webkit-box; min-height: 2.5rem; overflow: hidden; color: #1e293b; font-size: .84rem; font-weight: 750; line-height: 1.25rem; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.pos-product-card-code,
.pos-product-card-oem { min-height: 1rem; margin-top: .2rem; overflow: hidden; color: #64748b; font-size: .66rem; line-height: 1rem; text-overflow: ellipsis; white-space: nowrap; }
.pos-product-card-details { display: grid; gap: .22rem; margin-top: .6rem; color: #64748b; font-size: .68rem; line-height: 1rem; }
.pos-product-card-details p { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pos-product-card-details .pos-product-card-policy { color: #4f46e5; font-weight: 700; }
.pos-product-card-footer { display: flex; align-items: end; justify-content: space-between; gap: .5rem; margin-top: auto; padding-top: .65rem; color: #4f46e5; font-size: .72rem; font-weight: 750; line-height: 1rem; }
.pos-product-card-footer > span:last-child { overflow: hidden; color: #64748b; font-size: .66rem; font-weight: 500; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.pos-cart-header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: 1rem 1.1rem; background: linear-gradient(135deg, rgb(238 242 255 / 78%), rgb(255 255 255)); }
.pos-cart-title { display: flex; min-width: 0; align-items: center; gap: .6rem; }
.pos-cart-title > .material-icons-round { display: grid; width: 2.15rem; height: 2.15rem; flex: 0 0 auto; place-items: center; border-radius: .65rem; background: #4f46e5; color: #fff; font-size: 1.15rem; box-shadow: 0 5px 12px rgb(79 70 229 / 22%); }
.pos-cart-title h3 { color: #1e293b; font-size: 1rem; font-weight: 800; line-height: 1.15rem; }
.pos-cart-title p { max-width: 11rem; margin-top: .15rem; color: #64748b; font-size: .66rem; line-height: .95rem; }
.pos-cart-header-actions { display: flex; flex: 0 0 auto; align-items: center; gap: .45rem; }
.pos-refresh-prices { display: inline-flex; min-height: 2.15rem; align-items: center; gap: .3rem; border: 1px solid #c7d2fe; border-radius: .55rem; background: #fff; padding: .35rem .5rem; color: #4338ca; font-size: .64rem; font-weight: 750; line-height: .8rem; transition: .16s ease; }
.pos-refresh-prices:hover { border-color: #818cf8; background: #eef2ff; }
.pos-refresh-prices .material-icons-round { font-size: .9rem; }
.pos-cart-count { display: inline-flex; min-height: 2.15rem; min-width: 2.15rem; align-items: center; justify-content: center; gap: .25rem; border-radius: .55rem; background: #e0e7ff; padding: .35rem .45rem; color: #4338ca; font-size: .65rem; font-weight: 800; line-height: .8rem; white-space: nowrap; }
.pos-cart-count .material-icons-round { font-size: .85rem; }
.pos-cart-price-fields {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(5.15rem, .75fr);
    gap: .5rem;
    align-items: end;
}
.pos-cart-price-fields > label {
    display: grid;
    gap: .25rem;
    min-width: 0;
    color: #64748b;
    font-size: .67rem;
    line-height: 1.25;
    white-space: nowrap;
}
.pos-cart-price-fields input,
.pos-cart-price-fields select {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 2.15rem;
    margin-top: 0 !important;
}
.dark .pos-loading-card { border-color: #334155; background: #1e293b; }
.dark .pos-loading-card i,
.dark .pos-loading-row span { background: linear-gradient(90deg, #334155 25%, #475569 37%, #334155 63%); background-size: 400% 100%; }
.dark .pos-product-grid::-webkit-scrollbar-thumb { background: #475569; background-clip: padding-box; }
.dark .pos-product-grid { scrollbar-color: #475569 transparent; }
.dark .pos-cart-price-fields > label { color: #94a3b8; }
.dark .pos-product-card-name,
.dark .pos-cart-title h3 { color: #f8fafc; }
.dark .pos-product-card-code,
.dark .pos-product-card-oem,
.dark .pos-product-card-details,
.dark .pos-product-card-footer > span:last-child,
.dark .pos-cart-title p { color: #94a3b8; }
.dark .pos-cart-header { background: linear-gradient(135deg, rgb(30 41 59 / 92%), rgb(15 23 42 / 92%)); }
.dark .pos-refresh-prices { border-color: #3730a3; background: #1e293b; color: #c7d2fe; }
.dark .pos-refresh-prices:hover { background: #312e81; }
.dark .pos-cart-count { background: rgb(67 56 202 / 35%); color: #c7d2fe; }

.finance-modal-form .modal-header { padding: 1.15rem 1.3rem; border-bottom-color: #dbe4ee !important; background: linear-gradient(135deg, #f8faff, #fff); }
.finance-modal-form .modal-title { color: #1e293b; font-size: 1.05rem; font-weight: 800; }
.finance-modal-body { padding: 1.3rem !important; }
.finance-modal-intro { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.2rem; padding: .8rem .9rem; border: 1px solid; border-radius: .7rem; }
.finance-modal-intro > .material-icons-round { display: grid; width: 2.45rem; height: 2.45rem; flex: 0 0 auto; place-items: center; border-radius: .6rem; color: #fff; font-size: 1.25rem; box-shadow: 0 5px 12px rgb(15 23 42 / 14%); }
.finance-modal-intro strong { display: block; font-size: .82rem; font-weight: 800; line-height: 1.15rem; }
.finance-modal-intro small { display: block; margin-top: .15rem; color: #64748b; font-size: .71rem; line-height: 1.05rem; }
.finance-modal-intro-indigo { border-color: #c7d2fe; background: #eef2ff; color: #3730a3; }
.finance-modal-intro-indigo > .material-icons-round { background: #4f46e5; }
.finance-modal-intro-emerald { border-color: #a7f3d0; background: #ecfdf5; color: #047857; }
.finance-modal-intro-emerald > .material-icons-round { background: #059669; }
.finance-modal-intro-blue { border-color: #bfdbfe; background: #eff6ff; color: #1d4ed8; }
.finance-modal-intro-blue > .material-icons-round { background: #2563eb; }
.finance-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .15rem .85rem; }
.finance-field-wide { grid-column: 1 / -1; }
.finance-modal-form .mb-3 { margin-bottom: .8rem !important; }
.finance-modal-form .form-label { margin-bottom: .34rem; color: #475569; font-size: .72rem; font-weight: 750; }
.finance-modal-form .form-control,
.finance-modal-form .form-select { min-height: 2.55rem; border-color: #cbd5e1; border-radius: .5rem; box-shadow: none; font-size: .84rem; }
.finance-modal-form .form-control:focus,
.finance-modal-form .form-select:focus { border-color: #818cf8; box-shadow: 0 0 0 3px rgb(99 102 241 / 12%); }
.finance-modal-toggle { margin-top: .35rem; padding: .7rem .8rem; border: 1px solid #dbe4ee; border-radius: .6rem; background: #f8fafc; }
.finance-modal-toggle .mb-3 { margin: 0 !important; }
.finance-modal-toggle .form-check-label { color: #334155; font-size: .78rem; font-weight: 700; }
.finance-transfer-flow { display: grid; grid-template-columns: minmax(0, 1fr) 2rem minmax(0, 1fr); align-items: center; gap: .5rem; }
.finance-transfer-flow > div { position: relative; min-width: 0; padding: .55rem .65rem 0; border: 1px solid #dbe4ee; border-radius: .65rem; background: #f8fafc; }
.finance-transfer-flow > div > span { position: absolute; top: -.55rem; left: .65rem; display: grid; width: 1.15rem; height: 1.15rem; place-items: center; border-radius: 50%; background: #2563eb; color: #fff; font-size: .62rem; font-weight: 800; }
.finance-transfer-flow > i { color: #2563eb; font-size: 1.25rem; text-align: center; }
.finance-modal-form .modal-footer { gap: .5rem; padding: .9rem 1.3rem; border-top-color: #dbe4ee !important; background: #fafcff; }
.finance-modal-form .modal-footer .btn { min-width: 5.25rem; border-radius: .5rem; font-size: .8rem; font-weight: 750; }
.dark .finance-modal-form .modal-header,
.dark .finance-modal-form .modal-footer { border-color: #334155 !important; background: #0f172a; }
.dark .finance-modal-form .modal-title { color: #f8fafc; }
.dark .finance-modal-intro small,
.dark .finance-modal-form .form-label,
.dark .finance-modal-toggle .form-check-label { color: #cbd5e1; }
.dark .finance-modal-intro-indigo { border-color: #3730a3; background: rgb(49 46 129 / 35%); color: #c7d2fe; }
.dark .finance-modal-intro-emerald { border-color: #065f46; background: rgb(6 78 59 / 35%); color: #a7f3d0; }
.dark .finance-modal-intro-blue { border-color: #1e40af; background: rgb(30 58 138 / 35%); color: #bfdbfe; }
.dark .finance-modal-toggle,
.dark .finance-transfer-flow > div { border-color: #334155; background: #1e293b; }

@media (max-width: 575px) {
    .finance-form-grid { grid-template-columns: 1fr; }
    .finance-transfer-flow { grid-template-columns: 1fr; }
    .finance-transfer-flow > i { transform: rotate(90deg); }
}

@media (max-width: 420px) {
    .pos-cart-price-fields { grid-template-columns: minmax(0, 1.15fr) minmax(4.75rem, .85fr); gap: .35rem; }
    .pos-cart-price-fields > label { font-size: .63rem; }
}
.products-table-wrap .dataTables_wrapper,
.products-table-wrap .dataTables_scroll { width: 100% !important; min-width: 0; max-width: 100%; }
.products-table-wrap .dataTables_scrollHead,
.products-table-wrap .dataTables_scrollFoot { max-width: 100%; overflow: hidden !important; }
.products-table-wrap .dataTables_scrollBody { width: 100% !important; max-width: 100%; overflow-x: auto !important; overflow-y: hidden; scrollbar-width: thin; }
.products-table-wrap .dataTables_scrollHeadInner,
.products-table-wrap .dataTables_scrollFootInner { max-width: none; }
.product-data-table { min-width: 1020px; table-layout: fixed; }
.product-data-table th { position: relative; padding: .72rem .55rem; white-space: normal; overflow-wrap: anywhere; line-height: 1.35; letter-spacing: .035em; font-size: .66rem; }
.product-data-table td { min-height: 4.35rem; padding: .62rem .5rem; vertical-align: middle; overflow: hidden; }
.product-column-resize-handle { position: absolute; top: 0; right: -3px; bottom: 0; z-index: 2; width: 7px; cursor: col-resize; }
.product-column-resize-handle:hover,
.is-resizing-product-columns .product-column-resize-handle { background: rgb(79 70 229 / 35%); }
.is-resizing-product-columns,
.is-resizing-product-columns * { cursor: col-resize !important; user-select: none !important; }
.product-data-table th:nth-child(1), .product-data-table td:nth-child(1) { width: 4.5rem; }
.product-data-table th:nth-child(2), .product-data-table td:nth-child(2) { width: 15rem; }
.product-data-table th:nth-child(3), .product-data-table td:nth-child(3) { width: 7rem; }
.product-data-table th:nth-child(4), .product-data-table td:nth-child(4) { width: 12rem; }
.product-data-table th:nth-child(5), .product-data-table td:nth-child(5) { width: 15rem; }
.product-data-table th:nth-child(6), .product-data-table td:nth-child(6) { width: 12rem; }
.product-data-table th:nth-child(7), .product-data-table td:nth-child(7) { width: 13rem; }
.product-data-table th:nth-child(n+8), .product-data-table td:nth-child(n+8) { width: 10rem; }

.product-row-actions { display: flex; align-items: center; gap: .18rem; }
.product-row-actions button { width: 1.9rem; height: 1.9rem; border: 1px solid transparent; background: transparent; }
.product-row-actions .material-icons-round { font-size: 1rem; }
.product-edit-button { color: #4f46e5; }
.product-edit-button:hover { border-color: #c7d2fe; background: #eef2ff; color: #3730a3; }
.product-delete-button { color: #dc2626; }
.product-delete-button:hover { border-color: #fecaca; background: #fef2f2; color: #b91c1c; }

.product-table-name { max-width: 15rem; overflow: hidden; color: var(--nx-text-strong); font-size: .84rem; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.product-table-subtitle,
.product-table-description,
.product-code-list,
.product-stock-status,
.product-cost-source,
.product-sale-live { margin-top: .23rem; color: var(--nx-text-muted); font-size: .68rem; line-height: 1.35; }
.product-table-description { max-width: 15rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-table-compact { overflow: hidden; color: var(--nx-text); font-size: .72rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.product-table-muted { color: var(--nx-text-muted); }
.product-table-empty { display: grid; gap: .1rem; color: var(--nx-text-muted); }
.product-table-empty strong { color: var(--nx-border-strong); font-size: .9rem; line-height: 1; }
.product-table-empty span { font-size: .65rem; line-height: 1.3; }
.product-code-main { color: var(--nx-text); font-size: .76rem; font-weight: 700; }
.product-code-list { display: grid; max-width: 13rem; gap: .12rem; overflow: hidden; }
.product-code-list span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-code-list strong { color: var(--nx-text); font-weight: 650; }
.product-stock-value,
.product-cost-value,
.product-sale-value { color: var(--nx-text-strong); font-size: .82rem; font-weight: 800; }
.product-stock-value.is-normal { color: #047857; }
.product-stock-value.is-critical { color: #c2410c; }
.product-stock-value.is-zero { color: #dc2626; }
.product-stock-status.is-normal { color: #047857; }
.product-stock-status.is-critical { color: #c2410c; }
.product-stock-status.is-zero { color: #dc2626; }
.product-stock-value.is-untracked,
.product-stock-status.is-untracked { color: var(--nx-text-muted); }

.product-pricing-status { display: inline-flex; align-items: center; gap: .34rem; padding: .27rem .42rem; border: 1px solid; border-radius: .35rem; font-size: .66rem; font-weight: 750; }
.product-pricing-status .material-icons-round { font-size: .8rem; }
.product-pricing-status.is-dynamic { border-color: #c7d2fe; background: #eef2ff; color: #4338ca; }
.product-pricing-status.is-manual { border-color: #cbd5e1; background: #f8fafc; color: #475569; }
.product-cost-source { color: #475569; }
.product-cost-source-title { max-width: 13rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-cost-empty,
.product-sale-unavailable { display: flex; align-items: flex-start; gap: .4rem; color: var(--nx-text-muted); }
.product-cost-empty .material-icons-round,
.product-sale-unavailable .material-icons-round { margin-top: .02rem; font-size: 1rem; }
.product-cost-empty strong,
.product-sale-unavailable strong { display: block; color: var(--nx-text); font-size: .7rem; }
.product-cost-empty span:not(.material-icons-round),
.product-sale-unavailable span:not(.material-icons-round) { display: block; margin-top: .14rem; font-size: .63rem; line-height: 1.35; }
.product-sale-unavailable .material-icons-round { color: #d97706; }
.product-sale-unavailable.is-action-needed { color: #92400e; }
.product-sale-unavailable.is-action-needed strong { color: #92400e; }
.product-sale-live { color: #4338ca; font-weight: 650; }
.product-sale-live span { display: inline-block; width: .35rem; height: .35rem; margin-right: .2rem; border-radius: 50%; background: #4f46e5; }

.products-column-menu { position: absolute; right: 0; z-index: 20; width: 31rem; max-width: calc(100vw - 2rem); margin-top: .35rem; padding: .8rem; border: 1px solid var(--nx-border); border-radius: .45rem; background: var(--nx-surface); box-shadow: 0 .75rem 2rem rgb(15 23 42 / 16%); color: var(--nx-text); }
.products-column-menu-heading { display: grid; gap: .12rem; padding-bottom: .6rem; border-bottom: 1px solid var(--nx-border); }
.products-column-menu-heading strong { font-size: .75rem; }
.products-column-menu-heading span { color: var(--nx-text-muted); font-size: .64rem; }
.products-column-menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; padding: .7rem 0; }
.products-column-menu-grid > div { display: grid; align-content: start; gap: .35rem; }
.products-column-menu-grid p { margin: 0 0 .1rem; color: var(--nx-text-muted); font-size: .6rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.products-column-menu-grid label { display: flex; align-items: center; gap: .4rem; cursor: pointer; font-size: .68rem; }
.products-column-menu-grid input { accent-color: #4f46e5; }
.products-column-menu-note { display: flex; align-items: flex-start; gap: .35rem; margin-bottom: .65rem; padding: .5rem .55rem; border-radius: .35rem; background: var(--nx-surface-muted); color: var(--nx-text-muted); font-size: .63rem; line-height: 1.35; }
.products-column-menu-note .material-icons-round { flex: 0 0 auto; color: #6366f1; font-size: .82rem; }
.products-column-menu-reset { display: inline-flex; align-items: center; gap: .25rem; padding: .35rem 0 0; border: 0; border-top: 1px solid var(--nx-border); background: transparent; color: #4f46e5; font-size: .66rem; }
.products-column-menu-reset .material-icons-round { font-size: .82rem; }

/* License management: keep the row action area compact and predictable. */
.license-assignment-card { overflow: hidden; border: 1px solid #c7d2fe; border-radius: .75rem; background: var(--nx-surface); box-shadow: 0 .15rem .5rem rgb(15 23 42 / 6%); }
.license-assignment-card-header { display: flex; align-items: flex-start; gap: .75rem; padding: 1rem 1.25rem; border-bottom: 1px solid #e0e7ff; background: rgb(238 242 255 / 70%); }
.license-assignment-card-header > .material-icons-round { margin-top: .1rem; color: #4f46e5; }
.license-assignment-card-header h2 { margin: 0; color: var(--nx-text); font-size: .95rem; font-weight: 700; }
.license-assignment-card-header p { margin: .2rem 0 0; color: var(--nx-text-muted); font-size: .75rem; }
.license-assignment-card-body { padding: 1.25rem; }
.license-no-unlicensed-state { display: flex; align-items: center; gap: .75rem; padding: .9rem 1.1rem; border: 1px solid var(--nx-border); border-radius: .65rem; background: var(--nx-surface); color: var(--nx-text-muted); }
.license-no-unlicensed-state > .material-icons-round { color: #059669; font-size: 1.3rem; }
.license-no-unlicensed-state strong { display: block; color: var(--nx-text); font-size: .78rem; }
.license-no-unlicensed-state p { margin: .15rem 0 0; font-size: .7rem; }
.license-management-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: .45rem; min-width: 9.5rem; }
.license-history-action,
.license-actions-menu > summary { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; min-height: 2.2rem; padding: .45rem .7rem; border: 1px solid var(--nx-border); border-radius: .55rem; background: var(--nx-surface); color: var(--nx-text); cursor: pointer; font-size: .7rem; font-weight: 700; list-style: none; transition: background .15s ease, border-color .15s ease, color .15s ease; }
.license-history-action:hover,
.license-actions-menu > summary:hover { border-color: #a5b4fc; background: #eef2ff; color: #4338ca; }
.license-delete-direct { display: inline-flex; align-items: center; justify-content: center; gap: .3rem; min-height: 2.2rem; padding: .45rem .65rem; border: 1px solid #fecdd3; border-radius: .55rem; background: #fff1f2; color: #be123c; cursor: pointer; font-size: .7rem; font-weight: 700; transition: background .15s ease, border-color .15s ease; }
.license-delete-direct:hover { border-color: #fda4af; background: #ffe4e6; }
.license-delete-direct .material-icons-round { font-size: .95rem; }
.license-history-action .material-icons-round,
.license-actions-menu .material-icons-round { font-size: .95rem; }
.license-actions-menu { position: relative; }
.license-actions-menu > summary::-webkit-details-marker { display: none; }
.license-actions-chevron { transition: transform .15s ease; }
.license-actions-menu[open] .license-actions-chevron { transform: rotate(180deg); }
.license-actions-popover { position: absolute; bottom: calc(100% + .4rem); right: 0; z-index: 30; display: grid; min-width: 13.5rem; gap: .35rem; padding: .55rem; border: 1px solid var(--nx-border); border-radius: .65rem; background: var(--nx-surface); box-shadow: 0 .75rem 2rem rgb(15 23 42 / 18%); }
.license-action-row { display: flex; width: 100%; }
.license-action-button { display: inline-flex; width: 100%; align-items: center; justify-content: flex-start; gap: .45rem; min-height: 2.1rem; padding: .45rem .6rem; border: 1px solid transparent; border-radius: .45rem; cursor: pointer; font-size: .7rem; font-weight: 700; transition: background .15s ease, border-color .15s ease; }
.license-action-button .material-icons-round { font-size: .95rem; }
.license-action-neutral { border-color: var(--nx-border); background: var(--nx-surface); color: var(--nx-text); }
.license-action-neutral:hover { background: var(--nx-surface-hover); }
.license-action-primary { background: #eef2ff; color: #4338ca; }
.license-action-primary:hover { background: #e0e7ff; }
.license-action-success { background: #ecfdf5; color: #047857; }
.license-action-success:hover { background: #d1fae5; }
.license-action-warning { background: #fffbeb; color: #b45309; }
.license-action-warning:hover { background: #fef3c7; }
.license-action-danger-outline { border-color: #fecdd3; background: #fff1f2; color: #be123c; }
.license-action-danger-outline:hover { background: #ffe4e6; }
.license-action-danger { background: #e11d48; color: #fff; }
.license-action-danger:hover { background: #be123c; }
.license-action-delete-row { margin-top: .2rem; padding-top: .45rem; border-top: 1px solid var(--nx-border); }
.license-plan-select { min-width: 0; flex: 1; border: 1px solid var(--nx-border); border-radius: .45rem; background: var(--nx-surface); color: var(--nx-text); padding: .4rem .5rem; font-size: .7rem; }

@media (max-width: 900px) {
    .license-management-actions { min-width: 0; }
    .license-actions-popover { position: fixed; bottom: 1rem; right: 1rem; }
}

.product-edit-shell .form-label { color: var(--nx-text); font-size: .72rem; font-weight: 700; }
.product-edit-shell .form-control,
.product-edit-shell .form-select { min-height: 2.35rem; border-color: var(--nx-border); background-color: var(--nx-surface); color: var(--nx-text); font-size: .78rem; }
.product-edit-shell .table { --bs-table-bg: var(--nx-surface); --bs-table-color: var(--nx-text); --bs-table-border-color: var(--nx-border); }

.product-pricing-dashboard {
    display: grid;
    gap: .85rem;
    padding: 1rem;
    border: 1px solid #c7d2fe;
    border-radius: .5rem;
    background: #f8faff;
}

.product-pricing-dashboard-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.product-pricing-kicker { color: #4f46e5; font-size: .62rem; font-weight: 800; letter-spacing: .04em; }
.product-pricing-dashboard h5 { margin: .2rem 0 0; color: #1e1b4b; font-size: .95rem; font-weight: 800; }
.product-pricing-dashboard-header p { max-width: 42rem; margin: .25rem 0 0; color: #64748b; font-size: .68rem; line-height: 1.4; }
.product-pricing-lock { display: inline-flex; align-items: center; gap: .25rem; flex: 0 0 auto; padding: .35rem .5rem; border: 1px solid #c7d2fe; border-radius: .35rem; background: rgb(255 255 255 / 70%); color: #4338ca; font-size: .63rem; font-weight: 700; }
.product-pricing-lock .material-icons-round { font-size: .8rem; }

.product-pricing-flow-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr); align-items: stretch; gap: .55rem; }
.product-pricing-flow-card { display: grid; align-content: center; min-height: 5rem; padding: .65rem .7rem; border: 1px solid #dbeafe; border-radius: .4rem; background: rgb(255 255 255 / 84%); }
.product-pricing-flow-card > span { color: #64748b; font-size: .62rem; font-weight: 700; }
.product-pricing-flow-card > strong { margin-top: .25rem; color: #1e293b; font-size: .95rem; font-weight: 800; }
.product-pricing-flow-card > small { margin-top: .25rem; color: #64748b; font-size: .62rem; line-height: 1.35; }
.product-pricing-facts { display: grid; gap: .25rem; margin: .55rem 0 0; padding-top: .45rem; border-top: 1px solid var(--nx-border); }
.product-pricing-facts > div { display: flex; justify-content: space-between; gap: .75rem; font-size: .61rem; line-height: 1.3; }
.product-pricing-facts dt { color: var(--nx-text-muted); font-weight: 600; }
.product-pricing-facts dd { margin: 0; color: var(--nx-text); font-weight: 700; text-align: right; }
.product-pricing-reference { border-color: #a7f3d0; }
.product-pricing-reference > strong { color: #047857; }
.product-pricing-result { border-color: #a5b4fc; }
.product-pricing-result > strong { color: #4338ca; }
.product-pricing-flow-arrow { align-self: center; color: #818cf8; font-size: 1rem; }
.product-pricing-warning { padding: .55rem .65rem; border: 1px solid #fcd34d; border-radius: .35rem; background: #fffbeb; color: #92400e; font-size: .68rem; line-height: 1.4; }
.product-pricing-footnote { display: flex; align-items: flex-start; gap: .35rem; margin: 0; color: #64748b; font-size: .64rem; line-height: 1.4; }
.product-pricing-footnote .material-icons-round { color: #6366f1; font-size: .85rem; }
.product-pricing-mode-pill { display: inline-flex; align-items: center; min-height: 1.8rem; padding: .25rem .5rem; border: 1px solid; border-radius: .35rem; font-size: .68rem; font-weight: 700; }
.product-pricing-mode-pill.is-dynamic { border-color: #a5b4fc; background: #eef2ff; color: #4338ca; }
.product-pricing-mode-pill.is-manual { border-color: #cbd5e1; background: #f8fafc; color: #475569; }
.product-pricing-mode-select { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.product-pricing-mode-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.product-pricing-mode-option { display: flex; align-items: flex-start; gap: .5rem; min-height: 3.8rem; padding: .6rem .65rem; border: 1px solid var(--nx-border); border-radius: .45rem; background: var(--nx-surface); color: var(--nx-text-muted); text-align: left; cursor: pointer; transition: border-color .15s ease, background-color .15s ease, color .15s ease, box-shadow .15s ease; }
.product-pricing-mode-option > .material-icons-round { flex: 0 0 auto; margin-top: .1rem; color: #64748b; font-size: 1.1rem; }
.product-pricing-mode-option > span:last-child { display: grid; gap: .18rem; }
.product-pricing-mode-option strong { color: var(--nx-text); font-size: .72rem; line-height: 1.2; }
.product-pricing-mode-option small { color: var(--nx-text-muted); font-size: .61rem; line-height: 1.3; }
.product-pricing-mode-option:hover { border-color: #818cf8; background: #f8faff; }
.product-pricing-mode-option.is-selected { border-color: #6366f1; background: #eef2ff; box-shadow: 0 0 0 2px rgb(99 102 241 / 12%); }
.product-pricing-mode-option.is-selected > .material-icons-round { color: #4f46e5; }
.product-pricing-context-field { transition: opacity .15s ease, border-color .15s ease; }
.product-pricing-context-field.is-fallback-context { opacity: .82; }
.product-pricing-context-field.is-fallback-context .input-field,
.product-pricing-context-field.is-fallback-context select { border-style: dashed; }
.product-pricing-context-help { display: block; margin-top: .28rem; color: var(--nx-text-muted); font-size: .61rem; line-height: 1.35; }
.product-pricing-mode-status-wrap { display: grid; gap: .25rem; }
.product-pricing-mode-hint { color: var(--nx-text-muted); font-size: .62rem; line-height: 1.3; }
.product-pricing-actions { display: flex; flex-wrap: wrap; gap: .45rem; }
.product-pricing-action { display: inline-flex; align-items: center; gap: .3rem; min-height: 2rem; padding: .35rem .6rem; border: 1px solid var(--nx-border); border-radius: .35rem; background: var(--nx-surface); color: var(--nx-text); font-size: .67rem; font-weight: 700; cursor: pointer; }
.product-pricing-action:hover { border-color: #818cf8; color: #4338ca; }
.product-pricing-action-primary { border-color: #6366f1; background: #4f46e5; color: #fff; }
.product-pricing-action-primary:hover { background: #4338ca; color: #fff; }
.product-pricing-action .material-icons-round { font-size: .9rem; }
.product-pricing-action.is-loading .material-icons-round { animation: product-pricing-spin .8s linear infinite; }
@keyframes product-pricing-spin { to { transform: rotate(360deg); } }

.dark .product-pricing-dashboard { border-color: #4338ca; background: #1e1b4b; }
.dark .product-pricing-dashboard h5 { color: #eef2ff; }
.dark .product-pricing-dashboard-header p,
.dark .product-pricing-flow-card > span,
.dark .product-pricing-flow-card > small,
.dark .product-pricing-footnote { color: #a5b4fc; }
.dark .product-pricing-lock,
.dark .product-pricing-flow-card { border-color: #4338ca; background: rgb(15 23 42 / 70%); color: #c7d2fe; }
.dark .product-pricing-flow-card > strong { color: #f8fafc; }
.dark .product-pricing-reference { border-color: #047857; }
.dark .product-pricing-reference > strong { color: #6ee7b7; }
.dark .product-pricing-result { border-color: #6366f1; }
.dark .product-pricing-result > strong { color: #c7d2fe; }
.dark .product-pricing-warning { border-color: #92400e; background: rgb(120 53 15 / 35%); color: #fde68a; }
.dark .product-pricing-mode-pill.is-manual { border-color: #475569; background: #1e293b; color: #cbd5e1; }
.dark .product-pricing-mode-option { border-color: #475569; background: #0f172a; }
.dark .product-pricing-mode-option:hover { border-color: #818cf8; background: #1e1b4b; }
.dark .product-pricing-mode-option.is-selected { border-color: #818cf8; background: #312e81; }
.dark .product-pricing-mode-option > .material-icons-round { color: #94a3b8; }
.dark .product-pricing-mode-option.is-selected > .material-icons-round { color: #c7d2fe; }
.dark .product-pricing-context-field.is-fallback-context .input-field,
.dark .product-pricing-context-field.is-fallback-context select { border-color: #64748b; }
.dark .product-pricing-context-help { color: #94a3b8; }
.dark .product-pricing-action { border-color: #475569; background: #0f172a; color: #e2e8f0; }
.dark .product-pricing-action:hover { border-color: #818cf8; color: #c7d2fe; }

.dark .products-overview-card,
.dark .product-editor-section,
.dark .product-editor-panel,
.dark .products-list-shell,
.dark .product-edit-modal .modal-content { background: var(--nx-surface); }
.dark .products-overview-primary > .material-icons-round,
.dark .product-pricing-status.is-dynamic,
.dark .product-pricing-mode-note { background: rgb(49 46 129 / .25); }
.dark .products-overview-dynamic > .material-icons-round { background: rgb(8 145 178 / .18); }
.dark .products-overview-warning > .material-icons-round { background: rgb(180 83 9 / .18); }
.dark .products-overview-danger > .material-icons-round { background: rgb(185 28 28 / .18); }
.dark .product-pricing-status.is-manual { border-color: #475569; background: #1e293b; color: #cbd5e1; }
.dark .products-secondary-action { background: #1e293b; color: #c7d2fe; }
.dark .product-pricing-mode-note { border-color: #4338ca; color: #c7d2fe; }
.dark .product-editor-tab.is-active { color: #c7d2fe; }
.dark .product-finance-hero { border-color: #4338ca; background: linear-gradient(155deg, #1e1b4b 0%, #0f172a 48%, #022c22 100%); }
.dark .product-finance-hero-head { border-color: #4338ca; }
.dark .product-finance-hero-head h4,
.dark .product-finance-main > strong,
.dark .product-finance-breakdown dd { color: #f8fafc; }
.dark .product-finance-main > span,
.dark .product-finance-main > small,
.dark .product-finance-profit > span,
.dark .product-finance-breakdown dt { color: #94a3b8; }
.dark .product-finance-breakdown,
.dark .product-finance-breakdown > div { border-color: #334155; }
.dark .product-finance-profit { border-color: #047857; background: rgb(6 78 59 / 38%); }
.dark .product-finance-integrity { border-color: #4338ca; background: rgb(15 23 42 / 72%); color: #cbd5e1; }
.dark .product-finance-integrity strong { color: #c7d2fe; }
.dark .products-feedback-success { border-color: #166534; background: rgb(20 83 45 / .35); color: #bbf7d0; }
.dark .products-feedback-error { border-color: #7f1d1d; background: rgb(127 29 29 / .25); color: #fecaca; }
.dark .products-currency-view > .material-icons-round { background: rgb(49 46 129 / .3); color: #c7d2fe; }
.dark .products-segmented-control button.is-active { background: #6366f1; }
.dark .product-sale-unavailable.is-action-needed,
.dark .product-sale-unavailable.is-action-needed strong { color: #fbbf24; }
.dark .product-import-dropzone { border-color: #6366f1; background: rgb(49 46 129 / .18); color: #c7d2fe; }
.dark .product-import-dropzone:hover { background: rgb(49 46 129 / .3); }
.dark .product-edit-modal .form-control,
.dark .product-edit-modal .form-select { background-color: var(--nx-surface); color: var(--nx-text); }

@media (max-width: 1420px) {
    .products-overview { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .product-editor-grid { grid-template-columns: minmax(0, 1fr) minmax(17rem, .62fr); }
    .products-filter-panel { grid-template-columns: minmax(15rem, 1.6fr) repeat(3, minmax(9rem, 1fr)); }
}

@media (max-width: 960px) {
    .products-workspace-header,
    .product-editor-header,
    .products-list-heading { align-items: flex-start; flex-direction: column; }
    .products-header-actions { width: 100%; }
    .products-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .products-guidance { align-items: flex-start; flex-direction: column; }
    .products-guidance-arrow { display: none; }
    .product-editor-grid { grid-template-columns: 1fr; }
    .product-editor-identity,
    .product-editor-pricing,
    .product-editor-stock,
    .product-finance-hero { grid-column: 1; grid-row: auto; }
    .product-finance-hero { position: static; order: -1; }
    .product-editor-stock .product-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .product-editor-header-actions { width: 100%; flex-wrap: wrap; }
    .product-keyboard-hint { flex: 1 0 100%; }
    .products-filter-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .products-table-tools { align-items: flex-start; flex-direction: column; }
    .products-currency-view { width: 100%; flex-wrap: wrap; }
    .products-currency-view-copy { flex: 1; }
    .products-column-trigger { width: 100%; }
    #ColumnToggleWrapper { width: 100%; }
    .product-search-field { grid-column: 1 / -1; }
    .product-pricing-flow-grid { grid-template-columns: 1fr; }
    .product-pricing-flow-arrow { display: none; }
    .product-pricing-mode-picker { grid-template-columns: 1fr; }
}

@media (max-width: 580px) {
    .products-overview,
    .product-form-grid-2,
    .product-editor-stock .product-form-grid,
    .products-filter-panel { grid-template-columns: 1fr; }
    .product-editor-header-actions .products-primary-action,
    .product-editor-header-actions .product-editor-cancel { flex: 1; }
    .product-discount-matrix { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .product-discount-matrix > .material-icons-round { display: none; }
    .product-search-field { grid-column: auto; }
    .product-pricing-dashboard-header { flex-direction: column; }
    .product-pricing-lock { align-self: flex-start; }
    .products-header-actions > .products-primary-action { flex: 1; }
    .products-guidance { padding: .7rem; }
    .products-overview-card { min-height: 4.65rem; }
    .product-editor-form,
    .product-editor-header,
    .products-list-heading,
    .products-filter-panel { padding-left: .8rem; padding-right: .8rem; }
    .products-quick-filters { padding-left: .8rem; padding-right: .8rem; }
    .products-search-help { padding-left: .8rem; padding-right: .8rem; }
    .products-table-tools { padding-left: .8rem; padding-right: .8rem; }
    .products-currency-view-copy { min-width: calc(100% - 2.5rem); }
    .products-currency-view-copy small { white-space: normal; }
    .products-segmented-control { width: 100%; }
    .products-segmented-control button { flex: 1; }
    .products-column-menu { position: fixed; right: .75rem; left: .75rem; width: auto; max-width: none; }
    .products-column-menu-grid { grid-template-columns: 1fr; }
}

.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_length {
    margin-bottom: 1rem;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    margin-left: 0.5rem;
    padding: 0.4rem 0.6rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    min-width: 2rem;
    margin-left: 0.25rem;
    padding: 0.4rem 0.65rem;
    border: 1px solid var(--nx-border) !important;
    border-radius: 0.375rem;
    background: var(--nx-surface) !important;
    color: var(--nx-text-muted) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    border-color: var(--nx-primary) !important;
    background: var(--nx-primary) !important;
    color: #fff !important;
}

.modal-content {
    overflow: hidden;
    border: 1px solid var(--nx-border);
    border-radius: 0.5rem;
    background: var(--nx-surface);
    color: var(--nx-text);
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.24);
}

.modal-header,
.modal-footer {
    border-color: var(--nx-border);
    background: var(--nx-surface-muted);
}

.modal-title,
.modal-body {
    color: var(--nx-text);
}

.noxstock-error-notifications {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1000;
    display: grid;
    gap: 0.75rem;
    width: min(24rem, calc(100vw - 2rem));
}

.noxstock-error-notification {
    position: relative;
    display: grid;
    gap: 0.25rem;
    padding: 1rem 2.75rem 1rem 1rem;
    border: 1px solid #fca5a5;
    border-radius: 0.5rem;
    background: #fff1f2;
    color: #991b1b;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
    font-size: 0.875rem;
}

html.dark .noxstock-error-notification {
    border-color: #7f1d1d;
    background: #32151a;
    color: #fecaca;
}

.noxstock-error-notification span,
.noxstock-error-close {
    color: inherit;
}

.noxstock-error-close {
    position: absolute;
    top: 0.5rem;
    right: 0.65rem;
    border: 0;
    background: transparent;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

html.dark .bg-white {
    background-color: var(--nx-surface) !important;
}

html.dark .bg-slate-50 {
    background-color: var(--nx-surface-muted) !important;
}

html.dark .text-slate-500,
html.dark .text-slate-600 {
    color: var(--nx-text-muted);
}

html.dark .auth-shell .text-slate-900,
html.dark .auth-shell .text-slate-700 {
    color: var(--nx-text);
}

html.dark .auth-shell .text-slate-500,
html.dark .auth-shell .text-slate-600 {
    color: var(--nx-text-muted);
}

html.dark .auth-shell .border-slate-200,
html.dark .auth-shell .border-slate-200\/60 {
    border-color: var(--nx-border) !important;
}

html.dark .border-slate-100,
html.dark .border-slate-200 {
    border-color: var(--nx-border) !important;
}

/* Customer, supplier and direct-settlement modals */
.business-partner-modal .modal-content {
    border: 0;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .22);
}

.business-partner-modal .modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(135deg, #f5f3ff, #fff);
}

.business-partner-modal .modal-body { padding: 1.35rem 1.5rem; }
.business-partner-modal .modal-footer { padding: 1rem 1.5rem; border-top: 1px solid #e5e7eb; background: #fafcff; }
.partner-form-intro { padding: .9rem 1rem; margin-bottom: 1rem; border: 1px solid #ddd6fe; border-radius: 12px; background: #f5f3ff; color: #4c1d95; }
.partner-form-intro strong { display: block; font-size: .9rem; }
.partner-form-intro span { display: block; margin-top: .2rem; color: #6d5aa4; font-size: .8rem; }
.partner-form-section { padding: 1rem; margin-bottom: .85rem; border: 1px solid #e2e8f0; border-radius: 13px; background: #fff; }
.partner-form-section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .8rem; }
.partner-form-section-heading strong { color: #172554; font-size: .88rem; }
.partner-form-section-heading span { color: #64748b; font-size: .75rem; text-align: right; }
.partner-form-section .mb-3:last-child { margin-bottom: 0 !important; }
.partner-limit-note { margin-top: .6rem; color: #64748b; font-size: .75rem; }

html.dark .partner-form-section { border-color: var(--nx-border); background: var(--nx-surface); }
html.dark .partner-form-section-heading strong { color: var(--nx-text); }

/* Production pricing surfaces */
.product-pricing-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .55rem;
    margin-bottom: .75rem;
}
.product-pricing-metrics-top { margin-bottom: .85rem; }

.product-pricing-metrics article {
    min-width: 0;
    padding: .7rem;
    border: 1px solid var(--nx-border);
    border-radius: .55rem;
    background: linear-gradient(145deg, var(--nx-surface), var(--nx-surface-muted));
}

.product-pricing-metrics span { display: block; color: var(--nx-text-muted); font-size: .65rem; font-weight: 700; }
.product-pricing-metrics strong { display: block; margin-top: .2rem; overflow-wrap: anywhere; color: var(--nx-text-strong); font-size: .82rem; line-height: 1.25; }
.product-pricing-metric-wide { grid-column: span 2; }
.product-history-scroll { overflow-x: auto; border: 1px solid var(--nx-border); border-radius: .55rem; }
.product-history-table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: .7rem; }
.product-history-table th, .product-history-table td { padding: .65rem; border-bottom: 1px solid var(--nx-border); text-align: left; vertical-align: top; }
.product-history-table th { background: var(--nx-surface-muted); color: var(--nx-text-muted); font-size: .62rem; text-transform: uppercase; }
.product-history-table td { color: var(--nx-text); }
.product-history-table td strong, .product-history-table td small { display: block; }
.product-history-table td small { margin-top: .15rem; color: var(--nx-text-muted); }
.product-history-empty, .product-history-footnote { padding: .8rem; color: var(--nx-text-muted); font-size: .7rem; }
.product-finance-profit [data-dialog-value="target-warning"] { margin: .4rem 0 0; padding-top: .4rem; border-top: 1px solid #fcd34d; color: #92400e; font-size: .65rem; font-weight: 800; }
.products-table-pricing-note { margin: 0; color: var(--nx-text-muted); font-size: .7rem; }
.product-profit-value { color: #047857; font-weight: 800; }
.product-profit-value.is-loss { color: #b91c1c; }
.product-status-list { display: flex; flex-wrap: wrap; gap: .3rem; }
.product-status-pill { display: inline-flex; padding: .25rem .45rem; border-radius: 999px; background: #eef2ff; color: #4338ca; font-size: .62rem; font-weight: 800; }
.product-status-pill.is-manual { background: #f1f5f9; color: #475569; }
.product-status-pill.is-warning { background: #fef3c7; color: #92400e; }
.product-status-pill.is-muted { background: #f8fafc; color: #64748b; border: 1px solid var(--nx-border); }
.pos-profit-preview { display: grid; gap: .2rem; margin-top: .55rem; padding: .55rem; border: 1px solid #bbf7d0; border-radius: .5rem; background: #f0fdf4; color: #166534; font-size: .68rem; }
.pos-profit-preview.hidden { display: none; }
.pos-profit-preview span, .pos-profit-preview b { display: block; }
.pos-profit-preview.is-loss { border-color: #fca5a5; background: #fff1f2; color: #b91c1c; }
.pos-product-card-shelf { margin-top: .2rem; color: #475569; font-size: .68rem; font-weight: 700; }
.quick-customer-modal .modal-content { border: 0; border-radius: .85rem; box-shadow: 0 1.5rem 4rem rgb(15 23 42 / .22); }
.quick-customer-modal .modal-body { padding: 1.25rem 1.5rem; }
html.dark .pos-product-card-shelf { color: #cbd5e1; }

html.dark .product-status-pill.is-manual,
html.dark .product-status-pill.is-muted { background: #1e293b; color: #cbd5e1; }
html.dark .product-status-pill.is-warning { background: rgb(120 53 15 / .55); color: #fde68a; }
html.dark .pos-profit-preview { border-color: #166534; background: rgb(20 83 45 / .28); color: #bbf7d0; }
html.dark .pos-profit-preview.is-loss { border-color: #991b1b; background: rgb(127 29 29 / .3); color: #fecaca; }

@media (max-width: 767px) {
    .product-pricing-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .product-pricing-metric-wide { grid-column: 1 / -1; }
}

@media (max-width: 420px) {
    .product-pricing-metrics { grid-template-columns: 1fr; }
    .product-pricing-metric-wide { grid-column: auto; }
}

@media (min-width: 640px) {
    .app-main {
        padding: 1rem 1.25rem 1.25rem;
    }
}

@media (min-width: 1024px) {
    .app-main {
        padding: 1rem 1.5rem 1.5rem;
    }

    .app-sidebar {
        width: 16rem !important;
    }

    .app-sidebar .sidebar-nav {
        margin-top: 1.25rem;
    }
}

@media (max-width: 460px) {
    .pos-cart-header { align-items: flex-start; flex-direction: column; }
    .pos-cart-header-actions { width: 100%; }
    .pos-refresh-prices { flex: 1; justify-content: center; }
}

@media (max-width: 639px) {
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        float: none;
        text-align: left;
    }

    .dataTables_wrapper .dataTables_paginate {
        margin-top: 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
