/* Tijarah theme — CSS variables switch with MudBlazor dark mode */

:root {
    --tj-ink: #1c1917;
    --tj-muted: #78716c;
    --tj-faint: #a8a29e;
    --tj-brand: #047857;
    --tj-brand-soft: #ecfdf5;
    --tj-brand-text: #047857;
    --tj-surface: #ffffff;
    --tj-canvas: #fafaf9;
    --tj-border: #e7e5e4;
    --tj-hover: #f5f5f4;
    --tj-table-head: #fafaf9;
    --tj-font-base: 15px;
    color-scheme: light;
}

/* Dark mode variables — apply on html so body/layout gaps inherit correctly */
html:has(.mud-theme-dark) {
    --tj-ink: #fafaf9;
    --tj-muted: #a8a29e;
    --tj-faint: #78716b;
    --tj-brand: #34d399;
    --tj-brand-soft: rgba(52, 211, 153, 0.12);
    --tj-brand-text: #6ee7b7;
    --tj-surface: #1c1917;
    --tj-canvas: #0c0a09;
    --tj-border: #292524;
    --tj-hover: #292524;
    --tj-table-head: #141110;
    color-scheme: dark;
}

/* Keep in sync for descendants inside the app root wrapper */
.mud-theme-dark {
    --tj-ink: #fafaf9;
    --tj-muted: #a8a29e;
    --tj-faint: #78716b;
    --tj-brand: #34d399;
    --tj-brand-soft: rgba(52, 211, 153, 0.12);
    --tj-brand-text: #6ee7b7;
    --tj-surface: #1c1917;
    --tj-canvas: #0c0a09;
    --tj-border: #292524;
    --tj-hover: #292524;
    --tj-table-head: #141110;
    color-scheme: dark;
}

.tj-app-root {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

html:has(.mud-theme-dark),
html:has(.mud-theme-dark) body {
    background-color: var(--tj-canvas) !important;
    color: var(--tj-ink);
}

.mud-theme-dark.tj-app-root {
    background-color: var(--tj-canvas);
    color: var(--tj-ink);
    flex: 1;
}

html, body {
    font-family: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
    font-size: var(--tj-font-base);
    color: var(--tj-ink);
    background: var(--tj-canvas);
    -webkit-font-smoothing: antialiased;
}

.tj-loading-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: var(--tj-canvas);
}

/* ─── MudLayout dark fixes ─── */
.mud-theme-dark .tj-layout,
.mud-theme-dark .mud-layout {
    background-color: var(--tj-canvas) !important;
    color: var(--tj-ink);
    min-height: 100vh;
    flex: 1;
}

.mud-theme-dark .mud-main-content,
.mud-theme-dark .tj-page-content {
    background-color: var(--tj-canvas) !important;
    color: var(--tj-ink);
    flex: 1;
}

.mud-theme-dark .mud-paper {
    background-color: var(--tj-surface) !important;
    color: var(--tj-ink);
}

.mud-theme-dark .mud-table .mud-table-row {
    background-color: var(--tj-surface);
}

.mud-theme-dark .mud-input-control .mud-input,
.mud-theme-dark .mud-input-slot {
    color: var(--tj-ink);
}

/* ─── Drawer ─── */
.tj-drawer.mud-drawer {
    overflow: hidden;
    border-right: 1px solid var(--tj-border) !important;
    box-shadow: none !important;
    background-color: var(--tj-surface) !important;
    color: var(--tj-ink);
}

.mud-theme-dark .tj-drawer.mud-drawer,
.mud-theme-dark .tj-drawer .mud-drawer-content {
    background-color: var(--tj-surface) !important;
    border-right-color: var(--tj-border) !important;
}

.tj-drawer .mud-drawer-content {
    overflow-x: hidden !important;
    overflow-y: auto;
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    background-color: var(--tj-surface);
    min-height: 100vh;
}

.tj-drawer-inner {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 100%;
    overflow-x: hidden;
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--tj-surface);
}

.tj-drawer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 16px 16px;
    min-width: 0;
    flex-shrink: 0;
}

.tj-drawer-brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--tj-brand);
    color: #052e16;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.mud-theme-dark .tj-drawer-brand-mark {
    color: #052e16;
}

.tj-drawer-brand-text {
    min-width: 0;
    overflow: hidden;
}

.tj-drawer-brand-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--tj-ink);
    letter-spacing: -0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tj-drawer-brand-tag {
    font-size: 0.75rem;
    color: var(--tj-faint);
    font-weight: 500;
}

/* ─── Nav ─── */
.tj-nav-menu {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
    padding: 0 8px 12px;
    flex: 1;
}

.tj-nav-menu .mud-nav-link {
    border-radius: 8px !important;
    margin: 1px 0 !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    min-height: 38px !important;
    max-width: 100%;
    box-sizing: border-box;
    color: var(--tj-muted) !important;
}

.tj-nav-menu .mud-nav-link .mud-nav-link-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tj-nav-menu .mud-nav-link.active {
    background: var(--tj-brand-soft) !important;
    color: var(--tj-brand-text) !important;
    font-weight: 600 !important;
}

.tj-nav-menu .mud-nav-link.active .mud-nav-link-icon {
    color: var(--tj-brand) !important;
}

.tj-nav-menu .mud-nav-link:hover:not(.active) {
    background: var(--tj-hover) !important;
    color: var(--tj-ink) !important;
}

.tj-nav-menu .mud-nav-group {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.tj-nav-menu .mud-nav-group > .mud-nav-link {
    padding-left: 10px !important;
    font-size: 0.6875rem !important;
    font-weight: 600 !important;
    color: var(--tj-faint) !important;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    min-height: 28px !important;
}

.tj-nav-menu .mud-nav-group .mud-nav-group-items {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.tj-nav-menu .mud-nav-group .mud-nav-link {
    padding-left: 34px !important;
}

.tj-nav-signout {
    margin: 4px 0 8px !important;
    color: #dc2626 !important;
}

.mud-theme-dark .tj-nav-signout {
    color: #f87171 !important;
}

.tj-nav-signout:hover {
    background: rgba(220, 38, 38, 0.08) !important;
}

.tj-nav-divider {
    margin: 8px 0 !important;
    border-color: var(--tj-border) !important;
}

/* ─── App bar ─── */
.tj-appbar {
    background: var(--tj-surface) !important;
    border-bottom: 1px solid var(--tj-border) !important;
    color: var(--tj-ink) !important;
    padding: 10px 20px !important;
    gap: 12px;
}

.tj-appbar .mud-toolbar {
    padding-left: 0 !important;
    padding-right: 0 !important;
    gap: 12px;
}

.tj-appbar-user {
    cursor: pointer;
    color: var(--tj-ink);
    font-size: 0.875rem;
    font-weight: 500;
}

.tj-company-select {
    max-width: 240px;
    min-width: 180px;
    margin-left: 4px;
}

.tj-page-content {
    min-height: 100vh;
    background: var(--tj-canvas);
}

/* ─── Page header ─── */
.tj-page-header {
    margin-bottom: 1.25rem;
}

.tj-page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--tj-ink);
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.tj-page-subtitle {
    font-size: 0.875rem;
    color: var(--tj-muted);
    margin-top: 4px;
}

.tj-panel {
    background: var(--tj-surface);
    border: 1px solid var(--tj-border);
    border-radius: 10px;
    overflow: hidden;
    padding: 16px 20px;
}

/* MudTabs that are the panel itself (e.g. Products) already pad via PanelClass */
.mud-tabs.tj-panel {
    padding: 0;
}

/* Tabs nested in a panel: bleed to the card edge; tab panels keep their own padding */
.tj-panel > .mud-tabs,
.tj-panel > .tj-panel-tabs {
    margin: -16px -20px;
    width: calc(100% + 40px);
    max-width: none;
}

.tj-panel-tabs {
    background: transparent;
}

.tj-panel-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--tj-border);
}

/* Toolbars stay flush to the card edge; body content keeps panel padding */
.tj-panel > .tj-panel-toolbar {
    margin: -16px -20px 16px;
}

/* ─── Tables ─── */
.tj-money,
td[data-label*="Amount"],
td[data-label*="Balance"],
td[data-label*="Cost"],
td[data-label*="Price"],
td[data-label*="Total"] {
    font-variant-numeric: tabular-nums;
}

.tj-data-table .mud-table-head .mud-table-cell {
    background: var(--tj-table-head) !important;
    color: var(--tj-muted) !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--tj-border) !important;
}

.tj-data-table .mud-table-body .mud-table-row:hover {
    background: var(--tj-hover) !important;
}

.tj-data-table .mud-table-body .mud-table-cell {
    font-size: 0.875rem !important;
    border-bottom: 1px solid var(--tj-border) !important;
    color: var(--tj-ink);
}

/* Native HTML tables used by ReportView / print documents */
table.tj-data-table,
.tj-report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    color: var(--tj-ink);
}

.tj-report-table th,
.tj-report-table td {
    border: 1px solid var(--tj-border);
    padding: 8px 12px;
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
}

.tj-report-table thead th {
    background: var(--tj-table-head);
    color: var(--tj-muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.tj-report-table tbody tr:nth-child(even) {
    background: var(--tj-hover);
}

.tj-report-table tbody tr:hover {
    background: var(--tj-brand-soft);
}

.tj-report-table tfoot td {
    background: var(--tj-table-head);
    border-top: 2px solid var(--tj-border);
    font-weight: 600;
}

.tj-report-table td[data-label*="Amount"],
.tj-report-table td[data-label*="Balance"],
.tj-report-table td[data-label*="Cost"],
.tj-report-table td[data-label*="Price"],
.tj-report-table td[data-label*="Total"],
.tj-report-table td[data-label*="Qty"],
.tj-report-table td[data-label*="Quantity"],
.tj-report-table td[data-label*="Transactions"],
.tj-report-table th[data-align="end"],
.tj-report-table td[data-align="end"] {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.tj-report-panel {
    padding: 16px 20px;
    overflow-x: auto;
}

/* ─── Dashboard cards ─── */
.tj-dash-card {
    background: var(--tj-surface);
    border: 1px solid var(--tj-border);
    border-radius: 10px;
    padding: 20px;
    height: 100%;
    transition: border-color 0.15s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.tj-dash-card:hover {
    border-color: var(--tj-brand);
}

.tj-dash-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--tj-brand-soft);
    color: var(--tj-brand);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.tj-dash-card-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--tj-ink);
}

.tj-dash-card-desc {
    font-size: 0.8125rem;
    color: var(--tj-muted);
    margin-top: 4px;
}

.tj-kpi-card {
    background: var(--tj-surface);
    border: 1px solid var(--tj-border);
    border-radius: 10px;
    padding: 16px;
    height: 100%;
}

.tj-kpi-label {
    font-size: 0.75rem;
    color: var(--tj-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.tj-kpi-value {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--tj-ink);
    margin-top: 4px;
}

.tj-kpi-meta {
    font-size: 0.75rem;
    color: var(--tj-muted);
    margin-top: 6px;
}

.tj-kpi-meta a {
    color: var(--tj-brand);
    text-decoration: none;
}

.tj-section-title {
    font-weight: 600;
    color: var(--tj-ink);
}

/* ─── Auth ─── */
.tj-auth-page {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--tj-canvas);
    padding: 24px;
}

.tj-auth-theme-toggle {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 1;
}

.tj-coming-soon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px 24px;
    text-align: center;
}

    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 1;
}

.tj-auth-card {
    width: 100%;
    max-width: 400px;
    border-radius: 12px !important;
    border: 1px solid var(--tj-border) !important;
    background: var(--tj-surface) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06) !important;
}

.mud-theme-dark .tj-auth-card {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35) !important;
}

.tj-auth-card-inner {
    padding: 36px 32px 32px !important;
}

.tj-auth-mark {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--tj-brand);
    color: #052e16;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.tj-auth-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--tj-ink);
    letter-spacing: -0.025em;
}

.tj-auth-subtitle {
    font-size: 0.875rem;
    color: var(--tj-muted);
    margin-bottom: 28px;
    margin-top: 4px;
}

/* ─── POS ─── */
.tj-pos-cart-area {
    background: var(--tj-canvas);
    border-right: 1px solid var(--tj-border);
}

.tj-pos-search-bar {
    background: var(--tj-surface);
    border-bottom: 1px solid var(--tj-border);
    padding: 12px 16px;
}

.tj-pos-checkout-panel {
    background: var(--tj-surface);
    border-top: 1px solid var(--tj-border);
}

.tj-pos-total {
    font-size: 1.75rem !important;
    font-weight: 700 !important;
    font-variant-numeric: tabular-nums;
    color: var(--tj-ink) !important;
}

.tj-pos-products-area {
    background: var(--tj-surface);
}

.tj-pos-product-card {
    width: 124px;
    border: 1px solid var(--tj-border) !important;
    border-radius: 10px !important;
    cursor: pointer;
    background: var(--tj-surface) !important;
}

.tj-pos-product-card:hover {
    border-color: var(--tj-brand) !important;
}

.tj-pos-cart-row-selected {
    background-color: rgba(37, 99, 235, 0.08) !important;
}

.mud-theme-dark .tj-pos-cart-row-selected {
    background-color: rgba(96, 165, 250, 0.12) !important;
}

/* ─── POS v2 (keyboard-first sell screen) ─── */
.tj-pos-v2 {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: var(--tj-canvas);
    overflow: hidden;
}

.tj-pos-v2-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: var(--tj-surface);
    border-bottom: 1px solid var(--tj-border);
    min-height: 52px;
    flex-shrink: 0;
}

.tj-pos-v2-header-left,
.tj-pos-v2-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.tj-pos-v2-header-center {
    flex: 1;
    display: flex;
    align-items: center;
    min-width: 0;
    max-width: 520px;
    margin: 0 auto;
}

.tj-pos-v2-title {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.tj-pos-v2-title-main {
    font-weight: 700;
    font-size: 1rem;
    color: var(--tj-ink);
}

.tj-pos-v2-title-sub {
    font-size: 0.7rem;
    color: var(--tj-muted);
}

.tj-pos-customer-field {
    flex: 1;
    min-width: 0;
}

.tj-pos-customer-option {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.tj-pos-customer-name {
    font-weight: 600;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tj-pos-customer-phone {
    font-size: 0.75rem;
    color: var(--tj-muted);
}

.tj-pos-customer-bal {
    font-size: 0.75rem;
    font-weight: 600;
}

.tj-pos-session-select {
    min-width: 130px;
    max-width: 180px;
}

.tj-pos-v2-body {
    display: grid;
    grid-template-columns: 1fr minmax(300px, 36%);
    flex: 1;
    min-height: 0;
}

.tj-pos-v2-cart-pane {
    display: flex;
    flex-direction: column;
    min-width: 0;
    border-right: 1px solid var(--tj-border);
}

.tj-pos-v2-scan-bar {
    padding: 12px 16px;
    background: var(--tj-surface);
    border-bottom: 1px solid var(--tj-border);
}

.tj-pos-scan-input input {
    font-size: 1.05rem !important;
    font-weight: 500;
}

.tj-pos-scan-hint {
    margin-top: 6px;
    color: var(--tj-muted);
}

.tj-pos-v2-cart-scroll {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.tj-pos-cart-table {
    height: 100%;
}

.tj-pos-item-name {
    font-weight: 500;
}

.tj-pos-item-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    background: rgba(37, 99, 235, 0.1);
    color: var(--tj-brand);
}

.tj-pos-disc {
    color: #dc2626;
}

.tj-pos-line-total {
    font-weight: 600;
}

.tj-pos-v2-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 8px;
    color: var(--tj-muted);
    padding: 2rem;
}

.tj-pos-v2-empty-icon {
    font-size: 4rem !important;
    opacity: 0.35;
}

.tj-pos-booker-banner {
    margin: 8px 12px 0;
    flex-shrink: 0;
}

.tj-pos-booker-banner-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
}

.tj-pos-parked-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 4px 0;
    cursor: pointer;
}

.tj-pos-parked-list .mud-list-item {
    border-bottom: 1px solid var(--tj-border);
}

.tj-pos-parked-list .mud-list-item:hover {
    background: color-mix(in srgb, var(--mud-palette-primary) 8%, transparent);
}

.tj-pos-parked-item-body {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.tj-pos-parked-item-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
}

.tj-pos-parked-row {
    padding-top: 8px;
    padding-bottom: 8px;
}

/* Parked orders page */
.tj-parked-page {
    min-height: 100vh;
    padding: 12px 16px 24px;
    background: var(--tj-canvas);
}

.tj-parked-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.tj-parked-header-left {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.tj-parked-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
}

.tj-parked-sub {
    font-size: 0.8rem;
    color: var(--tj-muted);
}

.tj-parked-session-bar {
    margin-bottom: 16px;
}

.tj-parked-order-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 10px;
    background: var(--tj-surface);
    border: 1px solid var(--tj-border);
    border-radius: 12px;
}

.tj-parked-order-ref {
    font-weight: 700;
    font-size: 0.95rem;
}

.tj-parked-order-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

.tj-parked-amount {
    font-weight: 700;
    font-size: 1.05rem;
}

.tj-parked-commit-btn {
    min-height: 44px !important;
    min-width: 110px;
}

.tj-parked-empty {
    text-align: center;
    padding: 48px 16px;
    color: var(--tj-muted);
}

.tj-parked-count {
    color: var(--tj-muted);
}

.tj-pos-v2-side-pane {
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: var(--tj-surface);
}

.tj-pos-v2-products {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid var(--tj-border);
}

.tj-pos-v2-section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px 6px;
}

.tj-pos-v2-product-list {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    padding: 0 8px 8px;
}

.tj-pos-product-table {
    height: 100%;
}

.tj-pos-product-highlight {
    background-color: rgba(37, 99, 235, 0.1) !important;
}

.tj-pos-product-oos {
    opacity: 0.45;
}

.tj-pos-oos {
    color: var(--tj-muted);
    text-decoration: line-through;
}

.tj-pos-low-stock {
    color: #d97706;
    font-weight: 600;
}

.tj-pos-v2-totals {
    padding: 12px 14px 14px;
    flex-shrink: 0;
}

.tj-pos-v2-customer-strip {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    padding: 6px 10px;
    margin-bottom: 10px;
    border-radius: 6px;
    background: var(--tj-canvas);
    border: 1px solid var(--tj-border);
}

.tj-pos-v2-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: var(--tj-muted);
    margin-bottom: 6px;
}

.tj-pos-v2-total-row.tj-pos-v2-disc {
    color: #dc2626;
}

.tj-pos-cart-disc {
    width: 96px;
}

.tj-pos-cart-disc input {
    text-align: right;
}

.tj-pos-v2-grand-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin: 12px 0 14px;
    padding-top: 10px;
    border-top: 2px solid var(--tj-border);
}

.tj-pos-v2-grand-total > span:first-child {
    font-size: 1rem;
    font-weight: 600;
    color: var(--tj-ink);
}

.tj-pos-v2-grand-amount {
    font-size: 2rem !important;
    font-weight: 800 !important;
    line-height: 1;
    color: var(--tj-ink) !important;
}

.tj-pos-v2-pay-methods {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
    margin-bottom: 10px;
}

.tj-pos-payment-dialog .tj-pos-payment-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 16px;
    padding: 12px;
    border-radius: 8px;
    background: var(--tj-hover);
}

.tj-pos-payment-dialog .tj-pos-payment-total strong {
    font-size: 1.25rem;
}

.tj-pos-pay-btn {
    font-size: 0.75rem !important;
    min-height: 36px;
}

.tj-pos-pay-active {
    font-size: 0.75rem !important;
    min-height: 36px;
    border-color: var(--tj-brand) !important;
    background: rgba(37, 99, 235, 0.08) !important;
    font-weight: 600 !important;
}

.tj-pos-v2-checkout-btn {
    height: 48px !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
}

.tj-pos-v2-actions-row {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.tj-pos-v2-shortcuts {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    align-items: center;
    padding: 6px 16px;
    font-size: 0.72rem;
    color: var(--tj-muted);
    background: var(--tj-surface);
    border-top: 1px solid var(--tj-border);
    flex-shrink: 0;
}

.tj-pos-v2-shortcuts kbd {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--tj-border);
    background: var(--tj-canvas);
    font-family: inherit;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--tj-ink);
    margin-right: 4px;
}

.tj-pos-customer-picker-list {
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid var(--tj-border);
    border-radius: 8px;
}

.tj-pos-picker-selected {
    background: rgba(37, 99, 235, 0.1) !important;
}

@media (max-width: 960px) {
    .tj-pos-v2-body {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr auto;
    }

    .tj-pos-v2-side-pane {
        max-height: 42vh;
    }

    .tj-pos-v2-header-center {
        display: none;
    }
}

.tj-pos-cart-row-selected {
    background-color: rgba(37, 99, 235, 0.08) !important;
}

.mud-theme-dark .tj-pos-cart-row-selected {
    background-color: rgba(96, 165, 250, 0.12) !important;
}

/* ─── POS v2 (keyboard-first sell screen) ─── */
.tj-pos-v2 {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: var(--tj-canvas);
    overflow: hidden;
}

.tj-pos-v2-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: var(--tj-surface);
    border-bottom: 1px solid var(--tj-border);
    min-height: 52px;
    flex-shrink: 0;
}

.tj-pos-v2-header-left,
.tj-pos-v2-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.tj-pos-v2-header-center {
    flex: 1;
    display: flex;
    align-items: center;
    min-width: 0;
    max-width: 520px;
    margin: 0 auto;
}

.tj-pos-v2-title {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.tj-pos-v2-title-main {
    font-weight: 700;
    font-size: 1rem;
    color: var(--tj-ink);
}

.tj-pos-v2-title-sub {
    font-size: 0.7rem;
    color: var(--tj-muted);
}

.tj-pos-customer-field {
    flex: 1;
    min-width: 0;
}

.tj-pos-customer-option {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.tj-pos-customer-name {
    font-weight: 600;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tj-pos-customer-phone {
    font-size: 0.75rem;
    color: var(--tj-muted);
}

.tj-pos-customer-bal {
    font-size: 0.75rem;
    font-weight: 600;
}

.tj-pos-session-select {
    min-width: 130px;
    max-width: 180px;
}

.tj-pos-v2-body {
    display: grid;
    grid-template-columns: 1fr minmax(300px, 36%);
    flex: 1;
    min-height: 0;
}

.tj-pos-v2-cart-pane {
    display: flex;
    flex-direction: column;
    min-width: 0;
    border-right: 1px solid var(--tj-border);
}

.tj-pos-v2-scan-bar {
    padding: 12px 16px;
    background: var(--tj-surface);
    border-bottom: 1px solid var(--tj-border);
}

.tj-pos-scan-input input {
    font-size: 1.05rem !important;
    font-weight: 500;
}

.tj-pos-scan-hint {
    margin-top: 6px;
    color: var(--tj-muted);
}

.tj-pos-v2-cart-scroll {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.tj-pos-cart-table {
    height: 100%;
}

.tj-pos-item-name {
    font-weight: 500;
}

.tj-pos-item-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    background: rgba(37, 99, 235, 0.1);
    color: var(--tj-brand);
}

.tj-pos-disc {
    color: #dc2626;
}

.tj-pos-line-total {
    font-weight: 600;
}

.tj-pos-v2-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 8px;
    color: var(--tj-muted);
    padding: 2rem;
}

.tj-pos-v2-empty-icon {
    font-size: 4rem !important;
    opacity: 0.35;
}

.tj-pos-booker-banner {
    margin: 8px 12px 0;
    flex-shrink: 0;
}

.tj-pos-booker-banner-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
}

.tj-pos-parked-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 4px 0;
    cursor: pointer;
}

.tj-pos-parked-list .mud-list-item {
    border-bottom: 1px solid var(--tj-border);
}

.tj-pos-parked-list .mud-list-item:hover {
    background: color-mix(in srgb, var(--mud-palette-primary) 8%, transparent);
}

.tj-pos-parked-item-body {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.tj-pos-parked-item-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
}

.tj-pos-parked-row {
    padding-top: 8px;
    padding-bottom: 8px;
}

/* Parked orders page */
.tj-parked-page {
    min-height: 100vh;
    padding: 12px 16px 24px;
    background: var(--tj-canvas);
}

.tj-parked-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.tj-parked-header-left {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.tj-parked-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
}

.tj-parked-sub {
    font-size: 0.8rem;
    color: var(--tj-muted);
}

.tj-parked-session-bar {
    margin-bottom: 16px;
}

.tj-parked-order-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 10px;
    background: var(--tj-surface);
    border: 1px solid var(--tj-border);
    border-radius: 12px;
}

.tj-parked-order-ref {
    font-weight: 700;
    font-size: 0.95rem;
}

.tj-parked-order-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

.tj-parked-amount {
    font-weight: 700;
    font-size: 1.05rem;
}

.tj-parked-commit-btn {
    min-height: 44px !important;
    min-width: 110px;
}

.tj-parked-empty {
    text-align: center;
    padding: 48px 16px;
    color: var(--tj-muted);
}

.tj-parked-count {
    color: var(--tj-muted);
}

.tj-pos-v2-side-pane {
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: var(--tj-surface);
}

.tj-pos-v2-products {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid var(--tj-border);
}

.tj-pos-v2-section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px 6px;
}

.tj-pos-v2-product-list {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    padding: 0 8px 8px;
}

.tj-pos-product-table {
    height: 100%;
}

.tj-pos-product-highlight {
    background-color: rgba(37, 99, 235, 0.1) !important;
}

.tj-pos-product-oos {
    opacity: 0.45;
}

.tj-pos-oos {
    color: var(--tj-muted);
    text-decoration: line-through;
}

.tj-pos-low-stock {
    color: #d97706;
    font-weight: 600;
}

.tj-pos-v2-totals {
    padding: 12px 14px 14px;
    flex-shrink: 0;
}

.tj-pos-v2-customer-strip {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    padding: 6px 10px;
    margin-bottom: 10px;
    border-radius: 6px;
    background: var(--tj-canvas);
    border: 1px solid var(--tj-border);
}

.tj-pos-v2-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: var(--tj-muted);
    margin-bottom: 6px;
}

.tj-pos-v2-total-row.tj-pos-v2-disc {
    color: #dc2626;
}

.tj-pos-cart-disc {
    width: 96px;
}

.tj-pos-cart-disc input {
    text-align: right;
}

.tj-pos-v2-grand-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin: 12px 0 14px;
    padding-top: 10px;
    border-top: 2px solid var(--tj-border);
}

.tj-pos-v2-grand-total > span:first-child {
    font-size: 1rem;
    font-weight: 600;
    color: var(--tj-ink);
}

.tj-pos-v2-grand-amount {
    font-size: 2rem !important;
    font-weight: 800 !important;
    line-height: 1;
    color: var(--tj-ink) !important;
}

.tj-pos-v2-pay-methods {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
    margin-bottom: 10px;
}

.tj-pos-payment-dialog .tj-pos-payment-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 16px;
    padding: 12px;
    border-radius: 8px;
    background: var(--tj-hover);
}

.tj-pos-payment-dialog .tj-pos-payment-total strong {
    font-size: 1.25rem;
}

.tj-pos-pay-btn {
    font-size: 0.75rem !important;
    min-height: 36px;
}

.tj-pos-pay-active {
    font-size: 0.75rem !important;
    min-height: 36px;
    border-color: var(--tj-brand) !important;
    background: rgba(37, 99, 235, 0.08) !important;
    font-weight: 600 !important;
}

.tj-pos-v2-checkout-btn {
    height: 48px !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
}

.tj-pos-v2-actions-row {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.tj-pos-v2-shortcuts {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    align-items: center;
    padding: 6px 16px;
    font-size: 0.72rem;
    color: var(--tj-muted);
    background: var(--tj-surface);
    border-top: 1px solid var(--tj-border);
    flex-shrink: 0;
}

.tj-pos-v2-shortcuts kbd {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--tj-border);
    background: var(--tj-canvas);
    font-family: inherit;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--tj-ink);
    margin-right: 4px;
}

.tj-pos-customer-picker-list {
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid var(--tj-border);
    border-radius: 8px;
}

.tj-pos-picker-selected {
    background: rgba(37, 99, 235, 0.1) !important;
}

@media (max-width: 960px) {
    .tj-pos-v2-body {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr auto;
    }

    .tj-pos-v2-side-pane {
        max-height: 42vh;
    }

    .tj-pos-v2-header-center {
        display: none;
    }
}

/* ─── User menu ─── */
.user-dropdown-popover .mud-popover-paper {
    border-radius: 10px !important;
    border: 1px solid var(--tj-border) !important;
    background: var(--tj-surface) !important;
    min-width: 260px !important;
    overflow: hidden;
}

.user-dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--tj-canvas);
    border-bottom: 1px solid var(--tj-border);
}

.user-dropdown-name {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--tj-ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-dropdown-email {
    font-size: 0.8125rem;
    color: var(--tj-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-role-chip {
    font-size: 0.6875rem;
    padding: 2px 7px;
    border-radius: 4px;
    background: var(--tj-hover);
    color: var(--tj-muted);
    font-weight: 500;
}

/* POS receipt — legacy Mart_FBR layout (thermal 80mm default, optional A4) */
.tj-receipt {
    margin: 0 auto;
    font-family: "Courier New", Courier, ui-monospace, monospace;
    font-size: 12px;
    line-height: 1.35;
    color: #000;
    background: #fff;
}

.tj-receipt--thermal {
    width: 280px;
    max-width: 100%;
}

.tj-receipt--a4 {
    width: 100%;
    max-width: 720px;
    font-size: 13px;
    padding: 8px 0;
}

.tj-receipt-logo,
.tj-receipt-business {
    text-align: center;
    font-weight: 700;
}

.tj-receipt-business {
    font-size: 14px;
    margin-top: 4px;
}

.tj-receipt-address,
.tj-receipt-strn {
    text-align: center;
    font-size: 11px;
}

.tj-receipt-rule {
    border-top: 1px dashed #333;
    margin: 8px 0;
}

.tj-receipt-field {
    margin-bottom: 2px;
}

.tj-receipt-lines {
    width: 100%;
    border-collapse: collapse;
}

.tj-receipt-lines td {
    padding: 2px 0;
    vertical-align: top;
}

.tj-receipt-item {
    width: auto;
    padding-right: 8px !important;
}

.tj-receipt-qty {
    width: 28px;
    text-align: center !important;
    white-space: nowrap;
}

.tj-receipt-money {
    width: 72px;
    text-align: right !important;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.tj-receipt-totals {
    margin-top: 4px;
}

.tj-receipt-total-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 2px;
}

.tj-receipt-grand {
    font-weight: 700;
    font-size: 13px;
    margin-top: 4px;
}

.tj-receipt-footer {
    text-align: center;
    margin-top: 8px;
    font-weight: 600;
}

/* Full-page documents (GRN, load sheets, reports) */
.tj-print-a4 {
    width: 100%;
    max-width: 100%;
}

.tj-print-a4.tj-print-document {
    font-size: 12px;
}

/* POS receipt — legacy Mart_FBR layout (thermal 80mm default, optional A4) */
.tj-receipt {
    margin: 0 auto;
    font-family: "Courier New", Courier, ui-monospace, monospace;
    font-size: 12px;
    line-height: 1.35;
    color: #000;
    background: #fff;
}

.tj-receipt--thermal {
    width: 280px;
    max-width: 100%;
}

.tj-receipt--a4 {
    width: 100%;
    max-width: 720px;
    font-size: 13px;
    padding: 8px 0;
}

.tj-receipt-logo,
.tj-receipt-business {
    text-align: center;
    font-weight: 700;
}

.tj-receipt-business {
    font-size: 14px;
    margin-top: 4px;
}

.tj-receipt-address,
.tj-receipt-strn {
    text-align: center;
    font-size: 11px;
}

.tj-receipt-rule {
    border-top: 1px dashed #333;
    margin: 8px 0;
}

.tj-receipt-field {
    margin-bottom: 2px;
}

.tj-receipt-lines {
    width: 100%;
    border-collapse: collapse;
}

.tj-receipt-lines td {
    padding: 2px 0;
    vertical-align: top;
}

.tj-receipt-item {
    width: auto;
    padding-right: 8px !important;
}

.tj-receipt-qty {
    width: 28px;
    text-align: center !important;
    white-space: nowrap;
}

.tj-receipt-money {
    width: 72px;
    text-align: right !important;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.tj-receipt-totals {
    margin-top: 4px;
}

.tj-receipt-total-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 2px;
}

.tj-receipt-grand {
    font-weight: 700;
    font-size: 13px;
    margin-top: 4px;
}

.tj-receipt-footer {
    text-align: center;
    margin-top: 8px;
    font-weight: 600;
}

/* Full-page documents (GRN, load sheets, reports) */
.tj-print-a4 {
    width: 100%;
    max-width: 100%;
}

.tj-print-a4.tj-print-document {
    font-size: 12px;
}

@media print {
    .mud-appbar, .mud-drawer, .tj-panel-toolbar, .mud-button, .no-print, .mud-dialog-actions {
        display: none !important;
    }
    .mud-main-content { padding: 0 !important; }
    body { background: #fff !important; color: #000 !important; }
    .tj-print-area { display: block !important; }
    .tj-print-document {
        padding: 16px;
        font-size: 12px;
        color: #000 !important;
        background: #fff !important;
    }
    .tj-print-a4.tj-print-document {
        width: 100%;
        max-width: 190mm;
    }
    .tj-receipt--thermal.tj-print-document {
        width: 72mm;
        max-width: 72mm;
        padding: 0;
    }
    .tj-receipt--a4.tj-print-document {
        width: 100%;
        max-width: 190mm;
    }
    .tj-print-document table {
        width: 100%;
        border-collapse: collapse;
    }
    .tj-print-document th, .tj-print-document td {
        border: 1px solid #ccc;
        padding: 4px 8px;
        text-align: left;
    }
}
