:root {
    --primary: #0d6efd;
    --primary-dark: #0b5ed7;
    --bg: #f4f7fb;
    --card: #ffffff;
    --text: #172033;
    --muted: #6b7280;
    --border: #e5e7eb;
    --success: #18a058;
    --danger: #dc3545;
    --warning: #f59e0b;
    --info: #2563eb;
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Tahoma, Arial, sans-serif;
    direction: rtl;
    background: var(--bg);
    color: var(--text);
    padding-bottom: 84px;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

.mobile-shell {
    max-width: 520px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg);
    position: relative;
    overflow-x: hidden;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: linear-gradient(135deg, #0d6efd, #0a58ca);
    color: white;
    padding: 16px 18px;
    border-bottom-left-radius: 22px;
    border-bottom-right-radius: 22px;
    box-shadow: 0 8px 24px rgba(13, 110, 253, 0.22);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.topbar-title {
    font-weight: 700;
    font-size: 18px;
}

.topbar-subtitle {
    font-size: 12px;
    opacity: .85;
    margin-top: 4px;
}



.menu-button {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: rgba(255,255,255,.18);
    border: 1px solid rgba(255,255,255,.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 900;
    cursor: pointer;
    flex: 0 0 auto;
}

.side-menu-toggle {
    display: none;
}

.side-menu {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    transform: translateX(105%);
    width: 85vw;
    max-width: 360px;
    height: 100dvh;
    background: #fff;
    z-index: 80;
    box-shadow: -18px 0 38px rgba(15, 23, 42, .22);
    transition: transform .24s ease;
    padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    border-top-left-radius: 24px;
    border-bottom-left-radius: 24px;
}

.side-menu-toggle:checked ~ .side-menu {
    transform: translateX(0);
}

.side-menu-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .38);
    z-index: 70;
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease;
}

.side-menu-toggle:checked ~ .side-menu-backdrop {
    opacity: 1;
    pointer-events: auto;
}

.side-menu-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 14px;
}

.side-menu-title {
    font-size: 20px;
    font-weight: 900;
    color: #111827;
}

.side-menu-subtitle {
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
}

.side-menu-close {
    width: 42px;
    height: 42px;
    border-radius: 15px;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
}

.side-menu-links {
    display: grid;
    gap: 10px;
}

.side-menu-links a {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px;
    font-weight: 800;
    background: #fff;
}

.side-menu-links a.active {
    background: #eff6ff;
    color: var(--primary);
    border-color: #bfdbfe;
}

.side-icon {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
}

.side-logout-form {
    margin-top: auto;
}

.side-logout-btn {
    width: 100%;
    border: 0;
    border-radius: 15px;
    background: #fee2e2;
    color: #991b1b;
    font-family: inherit;
    font-weight: 900;
    padding: 13px;
    cursor: pointer;
}

.content {
    padding: 16px;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .04);
    margin-bottom: 14px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.metric {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: 0 6px 16px rgba(15, 23, 42, .04);
}

.metric .num {
    font-size: 24px;
    color: var(--primary);
    font-weight: bold;
}

.metric .label {
    color: var(--muted);
    font-size: 13px;
    margin-top: 6px;
}

.form-group {
    margin-bottom: 13px;
}

label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 7px;
}

input, select, textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    font-family: inherit;
    font-size: 15px;
    background: #fff;
}

textarea {
    min-height: 92px;
    resize: vertical;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 13px;
    padding: 12px 14px;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
}

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

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

.btn-secondary {
    background: #eef2ff;
    color: #1e40af;
}

.btn-success {
    background: #16a34a;
    color: #fff;
}

.btn-danger {
    background: #dc3545;
    color: #fff;
}

.row-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.badge-received { background: #f3f4f6; color: #374151; }
.badge-washing { background: #dbeafe; color: #1d4ed8; }
.badge-ready { background: #dcfce7; color: #15803d; }
.badge-delivered { background: #111827; color: #fff; }
.badge-cancelled { background: #fee2e2; color: #b91c1c; }
.badge-paid { background: #dcfce7; color: #15803d; }
.badge-partial { background: #fef3c7; color: #92400e; }
.badge-unpaid { background: #fee2e2; color: #b91c1c; }

.list-item {
    display: block;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px;
    margin-bottom: 10px;
}

.list-title {
    font-weight: 800;
    margin-bottom: 4px;
}

.list-meta {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
}

.amount-green { color: var(--success); font-weight: 800; }
.amount-red { color: var(--danger); font-weight: 800; }
.amount-blue { color: var(--primary); font-weight: 800; }

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    max-width: 520px;
    width: 100%;
    background: white;
    border-top: 1px solid var(--border);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 8px 6px 10px;
    z-index: 20;
}

.bottom-nav a {
    text-align: center;
    color: var(--muted);
    font-size: 10px;
    padding: 6px 1px;
}

.bottom-nav .active {
    color: var(--primary);
    font-weight: bold;
}

.alert {
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 12px;
    font-size: 14px;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
}

.error-text {
    color: var(--danger);
    font-size: 12px;
    margin-top: 5px;
}

.search-box {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
}

.search-box .btn {
    width: auto;
    padding-inline: 18px;
}

.filters {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 6px;
    margin-bottom: 10px;
}

.filters a {
    white-space: nowrap;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 8px 12px;
    color: var(--muted);
    font-size: 13px;
}

.filters a.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.table-like-row {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    padding: 10px 0;
    gap: 12px;
}

.table-like-row:last-child {
    border-bottom: 0;
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-logo {
    text-align: center;
    margin-bottom: 24px;
}

.login-logo .icon {
    width: 72px;
    height: 72px;
    border-radius: 24px;
    background: linear-gradient(135deg, #0d6efd, #63a4ff);
    color: white;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
}

.login-logo h1 {
    margin: 0;
    color: #0d47a1;
}


@media (min-width: 521px) {
    .side-menu {
        right: calc((100vw - 520px) / 2);
    }
}

@media (max-width: 420px) {
    .side-menu {
        width: 88vw;
        max-width: none;
        border-top-left-radius: 22px;
        border-bottom-left-radius: 22px;
    }
}

@media (min-width: 700px) {
    body {
        background: #dbeafe;
    }

    .mobile-shell {
        border-left: 1px solid rgba(0,0,0,.08);
        border-right: 1px solid rgba(0,0,0,.08);
    }
}


.sale-product-row {
    display: grid;
    grid-template-columns: 1fr 90px;
    gap: 10px;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px;
    margin-bottom: 10px;
    background: #fff;
}

.quantity-input {
    text-align: center;
    font-weight: 800;
}

.section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.section-head h3 {
    margin: 0 0 4px;
}

.section-head p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.quick-count-badge {
    background: #e0f2fe;
    color: #075985;
    border: 1px solid #bae6fd;
    padding: 7px 10px;
    border-radius: 999px;
    white-space: nowrap;
    font-size: 13px;
}

.quick-products-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.quick-product-card {
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 12px;
    background: #fff;
    min-height: 188px;
    display: flex;
    flex-direction: column;
    gap: 9px;
    transition: .15s ease;
}

.quick-product-card.selected {
    border-color: var(--primary);
    background: #f0f7ff;
    box-shadow: 0 10px 20px rgba(13, 110, 253, .10);
}

.quick-product-name {
    font-weight: 900;
    color: #111827;
    line-height: 1.35;
}

.quick-product-price,
.quick-product-stock {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.quick-qty-control {
    margin-top: auto;
    display: grid;
    grid-template-columns: 42px 1fr 42px;
    align-items: center;
    gap: 8px;
}

.qty-btn {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 14px;
    font-size: 24px;
    font-weight: 900;
    cursor: pointer;
}

.plus-btn {
    background: var(--primary);
    color: #fff;
}

.minus-btn {
    background: #eef2f7;
    color: #111827;
}

.qty-display {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 42px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid var(--border);
    font-size: 20px;
}

.quick-line-total {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
    color: var(--muted);
    border-top: 1px dashed var(--border);
    padding-top: 8px;
}

.quick-line-total strong {
    color: #166534;
}

.total-preview-card {
    background: #f8fbff;
    margin: 6px 0 16px;
    box-shadow: none;
}

@media (max-width: 360px) {
    .quick-products-grid {
        grid-template-columns: 1fr;
    }
}


.quick-product-card.out-of-stock {
    opacity: .72;
    background: #f9fafb;
}

.quick-product-card.out-of-stock .plus-btn {
    background: #cbd5e1;
    cursor: not-allowed;
}

.quick-stock-warning {
    display: inline-flex;
    width: fit-content;
    background: #fee2e2;
    color: #991b1b;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 800;
}

.activity-item {
    display: grid;
    grid-template-columns: 16px 1fr;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.activity-item:last-child {
    border-bottom: 0;
}

.activity-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--primary);
    margin-top: 6px;
}

.receipt-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px;
    margin-bottom: 14px;
    font-size: 14px;
}

.receipt-head {
    text-align: center;
    border-bottom: 1px dashed var(--border);
    padding-bottom: 12px;
    margin-bottom: 12px;
}

.receipt-head h2 {
    margin: 0 0 6px;
}

.receipt-order-no {
    direction: ltr;
    font-weight: 900;
    font-size: 20px;
    margin-top: 8px;
}

.receipt-line {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 0;
}

.receipt-note {
    background: #f8fafc;
    border-radius: 12px;
    padding: 10px;
    line-height: 1.7;
}

.receipt-footer {
    text-align: center;
    font-weight: 900;
    margin-top: 16px;
}

@media print {
    body {
        background: #fff;
        padding: 0;
    }

    .topbar,
    .bottom-nav,
    .side-menu,
    .side-menu-backdrop,
    .no-print,
    .alert {
        display: none !important;
    }

    .mobile-shell {
        max-width: none;
        border: 0;
        background: #fff;
    }

    .content {
        padding: 0;
    }

    .receipt-card {
        border: 0;
        border-radius: 0;
        box-shadow: none;
        margin: 0;
    }
}

.soft-card {
    background: #f8fafc;
    box-shadow: none;
}

.permission-group {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px;
    margin-bottom: 12px;
}

.permission-group-title {
    font-weight: 900;
    margin-bottom: 10px;
    color: #111827;
}

.permission-grid {
    display: grid;
    gap: 9px;
}

.permission-option {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 11px;
    margin-bottom: 0;
    background: #f9fafb;
    font-size: 13px;
    cursor: pointer;
}

.permission-option input {
    width: auto;
    flex: 0 0 auto;
}

.permission-option span {
    line-height: 1.5;
}

.customer-search-results {
    display: grid;
    gap: 8px;
    margin-top: 8px;
}

.customer-search-result {
    width: 100%;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 14px;
    padding: 10px 12px;
    display: grid;
    gap: 4px;
    text-align: right;
    cursor: pointer;
}

.customer-search-result:hover,
.customer-search-result:focus {
    border-color: var(--primary);
    background: #eff6ff;
    outline: none;
}

.customer-search-result strong {
    color: #111827;
    font-size: 14px;
}

.customer-search-result span {
    color: var(--muted);
    font-size: 12px;
}

.readonly-box {
    width: 100%;
    min-height: 46px;
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid #dbe4ee;
    border-radius: 12px;
    background: #ffffff;
    box-sizing: border-box;
}

.totals-report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.totals-report-table th,
.totals-report-table td {
    padding: 13px 10px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.totals-report-table th {
    text-align: right;
    color: var(--text);
    font-weight: 800;
}

.totals-report-table td {
    text-align: left;
    font-weight: 900;
    white-space: nowrap;
}

.totals-report-table tr:last-child th,
.totals-report-table tr:last-child td {
    border-bottom: 0;
}

.totals-report-net-row th,
.totals-report-net-row td {
    background: #f8fafc;
    font-size: 15px;
}

/* Quick sale confirmation: highlight payment method */
.confirm-payment-method-highlight {
    color: #dc2626 !important;
    font-weight: 800;
}


/* v81 - Detailed stock movement audit report */
.report-table-scroll {
    width: 100%;
    overflow-x: auto;
    margin-top: 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
}

.audit-table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
    background: #fff;
    font-size: 12px;
}

.stock-movement-audit-table {
    min-width: 1350px;
}

.audit-table th,
.audit-table td {
    padding: 10px;
    text-align: right;
    vertical-align: top;
    border-bottom: 1px solid var(--border);
    border-left: 1px solid var(--border);
    white-space: nowrap;
}

.audit-table th:last-child,
.audit-table td:last-child {
    border-left: 0;
}

.audit-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f8fafc;
    color: #334155;
    font-weight: 900;
}

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

.audit-row-error td {
    background: #fff1f2;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 11px;
    font-weight: 900;
}

.status-chip.success {
    background: #dcfce7;
    color: #166534;
}

.status-chip.danger {
    background: #fee2e2;
    color: #991b1b;
}

.stock-audit-summary {
    margin-bottom: 10px;
}

.stock-audit-summary .table-like-row {
    margin: 0;
}

/* v90 - Laptop stock receipt using total batch price */
.stock-receipt-intro {
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1px solid #bfdbfe;
    background: linear-gradient(135deg, #eff6ff 0%, #ffffff 72%);
}

.stock-receipt-intro h3,
.stock-receipt-intro p {
    margin: 0;
}

.stock-receipt-intro p {
    margin-top: 5px;
    color: #475569;
    line-height: 1.8;
}

.stock-receipt-intro-icon {
    width: 54px;
    height: 54px;
    flex: 0 0 54px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: #dbeafe;
    font-size: 28px;
}

.stock-receipt-header-grid {
    display: grid;
    grid-template-columns: minmax(220px, 0.7fr) minmax(280px, 1.3fr);
    gap: 12px;
}

.stock-receipt-notes-field {
    min-width: 0;
}

.stock-receipt-add-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.stock-receipt-add-head h3 {
    margin: 0 0 3px;
}

.stock-receipt-picker {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.stock-receipt-picker input {
    min-width: 0;
}

.stock-receipt-lines-card {
    padding: 0;
    overflow: hidden;
}

.stock-receipt-lines-card .report-table-scroll {
    margin: 0;
    border: 0;
    border-radius: 0;
}

.stock-receipt-table {
    min-width: 1180px;
    width: 100%;
}

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

.stock-receipt-number-input {
    width: 125px;
    min-width: 125px;
    padding: 9px 10px;
    text-align: center;
    font-weight: 900;
}

.stock-receipt-remove {
    padding: 8px 11px;
    white-space: nowrap;
}

.stock-receipt-empty {
    min-height: 190px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: #64748b;
    text-align: center;
    padding: 24px;
}

.stock-receipt-empty-icon {
    font-size: 38px;
}

.stock-receipt-summary {
    border: 1px solid #bbf7d0;
    background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 70%);
}

.stock-receipt-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.stock-receipt-summary-grid > div {
    padding: 12px;
    border: 1px solid #d1fae5;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.88);
}

.stock-receipt-summary-grid span,
.stock-receipt-summary-grid strong {
    display: block;
}

.stock-receipt-summary-grid span {
    color: #64748b;
    font-size: 12px;
    margin-bottom: 5px;
}

.stock-receipt-summary-grid strong {
    color: #065f46;
    font-size: 18px;
}

.stock-receipt-formula {
    margin-top: 12px;
    padding: 11px 12px;
    border-radius: 12px;
    background: #f8fafc;
    color: #475569;
    font-size: 12px;
    line-height: 1.8;
}

.stock-receipt-submit {
    width: 100%;
    margin-top: 14px;
    padding: 13px 16px;
    font-size: 16px;
}

.stock-receipt-submit:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.field-error {
    color: #b91c1c;
    font-size: 12px;
    font-weight: 800;
    margin-top: 5px;
}

@media (max-width: 720px) {
    .stock-receipt-header-grid,
    .stock-receipt-summary-grid {
        grid-template-columns: 1fr;
    }

    .stock-receipt-picker {
        grid-template-columns: 1fr;
    }

    .stock-receipt-picker .btn {
        width: 100%;
    }
}


/* Laptop-width layout for stock receipt only */
.mobile-shell.stock-receipt-laptop-shell {
    width: 100%;
    max-width: 1500px;
}

.stock-receipt-laptop-shell .content {
    padding: 18px 24px 28px;
}

.stock-receipt-laptop-shell .stock-receipt-intro,
.stock-receipt-laptop-shell #stockReceiptForm {
    width: 100%;
}

.stock-receipt-laptop-shell .stock-receipt-lines-card {
    min-height: 250px;
}

.stock-receipt-total-input {
    width: 150px;
    min-width: 150px;
    border-color: #93c5fd;
    background: #eff6ff;
}

@media (min-width: 900px) {
    .stock-receipt-laptop-shell .stock-receipt-header-grid {
        grid-template-columns: minmax(240px, 0.55fr) minmax(480px, 1.45fr);
    }

    .stock-receipt-laptop-shell .stock-receipt-summary-grid {
        grid-template-columns: repeat(3, minmax(220px, 1fr));
    }
}

/* v91 - Stock receipt delivery distribution + laptop menu fix */
body.stock-receipt-menu-open {
    overflow: hidden;
}

.stock-receipt-laptop-shell .side-menu {
    right: max(0px, calc((100vw - 1500px) / 2));
    width: min(380px, 92vw);
    max-width: 380px;
}

.stock-receipt-laptop-shell .side-menu-backdrop {
    position: fixed;
    inset: 0;
}

.stock-receipt-header-grid {
    grid-template-columns: minmax(210px, .7fr) minmax(230px, .75fr) minmax(320px, 1.55fr);
    align-items: start;
}

.stock-receipt-delivery-field {
    min-width: 0;
}

.stock-receipt-money-input {
    position: relative;
}

.stock-receipt-money-input input {
    padding-left: 70px;
    font-weight: 900;
    color: #0f172a;
    border-color: #93c5fd;
    background: #eff6ff;
}

.stock-receipt-money-input span {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: #475569;
    font-size: 12px;
    font-weight: 900;
    pointer-events: none;
}

.stock-receipt-table {
    min-width: 1360px;
}

.amount-warning {
    color: #b45309;
}

.stock-receipt-summary-grid {
    grid-template-columns: repeat(5, minmax(170px, 1fr));
}

.stock-receipt-summary-grid .stock-receipt-summary-total {
    background: #ecfdf5;
    border-color: #86efac;
}

.stock-receipt-summary-grid .stock-receipt-summary-total strong {
    color: #047857;
    font-size: 20px;
}

@media (min-width: 900px) {
    .stock-receipt-laptop-shell .stock-receipt-header-grid {
        grid-template-columns: minmax(220px, .65fr) minmax(240px, .7fr) minmax(440px, 1.65fr);
    }

    .stock-receipt-laptop-shell .stock-receipt-summary-grid {
        grid-template-columns: repeat(5, minmax(170px, 1fr));
    }
}

@media (max-width: 980px) {
    .stock-receipt-header-grid,
    .stock-receipt-laptop-shell .stock-receipt-header-grid {
        grid-template-columns: 1fr 1fr;
    }

    .stock-receipt-notes-field {
        grid-column: 1 / -1;
    }

    .stock-receipt-summary-grid,
    .stock-receipt-laptop-shell .stock-receipt-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stock-receipt-summary-total {
        grid-column: 1 / -1;
    }
}

@media (max-width: 620px) {
    .stock-receipt-header-grid,
    .stock-receipt-laptop-shell .stock-receipt-header-grid,
    .stock-receipt-summary-grid,
    .stock-receipt-laptop-shell .stock-receipt-summary-grid {
        grid-template-columns: 1fr;
    }

    .stock-receipt-notes-field,
    .stock-receipt-summary-total {
        grid-column: auto;
    }
}

/* v92 - تغيير طريقة الدفع للحركات المسجلة */
.payment-method-change-box {
    margin-top: 9px;
    width: min(100%, 520px);
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    background: #eff6ff;
    overflow: hidden;
}

.payment-method-change-box > summary {
    cursor: pointer;
    padding: 9px 12px;
    color: #1d4ed8;
    font-size: 13px;
    font-weight: 900;
    list-style-position: inside;
    user-select: none;
}

.payment-method-change-box[open] > summary {
    border-bottom: 1px solid #bfdbfe;
}

.payment-method-change-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 10px;
}

.payment-method-change-form select {
    flex: 1 1 210px;
    min-width: 180px;
    margin: 0;
}

.payment-method-change-form .btn {
    width: auto;
    min-width: 105px;
    padding: 10px 14px;
}

@media (max-width: 620px) {
    .payment-method-change-form {
        display: grid;
        grid-template-columns: 1fr;
    }

    .payment-method-change-form select,
    .payment-method-change-form .btn {
        width: 100%;
        min-width: 0;
    }
}

/* v95 - جرد وتسوية المخزون والتقرير الشهري */
.mobile-shell.stocktake-laptop-shell,
.mobile-shell.stocktake-report-laptop-shell {
    width: 100%;
    max-width: 1600px;
}

.stocktake-laptop-shell .content,
.stocktake-report-laptop-shell .content {
    padding: 18px 24px 30px;
}

body.stocktake-menu-open {
    overflow: hidden;
}

.stocktake-laptop-shell .side-menu,
.stocktake-report-laptop-shell .side-menu {
    right: max(0px, calc((100vw - 1600px) / 2));
    width: min(380px, 92vw);
    max-width: 380px;
}

.stocktake-laptop-shell .side-menu-backdrop,
.stocktake-report-laptop-shell .side-menu-backdrop {
    position: fixed;
    inset: 0;
}

.stocktake-intro {
    display: flex;
    align-items: center;
    gap: 14px;
    background: linear-gradient(135deg, #eff6ff, #f8fafc);
    border-color: #bfdbfe;
}

.stocktake-intro h3,
.stocktake-intro p {
    margin: 0;
}

.stocktake-intro p {
    margin-top: 5px;
    color: #475569;
    line-height: 1.8;
}

.stocktake-intro-icon {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    flex: 0 0 54px;
    border-radius: 16px;
    background: #dbeafe;
    font-size: 28px;
}

.stocktake-header-grid {
    display: grid;
    grid-template-columns: minmax(250px, .65fr) minmax(520px, 1.35fr);
    gap: 16px;
    align-items: start;
}

.required-star {
    color: #dc2626;
}

.stocktake-tools {
    display: grid;
    grid-template-columns: minmax(300px, 1fr) auto auto;
    gap: 16px;
    align-items: end;
}

.stocktake-search-wrap label {
    display: block;
    margin-bottom: 7px;
    font-weight: 900;
}

.stocktake-differences-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
    font-weight: 800;
    cursor: pointer;
}

.stocktake-differences-toggle input {
    width: 18px;
    height: 18px;
    margin: 0;
}

.stocktake-visible-count {
    min-width: 100px;
    min-height: 44px;
    display: grid;
    place-items: center;
    padding: 0 14px;
    border-radius: 12px;
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 900;
}

.stocktake-table-card,
.stocktake-report-table-card {
    padding: 0;
    overflow: hidden;
}

.stocktake-table,
.stocktake-report-table {
    min-width: 1450px;
}

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

.stocktake-table tbody tr.has-shortage {
    background: #fff7f7;
}

.stocktake-table tbody tr.has-surplus {
    background: #f0fdf4;
}

.stocktake-table tbody tr:hover {
    background: #eff6ff;
}

.stocktake-product-cell {
    min-width: 190px;
}

.stocktake-actual-input {
    min-width: 110px;
    width: 120px;
    margin: 0;
    font-weight: 900;
    text-align: center;
    background: #eff6ff;
    border-color: #93c5fd;
}

.stocktake-reason-select {
    min-width: 185px;
    margin: 0;
}

.stocktake-item-notes {
    min-width: 220px;
    margin: 0;
}

.stocktake-reason-select:disabled,
.stocktake-item-notes:disabled {
    opacity: .55;
    background: #f1f5f9;
}

.stocktake-summary-card {
    position: sticky;
    bottom: 10px;
    z-index: 15;
    border-color: #bfdbfe;
    box-shadow: 0 12px 35px rgba(15, 23, 42, .14);
}

.stocktake-summary-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(150px, 1fr));
    gap: 10px;
}

.stocktake-summary-grid > div {
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 13px;
    background: #f8fafc;
}

.stocktake-summary-grid span {
    display: block;
    margin-bottom: 5px;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
}

.stocktake-summary-grid strong {
    font-size: 19px;
}

.stocktake-summary-shortage {
    border-color: #fecaca !important;
    background: #fff7f7 !important;
}

.stocktake-summary-shortage strong {
    color: #b91c1c;
}

.stocktake-summary-surplus {
    border-color: #bbf7d0 !important;
    background: #f0fdf4 !important;
}

.stocktake-summary-surplus strong {
    color: #047857;
}

.stocktake-submit-note {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 11px;
    background: #f8fafc;
    color: #475569;
    font-size: 13px;
    font-weight: 800;
}

.stocktake-submit-note.warning {
    background: #fffbeb;
    color: #92400e;
}

.stocktake-submit-note.success {
    background: #ecfdf5;
    color: #047857;
}

.stocktake-submit {
    width: 100%;
    margin-top: 12px;
    padding: 13px 16px;
    font-size: 16px;
}

.stocktake-submit:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.stocktake-report-filter-grid {
    display: grid;
    grid-template-columns: minmax(220px, .5fr) minmax(220px, .5fr) auto;
    gap: 14px;
    align-items: end;
}

.stocktake-report-filter-grid .btn {
    min-height: 44px;
    min-width: 150px;
}

.stocktake-report-period {
    color: #475569;
}

.stocktake-report-summary-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.stocktake-report-summary-grid .metric {
    margin: 0;
}

.stocktake-report-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid #e2e8f0;
}

.stocktake-report-head h3 {
    margin: 0;
}

.stocktake-report-notes {
    min-width: 260px;
    white-space: normal;
    line-height: 1.7;
}

@media (max-width: 1100px) {
    .stocktake-header-grid,
    .stocktake-tools,
    .stocktake-report-filter-grid {
        grid-template-columns: 1fr 1fr;
    }

    .stocktake-general-notes,
    .stocktake-search-wrap {
        grid-column: 1 / -1;
    }

    .stocktake-report-summary-grid,
    .stocktake-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .stocktake-laptop-shell .content,
    .stocktake-report-laptop-shell .content {
        padding: 12px;
    }

    .stocktake-header-grid,
    .stocktake-tools,
    .stocktake-report-filter-grid,
    .stocktake-report-summary-grid,
    .stocktake-summary-grid {
        grid-template-columns: 1fr;
    }

    .stocktake-general-notes,
    .stocktake-search-wrap {
        grid-column: auto;
    }

    .stocktake-summary-card {
        position: static;
    }
}

/* v96 - قائمة رئيسية مجمعة مع فروع قابلة للفتح والإغلاق */
.side-menu-links {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.side-menu-direct,
.side-menu-group {
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fff;
    overflow: hidden;
    flex: 0 0 auto;
}

.side-menu-links .side-menu-direct {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px 13px;
    font-weight: 800;
    min-height: 62px;
}

.side-menu-links .side-menu-direct.active,
.side-menu-group.is-current {
    border-color: #93c5fd;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, .07);
}

.side-menu-links .side-menu-direct.active {
    background: #eff6ff;
    color: var(--primary);
}

.side-menu-group > summary {
    list-style: none;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 13px;
    min-height: 62px;
    transition: background .16s ease, color .16s ease;
}

.side-menu-group > summary::-webkit-details-marker {
    display: none;
}

.side-menu-group > summary::marker {
    display: none;
    content: '';
}

.side-menu-group > summary:hover {
    background: #f8fafc;
}

.side-menu-group[open] > summary {
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
}

.side-menu-group.is-current > summary {
    color: var(--primary);
    background: #eff6ff;
}

.side-menu-group-main {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}

.side-menu-link-copy {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.side-menu-link-copy strong {
    font-size: 14px;
    line-height: 1.35;
}

.side-menu-link-copy small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.35;
}

.side-menu-direct.active .side-menu-link-copy small,
.side-menu-group.is-current > summary .side-menu-link-copy small {
    color: #54719b;
}

.side-menu-chevron {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border-radius: 9px;
    background: #f1f5f9;
    color: #64748b;
    display: grid;
    place-items: center;
    font-size: 18px;
    font-weight: 900;
    line-height: 1;
    transform: rotate(0deg);
    transition: transform .18s ease, background .18s ease;
}

.side-menu-group[open] > summary .side-menu-chevron {
    transform: rotate(180deg);
    background: #dbeafe;
    color: #1d4ed8;
}

.side-menu-children {
    display: grid;
    gap: 4px;
    padding: 8px;
    background: #fbfdff;
}

.side-menu-links .side-menu-children a {
    display: flex;
    align-items: center;
    gap: 9px;
    border: 0;
    border-radius: 11px;
    padding: 10px 11px;
    background: transparent;
    color: #334155;
    font-size: 13px;
    font-weight: 700;
    min-height: 40px;
}

.side-menu-links .side-menu-children a:hover {
    background: #f1f5f9;
}

.side-menu-links .side-menu-children a.active {
    background: #dbeafe;
    color: #1d4ed8;
}

.side-child-dot {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
    background: #cbd5e1;
}

.side-menu-children a.active .side-child-dot {
    background: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .10);
}

.side-menu-links .side-icon {
    flex: 0 0 34px;
}

@media (max-width: 420px) {
    .side-menu-link-copy small {
        display: none;
    }

    .side-menu-group > summary,
    .side-menu-links .side-menu-direct {
        min-height: 56px;
        padding: 10px 11px;
    }
}

/* v98 - Daily withdrawal rate management */
.mobile-shell.withdrawal-rate-laptop-shell {
    width: min(100%, 1580px);
    max-width: 1580px;
}

.withdrawal-rate-laptop-shell .content {
    padding-inline: clamp(18px, 2.5vw, 38px);
}

.withdrawal-rate-head-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    border: 1px solid #dbe7f3;
    background: linear-gradient(135deg, #ffffff 0%, #f4f9ff 100%);
}

.withdrawal-rate-head-copy {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.withdrawal-rate-head-copy h3,
.withdrawal-rate-head-copy p {
    margin: 0;
}

.withdrawal-rate-head-copy p {
    margin-top: 7px;
    color: #5d6b7a;
    line-height: 1.8;
}

.withdrawal-rate-head-icon {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    flex: 0 0 58px;
    font-size: 28px;
    background: #e7f2ff;
}

.withdrawal-rate-recalculate-btn {
    min-width: 210px;
    white-space: nowrap;
}

.withdrawal-rate-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.withdrawal-rate-summary-grid .metric {
    margin: 0;
}

.withdrawal-rate-last-date {
    font-size: 18px !important;
}

.amount-orange {
    color: #b45309 !important;
}

.status-chip.warning {
    color: #92400e;
    background: #fef3c7;
    border-color: #fde68a;
}

.withdrawal-rate-table-card {
    padding: 0;
    overflow: hidden;
}

.withdrawal-rate-table-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid #e6edf4;
    background: #ffffff;
}

.withdrawal-rate-table-head h3 {
    margin: 0 0 5px;
}

.withdrawal-rate-scroll {
    max-height: calc(100vh - 390px);
    min-height: 360px;
    overflow: auto;
}

.withdrawal-rate-table {
    min-width: 1280px;
    width: 100%;
}

.withdrawal-rate-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #eef5fb;
    white-space: nowrap;
}

.withdrawal-rate-table th,
.withdrawal-rate-table td {
    vertical-align: middle;
    text-align: center;
}

.withdrawal-rate-table tbody tr:nth-child(even) {
    background: #fbfdff;
}

.withdrawal-rate-table tbody tr:hover {
    background: #f2f8ff;
}

.withdrawal-rate-product-cell {
    min-width: 210px;
    text-align: right !important;
}

.withdrawal-rate-product-cell strong,
.withdrawal-rate-product-cell span {
    display: block;
}

.withdrawal-rate-product-cell span {
    margin-top: 4px;
    color: #758292;
    font-size: 12px;
}

.withdrawal-rate-calculated {
    display: inline-flex;
    min-width: 70px;
    justify-content: center;
    padding: 7px 10px;
    border-radius: 9px;
    color: #075985;
    background: #e0f2fe;
    font-weight: 800;
}

.withdrawal-rate-input-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 210px;
}

.withdrawal-rate-input-wrap input {
    width: 105px;
    min-width: 105px;
    padding: 10px 9px;
    text-align: center;
    font-size: 16px;
    font-weight: 800;
    border: 2px solid #cbd9e6;
    background: #fffdf3;
}

.withdrawal-rate-input-wrap input:focus {
    border-color: #2563eb;
    background: #ffffff;
}

.withdrawal-rate-input-wrap span {
    white-space: nowrap;
    color: #667587;
    font-size: 12px;
}

.withdrawal-rate-date {
    white-space: nowrap;
    color: #677587;
    font-size: 12px;
}

.withdrawal-rate-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 20px;
    border-top: 1px solid #e6edf4;
    background: #f8fbfe;
}

.withdrawal-rate-note {
    color: #526172;
    line-height: 1.7;
}

.withdrawal-rate-save-btn {
    min-width: 210px;
}

@media (max-width: 1050px) {
    .withdrawal-rate-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .withdrawal-rate-scroll {
        max-height: none;
    }
}

@media (max-width: 720px) {
    .withdrawal-rate-head-card,
    .withdrawal-rate-table-head,
    .withdrawal-rate-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .withdrawal-rate-recalculate-btn,
    .withdrawal-rate-save-btn,
    .withdrawal-rate-table-head .btn {
        width: 100%;
    }

    .withdrawal-rate-summary-grid {
        grid-template-columns: 1fr;
    }
}

/* v100 - Fix side menu position on daily withdrawal laptop screen */
body.withdrawal-rate-menu-open {
    overflow: hidden;
}

.withdrawal-rate-laptop-shell .side-menu {
    right: max(0px, calc((100vw - 1580px) / 2));
    width: min(380px, 92vw);
    max-width: 380px;
}

.withdrawal-rate-laptop-shell .side-menu-backdrop {
    position: fixed;
    inset: 0;
}

@media (max-width: 520px) {
    .withdrawal-rate-laptop-shell .side-menu {
        right: 0;
        width: 88vw;
        max-width: none;
    }
}

/* v101: read-only daily withdrawal rate screen */
.withdrawal-rate-view-table {
    width: 100%;
    min-width: 640px;
}

.withdrawal-rate-view-table th:last-child,
.withdrawal-rate-view-table td:last-child {
    width: 42%;
}

.withdrawal-rate-view-value {
    display: inline-block;
    min-width: 86px;
    font-size: 1.08rem;
}

/* v102: customer invoice details modal */
.customer-invoices-card {
    overflow: hidden;
}

.customer-invoices-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.customer-invoices-head h3 {
    margin: 0 0 4px;
}

.customer-invoices-count {
    flex: 0 0 auto;
    padding: 7px 11px;
    border-radius: 999px;
    color: #1d4ed8;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    font-size: 12px;
    font-weight: 800;
}

.customer-invoices-list {
    display: grid;
    gap: 9px;
}

.customer-invoice-item {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 15px;
    border: 1px solid #dce6ef;
    border-radius: 14px;
    color: #172033;
    background: #fff;
    font: inherit;
    text-align: right;
    cursor: pointer;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.customer-invoice-item:hover,
.customer-invoice-item:focus-visible {
    border-color: #93c5fd;
    box-shadow: 0 8px 22px rgba(37, 99, 235, .10);
    transform: translateY(-1px);
    outline: none;
}

.customer-invoice-main,
.customer-invoice-summary {
    display: flex;
    align-items: center;
    gap: 10px;
}

.customer-invoice-main {
    min-width: 0;
    flex-wrap: wrap;
}

.customer-invoice-main strong {
    direction: ltr;
    font-size: 15px;
}

.customer-invoice-main > span {
    color: #718096;
    font-size: 12px;
}

.customer-invoice-summary {
    flex: 0 0 auto;
}

.customer-invoice-arrow {
    color: #2563eb;
    font-size: 24px;
    line-height: 1;
}

body.customer-invoice-modal-open {
    overflow: hidden;
}

.customer-invoice-modal[hidden] {
    display: none !important;
}

.customer-invoice-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(15, 23, 42, .58);
    backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity .16s ease;
}

.customer-invoice-modal.is-open {
    opacity: 1;
}

.customer-invoice-dialog {
    width: min(760px, 100%);
    max-height: min(88vh, 820px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .30);
    transform: translateY(12px) scale(.985);
    transition: transform .16s ease;
}

.customer-invoice-modal.is-open .customer-invoice-dialog {
    transform: translateY(0) scale(1);
}

.customer-invoice-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 20px;
    border-bottom: 1px solid #e7edf3;
    background: linear-gradient(135deg, #f8fbff, #eef6ff);
}

.customer-invoice-modal-head h3 {
    margin: 3px 0 4px;
    direction: ltr;
    font-size: 21px;
}

.customer-invoice-modal-label {
    color: #2563eb;
    font-size: 12px;
    font-weight: 800;
}

.customer-invoice-close {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid #d8e3ee;
    border-radius: 12px;
    color: #475569;
    background: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.customer-invoice-close:hover,
.customer-invoice-close:focus-visible {
    color: #b91c1c;
    border-color: #fecaca;
    background: #fff1f2;
    outline: none;
}

.customer-invoice-modal-body {
    overflow-y: auto;
    padding: 18px 20px;
}

.customer-invoice-status-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.customer-invoice-section {
    padding: 15px 0;
    border-top: 1px solid #edf1f5;
}

.customer-invoice-section:first-of-type {
    border-top: 0;
}

.customer-invoice-section h4 {
    margin: 0 0 11px;
    color: #334155;
    font-size: 14px;
}

.customer-invoice-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
}

.customer-invoice-grid > div,
.customer-invoice-totals > div {
    display: grid;
    gap: 5px;
    padding: 11px 12px;
    border: 1px solid #e4ebf2;
    border-radius: 12px;
    background: #fbfdff;
}

.customer-invoice-grid span,
.customer-invoice-totals span {
    color: #718096;
    font-size: 12px;
}

.customer-invoice-totals {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 9px;
}

.customer-invoice-payments {
    display: grid;
    gap: 8px;
}

.customer-invoice-payments > div {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #e5ebf1;
    border-radius: 11px;
}

.customer-invoice-payments span {
    color: #64748b;
    font-size: 12px;
}

.customer-invoice-payments small {
    display: block;
    margin-top: 4px;
}

.customer-invoice-payments strong {
    text-align: left;
    white-space: nowrap;
}

.customer-invoice-notes {
    padding: 12px;
    border-radius: 12px;
    color: #475569;
    background: #f8fafc;
    line-height: 1.7;
}

.customer-invoice-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid #e7edf3;
    background: #f8fafc;
}

.customer-invoice-modal-actions .btn {
    width: auto;
    min-width: 130px;
}

@media (max-width: 720px) {
    .customer-invoice-item,
    .customer-invoice-head,
    .customer-invoice-payments > div {
        align-items: stretch;
        flex-direction: column;
    }

    .customer-invoice-summary {
        justify-content: space-between;
    }

    .customer-invoice-grid,
    .customer-invoice-totals {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .customer-invoice-modal {
        padding: 8px;
        align-items: end;
    }

    .customer-invoice-dialog {
        width: 100%;
        max-height: 94vh;
        border-radius: 18px 18px 0 0;
    }

    .customer-invoice-modal-actions {
        flex-direction: column-reverse;
    }

    .customer-invoice-modal-actions .btn {
        width: 100%;
    }
}

@media (max-width: 460px) {
    .customer-invoice-grid,
    .customer-invoice-totals {
        grid-template-columns: 1fr;
    }
}


/* v103: include quick-sale invoices in customer profile modal */
.customer-invoice-number-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.customer-invoice-type {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 25px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.customer-invoice-type-order {
    color: #075985;
    background: #e0f2fe;
    border: 1px solid #bae6fd;
}

.customer-invoice-type-sale {
    color: #7c2d12;
    background: #ffedd5;
    border: 1px solid #fed7aa;
}

.customer-quick-sale-items {
    display: grid;
    gap: 8px;
}

.customer-quick-sale-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 11px 12px;
    border: 1px solid #e3eaf1;
    border-radius: 11px;
    background: #fbfdff;
}

.customer-quick-sale-item > div {
    min-width: 0;
}

.customer-quick-sale-item > div strong,
.customer-quick-sale-item > div span {
    display: block;
}

.customer-quick-sale-item > div span {
    margin-top: 4px;
    color: #667587;
    font-size: 12px;
}

.customer-quick-sale-item > strong {
    flex: 0 0 auto;
    white-space: nowrap;
}

@media (max-width: 560px) {
    .customer-quick-sale-item {
        align-items: flex-start;
        flex-direction: column;
    }
}


/* v104: compact read-only withdrawal-rate table for mobile */
.withdrawal-rate-view-table {
    min-width: 0;
    width: 100%;
    table-layout: fixed;
}

.withdrawal-rate-view-table .withdrawal-rate-product-cell {
    width: 58%;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
}

.withdrawal-rate-view-table th:last-child,
.withdrawal-rate-view-table td:last-child {
    width: 42%;
    text-align: center;
    white-space: normal;
}

@media (max-width: 600px) {
    .withdrawal-rate-laptop-shell .content {
        padding-inline: 10px;
    }

    .withdrawal-rate-view-table th,
    .withdrawal-rate-view-table td {
        padding: 8px 6px;
        font-size: 11px;
        line-height: 1.55;
    }

    .withdrawal-rate-view-table .withdrawal-rate-product-cell {
        width: 60%;
    }

    .withdrawal-rate-view-table th:last-child,
    .withdrawal-rate-view-table td:last-child {
        width: 40%;
    }

    .withdrawal-rate-view-value {
        min-width: 0;
        font-size: 0.98rem;
    }

    .withdrawal-rate-view-table .list-meta {
        display: block;
        margin-top: 2px;
        font-size: 10px;
        line-height: 1.35;
    }

    .withdrawal-rate-table-card {
        border-radius: 12px;
    }
}


/* v105: open quick-sale details from customer wallet movements */
.customer-wallet-transaction-row.is-invoice-clickable {
    margin-inline: -8px;
    padding-inline: 8px;
    border-radius: 12px;
    cursor: pointer;
    transition: background-color .16s ease, box-shadow .16s ease;
}

.customer-wallet-transaction-row.is-invoice-clickable:hover,
.customer-wallet-transaction-row.is-invoice-clickable:focus-visible {
    background: #f3f8ff;
    box-shadow: inset 0 0 0 1px #bfdbfe;
    outline: none;
}

.customer-wallet-invoice-link {
    color: #2563eb;
    font-weight: 800;
}

@media (max-width: 600px) {
    .customer-wallet-transaction-row.is-invoice-clickable {
        margin-inline: -4px;
        padding-inline: 6px;
    }
}

/* v110: order create confirmation modal */
body.order-confirm-open {
    overflow: hidden;
}

.order-confirm-modal[hidden] {
    display: none !important;
}

.order-confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(15, 23, 42, 0.58);
}

.order-confirm-box {
    width: min(100%, 480px);
    max-height: calc(100vh - 36px);
    overflow-y: auto;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 22px 60px rgba(15, 23, 42, 0.26);
}

.order-confirm-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 18px 12px;
    border-bottom: 1px solid #e5e7eb;
}

.order-confirm-head span {
    display: block;
    margin-bottom: 3px;
    color: #64748b;
    font-size: 12px;
}

.order-confirm-head h3 {
    margin: 0;
    font-size: 20px;
}

.order-confirm-head button {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border: 0;
    border-radius: 10px;
    background: #f1f5f9;
    color: #334155;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.order-confirm-customer {
    margin: 16px 18px 12px;
    padding: 16px;
    border: 2px solid #f59e0b;
    border-radius: 16px;
    background: #fffbeb;
    text-align: center;
}

.order-confirm-customer span,
.order-confirm-customer small {
    display: block;
    color: #92400e;
}

.order-confirm-customer strong {
    display: block;
    margin: 6px 0 4px;
    color: #111827;
    font-size: 25px;
    line-height: 1.35;
}

.order-confirm-customer small {
    font-size: 15px;
    font-weight: 700;
}

.order-confirm-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    padding: 0 18px;
}

.order-confirm-grid > div {
    padding: 11px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #f8fafc;
}

.order-confirm-grid span {
    display: block;
    margin-bottom: 4px;
    color: #64748b;
    font-size: 12px;
}

.order-confirm-grid strong {
    display: block;
    color: #0f172a;
    font-size: 15px;
}

.order-confirm-warning {
    margin: 14px 18px 0;
    padding: 11px 12px;
    border-radius: 12px;
    background: #fef2f2;
    color: #991b1b;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.7;
}

.order-confirm-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 16px 18px 18px;
}

.order-confirm-actions .btn {
    width: 100%;
}

@media (max-width: 520px) {
    .order-confirm-modal {
        align-items: flex-end;
        padding: 0;
    }

    .order-confirm-box {
        width: 100%;
        max-height: 92vh;
        border-radius: 20px 20px 0 0;
    }
}

/* v112 - Desktop-first responsive application shell (clothing store UI refresh) */
:root {
    --desktop-sidebar: 288px;
    --desktop-content-max: 1680px;
    --surface-soft: #f8fafc;
    --shadow-card: 0 8px 28px rgba(15, 23, 42, .055);
}

html {
    min-width: 0;
    background: var(--bg);
}

body {
    min-width: 0;
}

img,
svg {
    max-width: 100%;
}

input,
select,
textarea,
button {
    min-width: 0;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, .10);
}

.card,
.metric,
.list-item {
    box-shadow: var(--shadow-card);
}

.table-responsive,
.report-table-scroll,
.audit-table-wrap,
.daily-debt-table-wrap,
.withdrawal-rate-scroll,
.modal-table-wrap,
.quick-sale-confirm-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    max-width: 100%;
}

/* Laptop / desktop */
@media (min-width: 900px) {
    body {
        padding-bottom: 0;
        background: #eef3f8;
        overflow-x: hidden;
    }

    .mobile-shell {
        width: 100%;
        max-width: none;
        min-height: 100vh;
        margin: 0;
        padding-right: var(--desktop-sidebar);
        overflow: visible;
        border: 0;
        background: #eef3f8;
    }

    .side-menu {
        right: 0;
        width: var(--desktop-sidebar);
        max-width: var(--desktop-sidebar);
        height: 100vh;
        padding: 18px 14px;
        transform: none !important;
        border: 0;
        border-left: 1px solid #e2e8f0;
        border-radius: 0;
        box-shadow: 8px 0 28px rgba(15, 23, 42, .055);
    }

    .side-menu-head {
        position: sticky;
        top: -18px;
        z-index: 2;
        margin: -18px -14px 12px;
        padding: 18px 16px 14px;
        background: #fff;
    }

    .side-menu-title {
        font-size: 18px;
    }

    .side-menu-subtitle {
        font-size: 12px;
    }

    .side-menu-close,
    .side-menu-backdrop,
    .menu-button,
    .bottom-nav {
        display: none !important;
    }

    .side-menu-links {
        gap: 7px;
    }

    .side-menu-links a,
    .side-menu-group > summary {
        border-radius: 12px;
    }

    .side-menu-direct,
    .side-menu-group > summary {
        min-height: 54px;
        padding: 10px 11px !important;
    }

    .side-menu-link-copy strong {
        font-size: 13px;
    }

    .side-menu-link-copy small {
        font-size: 10px;
        line-height: 1.45;
    }

    .side-icon {
        width: 32px;
        height: 32px;
        flex: 0 0 32px;
        border-radius: 10px;
    }

    .side-menu-children a {
        min-height: 38px;
        padding: 8px 10px !important;
        font-size: 12px;
    }

    .side-logout-form {
        padding-top: 12px;
        background: #fff;
    }

    .topbar {
        position: sticky;
        top: 0;
        min-height: 68px;
        padding: 12px 24px;
        border-radius: 0;
        box-shadow: 0 3px 16px rgba(15, 23, 42, .10);
        z-index: 30;
    }

    .topbar-title {
        font-size: 20px;
        font-weight: 900;
    }

    .topbar-subtitle {
        font-size: 12px;
    }

    .content {
        width: min(100%, var(--desktop-content-max));
        margin: 0 auto;
        padding: 22px 24px 32px;
    }

    .card {
        padding: 18px;
        margin-bottom: 16px;
        border-radius: 15px;
    }

    .metric {
        min-height: 104px;
        padding: 17px;
        border-radius: 15px;
    }

    .metric .num {
        font-size: 25px;
    }

    .grid-2 {
        gap: 14px;
    }

    .row-actions {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 10px;
    }

    .row-actions .btn {
        width: auto;
        min-width: 120px;
        flex: 0 0 auto;
    }

    .btn {
        width: auto;
        min-height: 42px;
        min-width: 108px;
        padding: 10px 16px;
        border-radius: 10px;
    }

    .card > .btn + .btn {
        margin-top: 0 !important;
        margin-right: 8px;
    }

    .search-box {
        grid-template-columns: minmax(280px, 1fr) auto;
        max-width: 760px;
    }

    .form-group {
        margin-bottom: 14px;
    }

    input,
    select,
    textarea {
        min-height: 42px;
        padding: 9px 11px;
        border-radius: 10px;
        font-size: 14px;
    }

    textarea {
        min-height: 96px;
    }

    .quick-products-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 12px;
    }

    .quick-product-card {
        min-height: 178px;
        padding: 13px;
        border-radius: 14px;
    }

    .permission-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .list-item {
        border-radius: 13px;
        padding: 13px 15px;
    }

    .table-like-row {
        padding: 9px 2px;
    }

    .login-page {
        min-height: calc(100vh - 44px);
        padding: 28px;
    }

    .login-page > .card {
        max-width: 430px;
        margin: 0 auto;
        padding: 26px;
    }

    .login-page .btn {
        width: 100%;
    }

    .dashboard-metrics {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    /* Page-specific laptop shells should use the same global canvas. */
    .mobile-shell.stock-receipt-laptop-shell,
    .mobile-shell.stocktake-laptop-shell,
    .mobile-shell.stocktake-report-laptop-shell,
    .mobile-shell.withdrawal-rate-laptop-shell {
        width: 100%;
        max-width: none;
    }

    .stock-receipt-laptop-shell .content,
    .stocktake-laptop-shell .content,
    .stocktake-report-laptop-shell .content,
    .withdrawal-rate-laptop-shell .content {
        width: min(100%, var(--desktop-content-max));
        padding: 22px 24px 32px;
    }
}

/* Medium laptop / tablet landscape */
@media (min-width: 900px) and (max-width: 1180px) {
    :root {
        --desktop-sidebar: 250px;
    }

    .content,
    .stock-receipt-laptop-shell .content,
    .stocktake-laptop-shell .content,
    .stocktake-report-laptop-shell .content,
    .withdrawal-rate-laptop-shell .content {
        padding-inline: 18px;
    }

    .quick-products-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .dashboard-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Mobile / tablet portrait */
@media (max-width: 899px) {
    body {
        padding-bottom: 78px;
        background: var(--bg);
    }

    .mobile-shell,
    .mobile-shell.stock-receipt-laptop-shell,
    .mobile-shell.stocktake-laptop-shell,
    .mobile-shell.stocktake-report-laptop-shell,
    .mobile-shell.withdrawal-rate-laptop-shell {
        width: 100%;
        max-width: 100%;
        padding-right: 0;
        margin: 0;
        border: 0;
    }

    .topbar {
        padding: 13px 14px;
        border-bottom-left-radius: 18px;
        border-bottom-right-radius: 18px;
    }

    .topbar-title {
        font-size: 17px;
    }

    .content,
    .stock-receipt-laptop-shell .content,
    .stocktake-laptop-shell .content,
    .stocktake-report-laptop-shell .content,
    .withdrawal-rate-laptop-shell .content {
        width: 100%;
        padding: 12px;
    }

    .card {
        padding: 14px;
        border-radius: 14px;
        margin-bottom: 12px;
    }

    .side-menu {
        right: 0;
        width: min(88vw, 350px);
        max-width: none;
        transform: translateX(105%);
        border-top-left-radius: 20px;
        border-bottom-left-radius: 20px;
    }

    .side-menu-toggle:checked ~ .side-menu {
        transform: translateX(0);
    }

    .bottom-nav {
        left: 0;
        transform: none;
        width: 100%;
        max-width: none;
        min-height: 64px;
        padding-bottom: max(8px, env(safe-area-inset-bottom));
        overflow-x: auto;
        grid-auto-flow: column;
        grid-auto-columns: minmax(72px, 1fr);
        grid-template-columns: none;
    }

    .bottom-nav a {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 46px;
        padding: 6px 8px;
        font-size: 11px;
        white-space: nowrap;
    }

    .btn {
        width: 100%;
    }

    .row-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .quick-products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .filters {
        margin-inline: -2px;
        padding-inline: 2px;
    }
}

@media (max-width: 560px) {
    .grid-2,
    .dashboard-metrics,
    .row-actions {
        grid-template-columns: 1fr;
    }

    .quick-products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .quick-product-card {
        min-height: 170px;
        padding: 10px;
    }

    .quick-qty-control {
        grid-template-columns: 38px 1fr 38px;
        gap: 6px;
    }

    .qty-btn,
    .qty-display {
        width: 38px;
        height: 38px;
    }

    .qty-display {
        width: auto;
        font-size: 17px;
    }

    .search-box {
        grid-template-columns: 1fr;
    }

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

    .table-like-row {
        align-items: flex-start;
        flex-wrap: wrap;
    }
}

@media (max-width: 360px) {
    .quick-products-grid {
        grid-template-columns: 1fr;
    }
}

/* v112.1 - guest pages do not reserve desktop sidebar space */
@media (min-width: 900px) {
    .mobile-shell.is-guest {
        padding-right: 0;
    }

    .mobile-shell.is-guest .content {
        width: 100%;
        max-width: none;
        padding: 0;
    }
}

/* v114 - Unified laptop-first data presentation across the application */
:root {
    --page-card-radius: 16px;
    --page-card-border: #e2e8f0;
    --page-header-bg: #f8fafc;
    --table-row-hover: #f8fbff;
    --table-head-text: #475569;
    --table-cell-text: #0f172a;
}

/* Shared page surfaces */
.card,
.metric,
.list-item {
    border-color: var(--page-card-border);
}

.card {
    overflow-wrap: anywhere;
}

.card > h2:first-child,
.card > h3:first-child,
.card > h4:first-child {
    margin-top: 0;
}

.card > h3:first-child {
    margin-bottom: 14px;
    color: #0f172a;
    font-size: 17px;
}

.list-item {
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.list-item:hover {
    border-color: #bfdbfe;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .07);
}

/* Shared filters / search areas */
.page-filter-card {
    padding: 18px;
}

.page-filter-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(180px, 1fr)) auto;
    gap: 14px;
    align-items: end;
}

.page-filter-grid .form-group {
    margin-bottom: 0;
}

.page-filter-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.page-filter-actions .btn {
    white-space: nowrap;
}

/* Consistent controls */
label {
    color: #334155;
}

input,
select,
textarea {
    color: #0f172a;
    border-color: #d8e0ea;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

input:hover,
select:hover,
textarea:hover {
    border-color: #cbd5e1;
}

.btn {
    box-shadow: none;
    transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}

.btn:hover {
    box-shadow: 0 7px 16px rgba(15, 23, 42, .09);
}

.btn:active {
    transform: translateY(1px);
}

.btn-sm {
    min-width: 82px;
    min-height: 36px;
    padding: 8px 12px;
    border-radius: 9px;
    font-size: 13px;
}

/* Shared data tables */
.data-table-card {
    padding: 0;
    overflow: hidden;
}

.data-table-card > .table-responsive {
    margin: 0;
    border: 0;
}

.data-table,
.table-responsive > table:not(.pos-cart-table):not(.quick-sale-confirm-table) {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    color: var(--table-cell-text);
}

.data-table th,
.data-table td,
.table-responsive > table:not(.pos-cart-table):not(.quick-sale-confirm-table) th,
.table-responsive > table:not(.pos-cart-table):not(.quick-sale-confirm-table) td {
    padding: 14px 16px;
    vertical-align: middle;
    border-bottom: 1px solid #edf1f5;
    text-align: right;
}

.data-table th,
.table-responsive > table:not(.pos-cart-table):not(.quick-sale-confirm-table) th {
    background: var(--page-header-bg);
    color: var(--table-head-text);
    font-size: 12px;
    line-height: 1.5;
    font-weight: 900;
    white-space: nowrap;
    border-bottom-color: #dfe6ee;
}

.data-table td,
.table-responsive > table:not(.pos-cart-table):not(.quick-sale-confirm-table) td {
    font-size: 13px;
}

.data-table tbody tr:last-child td,
.table-responsive > table:not(.pos-cart-table):not(.quick-sale-confirm-table) tbody tr:last-child td {
    border-bottom: 0;
}

.data-table tbody tr:hover td,
.table-responsive > table:not(.pos-cart-table):not(.quick-sale-confirm-table) tbody tr:hover td {
    background: var(--table-row-hover);
}

.numeric-cell {
    text-align: center !important;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.actions-cell {
    width: 1%;
    min-width: 96px;
    text-align: left !important;
    white-space: nowrap;
}

.document-number,
.date-value,
.time-value,
.money-value,
.money-pill {
    font-variant-numeric: tabular-nums;
}

.document-number {
    display: inline-block;
    direction: ltr;
    unicode-bidi: embed;
    white-space: nowrap;
    color: #1e40af;
}

.date-value,
.time-value {
    display: block;
    direction: ltr;
    unicode-bidi: embed;
    white-space: nowrap;
}

.time-value {
    margin-top: 3px;
    color: #94a3b8;
    font-size: 11px;
}

.entity-name {
    display: inline-block;
    min-width: 105px;
    line-height: 1.5;
}

.money-value {
    font-weight: 800;
    white-space: nowrap;
}

.muted-money {
    color: #64748b;
}

.money-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 88px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.money-total {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.money-paid,
.money-clear {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.money-due {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.empty-row td,
.empty-state {
    padding: 34px 18px !important;
    text-align: center !important;
    color: #64748b !important;
    font-weight: 700;
}

/* Pagination container is shared by all index screens when present. */
.pagination-wrap {
    margin-top: 14px;
}

.pagination-wrap nav,
.card nav {
    max-width: 100%;
}

/* Purchases index */
.purchases-table {
    min-width: 1060px;
}

.purchases-table td:first-child,
.purchases-table th:first-child {
    padding-right: 20px;
}

.purchases-table td:last-child,
.purchases-table th:last-child {
    padding-left: 20px;
}

@media (min-width: 900px) {
    .content > .card:first-child,
    .content > form.card:first-child {
        margin-top: 0;
    }

    .data-table-card {
        border-radius: var(--page-card-radius);
    }

    /* Make ordinary form layouts less cramped on laptop. */
    .grid-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .search-box {
        align-items: end;
    }
}

@media (max-width: 899px) {
    .page-filter-card {
        padding: 14px;
    }

    .page-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .page-filter-actions {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .page-filter-actions .btn {
        width: 100%;
        min-width: 0;
    }

    /* Purchases become readable cards on mobile instead of a squeezed 9-column row. */
    .purchases-list-card {
        padding: 0;
        overflow: visible;
        border: 0;
        background: transparent;
        box-shadow: none;
    }

    .purchases-list-card .table-responsive {
        overflow: visible;
    }

    .purchases-table,
    .purchases-table tbody,
    .purchases-table tr,
    .purchases-table td {
        display: block;
        width: 100%;
        min-width: 0;
    }

    .purchases-table thead {
        display: none;
    }

    .purchases-table tbody {
        display: grid;
        gap: 12px;
    }

    .purchases-table tbody tr {
        padding: 8px 14px;
        border: 1px solid #e2e8f0;
        border-radius: 15px;
        background: #fff;
        box-shadow: var(--shadow-card);
    }

    .purchases-table tbody tr:not(.empty-row) td {
        display: grid;
        grid-template-columns: minmax(118px, 42%) minmax(0, 1fr);
        align-items: center;
        gap: 12px;
        min-height: 44px;
        padding: 9px 2px;
        border-bottom: 1px solid #eef2f7;
        text-align: left !important;
    }

    .purchases-table tbody tr:not(.empty-row) td::before {
        content: attr(data-label);
        color: #64748b;
        font-size: 12px;
        font-weight: 800;
        text-align: right;
    }

    .purchases-table tbody tr:not(.empty-row) td:last-child {
        border-bottom: 0;
    }

    .purchases-table .document-number,
    .purchases-table .date-value,
    .purchases-table .time-value,
    .purchases-table .entity-name,
    .purchases-table .money-value,
    .purchases-table .money-pill {
        justify-self: end;
    }

    .purchases-table .actions-cell .btn {
        width: auto;
        min-width: 92px;
        justify-self: end;
    }

    .purchases-table .empty-row {
        padding: 0;
    }

    .purchases-table .empty-row td {
        display: block;
        border: 0;
    }
}

@media (max-width: 560px) {
    .page-filter-grid,
    .page-filter-actions {
        grid-template-columns: 1fr;
    }

    .purchases-table tbody tr:not(.empty-row) td {
        grid-template-columns: minmax(105px, 42%) minmax(0, 1fr);
    }
}

/* Partners and capital */
.badge-success {
    background: #ecfdf5;
    color: #047857;
}

.badge-muted {
    background: #f1f5f9;
    color: #64748b;
}

.partners-table {
    min-width: 820px;
}

@media (max-width: 899px) {
    .partners-table,
    .partners-table tbody,
    .partners-table tr,
    .partners-table td {
        display: block;
        width: 100%;
    }

    .partners-table {
        min-width: 0;
        background: transparent;
    }

    .partners-table thead {
        display: none;
    }

    .partners-table tbody {
        display: grid;
        gap: 10px;
        padding: 0;
    }

    .partners-table tbody tr {
        padding: 12px 14px;
        border: 1px solid #e2e8f0;
        border-radius: 16px;
        background: #fff;
        box-shadow: 0 6px 16px rgba(15, 23, 42, .05);
    }

    .partners-table tbody tr:hover td {
        background: transparent;
    }

    .partners-table td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 9px 0;
        border-bottom: 1px solid #eef2f7;
        text-align: left !important;
    }

    .partners-table td::before {
        content: attr(data-label);
        color: #64748b;
        font-size: 12px;
        font-weight: 800;
        text-align: right;
    }

    .partners-table td:first-child {
        align-items: flex-start;
    }

    .partners-table td:last-child {
        border-bottom: 0;
        padding-bottom: 0;
    }

    .partners-table .actions-cell .btn {
        width: 100%;
    }
}


/* Users create screen */
.users-create-form {
    display: grid;
    gap: 16px;
}

.users-form-section {
    margin-bottom: 0;
    padding: 20px;
}

.section-heading-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.section-eyebrow {
    color: var(--primary);
    font-size: 12px;
    font-weight: 900;
    margin-bottom: 3px;
}

.section-title {
    margin: 0;
    font-size: 20px;
    color: #111827;
}

.section-description {
    margin-top: 5px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.users-form-grid {
    align-items: start;
}

.field-hint {
    color: var(--muted);
    font-size: 11px;
    margin-top: 5px;
}

.users-role-note {
    margin-top: 4px;
    padding: 11px 13px;
    border-radius: 11px;
    background: #f8fafc;
    border: 1px solid var(--border);
    color: #475569;
    font-size: 12px;
    line-height: 1.7;
}

.permissions-heading {
    margin-bottom: 12px;
}

.permission-summary-box {
    min-width: 82px;
    padding: 10px 14px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    border-radius: 12px;
    text-align: center;
    direction: ltr;
}

.permission-summary-box span {
    display: block;
    font-size: 20px;
    line-height: 1;
    font-weight: 900;
    color: #1d4ed8;
}

.permission-summary-box small {
    display: block;
    margin-top: 5px;
    color: #64748b;
    font-size: 10px;
}

.permission-toolbar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 10px 0 14px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 14px;
}

.btn-compact {
    width: auto;
    min-height: 36px;
    padding: 7px 13px;
    font-size: 12px;
}

.users-permission-groups {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.users-permission-group {
    margin-bottom: 0;
    padding: 0;
    overflow: hidden;
}

.users-permission-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
}

.users-permission-group .permission-group-title {
    margin-bottom: 1px;
}

.group-select-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
    cursor: pointer;
    font-size: 11px;
    font-weight: 800;
    color: #475569;
}

.group-select-toggle input {
    width: 16px;
    height: 16px;
    min-height: auto;
}

.users-permission-group .permission-grid {
    padding: 12px;
    grid-template-columns: 1fr;
}

.users-permission-option {
    min-height: 58px;
    align-items: flex-start;
    background: #fff;
}

.users-permission-option:has(input:checked) {
    border-color: #93c5fd;
    background: #eff6ff;
}

.users-permission-option input {
    margin-top: 2px;
}

.users-permission-option span {
    display: grid;
    gap: 2px;
}

.users-permission-option strong {
    font-size: 12px;
    color: #1f2937;
}

.users-permission-option small {
    direction: ltr;
    text-align: left;
    color: #94a3b8;
    font-size: 9px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.users-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.users-form-actions .btn {
    width: auto;
    min-width: 130px;
}

@media (max-width: 1050px) {
    .users-permission-groups {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .users-form-section {
        padding: 14px;
    }

    .section-heading-row,
    .users-permission-group-header {
        align-items: stretch;
        flex-direction: column;
    }

    .permission-summary-box {
        min-width: 0;
        width: 100%;
    }

    .permission-toolbar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .permission-toolbar .btn,
    .users-form-actions .btn {
        width: 100%;
    }

    .users-form-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
}

.users-create-form .btn-light {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
}

.users-create-form .btn-light:hover {
    background: #e2e8f0;
}

/* v122 - Clothing store dashboard */
.dashboard-home {
    display: grid;
    gap: 16px;
}

.dashboard-welcome-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 24px 26px;
    border: 1px solid #dbeafe;
    border-radius: 20px;
    background: linear-gradient(135deg, #eff6ff 0%, #ffffff 58%, #f8fafc 100%);
    box-shadow: 0 12px 30px rgba(15, 23, 42, .06);
}

.dashboard-welcome-card h2 {
    margin: 4px 0 6px;
    font-size: 24px;
    color: #0f172a;
}

.dashboard-welcome-card p {
    margin: 0;
    color: #64748b;
    font-size: 13px;
}

.dashboard-eyebrow {
    display: block;
    color: #2563eb;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .01em;
}

.dashboard-welcome-value {
    min-width: 210px;
    text-align: left;
}

.dashboard-welcome-value span,
.dashboard-welcome-value small {
    display: block;
    color: #64748b;
    font-size: 12px;
}

.dashboard-welcome-value strong {
    display: inline-block;
    margin: 2px 0;
    color: #0f172a;
    font-size: 30px;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.dashboard-quick-actions {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
}

.dashboard-action {
    min-width: 0;
    padding: 14px 15px;
    border: 1px solid #e2e8f0;
    border-radius: 15px;
    background: #fff;
    color: #0f172a;
    text-decoration: none;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .04);
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.dashboard-action:hover {
    transform: translateY(-1px);
    border-color: #bfdbfe;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .07);
}

.dashboard-action strong,
.dashboard-action span {
    display: block;
}

.dashboard-action strong {
    font-size: 14px;
    margin-bottom: 4px;
}

.dashboard-action span {
    color: #64748b;
    font-size: 11px;
    line-height: 1.5;
}

.dashboard-action-primary {
    border-color: #2563eb;
    background: #2563eb;
    color: #fff;
}

.dashboard-action-primary span {
    color: #dbeafe;
}

.dashboard-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.dashboard-kpi {
    position: relative;
    overflow: hidden;
    min-height: 126px;
    padding: 17px 18px;
    border: 1px solid #e2e8f0;
    border-radius: 17px;
    background: #fff;
    box-shadow: 0 7px 20px rgba(15, 23, 42, .045);
}

.dashboard-kpi::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: #94a3b8;
}

.dashboard-kpi-label,
.dashboard-kpi small {
    display: block;
    color: #64748b;
}

.dashboard-kpi-label {
    font-size: 12px;
    font-weight: 700;
}

.dashboard-kpi strong {
    display: block;
    margin: 9px 0 6px;
    color: #0f172a;
    font-size: 25px;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.dashboard-kpi small {
    font-size: 11px;
    line-height: 1.4;
}

.dashboard-kpi-success::before { background: #16a34a; }
.dashboard-kpi-info::before { background: #2563eb; }
.dashboard-kpi-danger::before { background: #dc2626; }
.dashboard-kpi-warning::before { background: #d97706; }
.dashboard-kpi-purple::before { background: #7c3aed; }
.dashboard-kpi-dark::before { background: #0f172a; }

.dashboard-main-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.dashboard-panel {
    margin-bottom: 0;
    padding: 19px;
}

.dashboard-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 13px;
}

.dashboard-panel-head h3 {
    margin: 3px 0 0;
    color: #0f172a;
    font-size: 17px;
}

.dashboard-text-link {
    color: #2563eb;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.dashboard-summary-list {
    display: grid;
}

.dashboard-summary-list > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 43px;
    border-bottom: 1px solid #eef2f7;
    font-size: 13px;
}

.dashboard-summary-list > div:last-child {
    border-bottom: 0;
}

.dashboard-summary-list span {
    color: #475569;
}

.dashboard-summary-list strong {
    color: #0f172a;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.dashboard-panel-footer {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #eef2f7;
}

.dashboard-inline-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.dashboard-inline-links .btn,
.dashboard-panel-footer > .btn {
    width: auto;
}

.dashboard-latest-sales {
    overflow: hidden;
}

.dashboard-sale-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    min-height: 58px;
    padding: 10px 3px;
    border-bottom: 1px solid #eef2f7;
    color: inherit;
    text-decoration: none;
}

.dashboard-sale-row:last-child {
    border-bottom: 0;
}

.dashboard-sale-row:hover .dashboard-sale-main > strong {
    color: #2563eb;
}

.dashboard-sale-main,
.dashboard-sale-meta {
    min-width: 0;
}

.dashboard-sale-main strong,
.dashboard-sale-main span,
.dashboard-sale-meta span,
.dashboard-sale-meta strong {
    display: block;
}

.dashboard-sale-main strong {
    margin-bottom: 3px;
    color: #0f172a;
    font-size: 13px;
}

.dashboard-sale-main span,
.dashboard-sale-meta span {
    color: #64748b;
    font-size: 11px;
}

.dashboard-sale-meta {
    text-align: left;
}

.dashboard-sale-meta strong {
    margin-top: 3px;
    color: #16a34a;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.dashboard-empty-state {
    padding: 24px 10px;
    text-align: center;
    color: #64748b;
    font-size: 13px;
}

.dashboard-stock-alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 18px;
    border: 1px solid #fecaca;
    border-radius: 16px;
    background: #fff7f7;
}

.dashboard-stock-alert strong,
.dashboard-stock-alert span {
    display: block;
}

.dashboard-stock-alert strong {
    color: #991b1b;
    font-size: 13px;
}

.dashboard-stock-alert span {
    margin-top: 4px;
    color: #7f1d1d;
    font-size: 11px;
}

.dashboard-stock-alert .btn {
    width: auto;
    white-space: nowrap;
}

@media (max-width: 1280px) {
    .dashboard-quick-actions {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .dashboard-kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 899px) {
    .dashboard-welcome-card {
        padding: 18px;
    }

    .dashboard-welcome-value strong {
        font-size: 25px;
    }

    .dashboard-quick-actions,
    .dashboard-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-main-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .dashboard-home {
        gap: 12px;
    }

    .dashboard-welcome-card {
        align-items: flex-start;
        flex-direction: column;
        gap: 14px;
        border-radius: 16px;
    }

    .dashboard-welcome-card h2 {
        font-size: 20px;
    }

    .dashboard-welcome-value {
        width: 100%;
        min-width: 0;
        text-align: right;
        padding-top: 12px;
        border-top: 1px solid #dbeafe;
    }

    .dashboard-quick-actions,
    .dashboard-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .dashboard-action {
        min-height: 78px;
        padding: 12px;
    }

    .dashboard-kpi {
        min-height: 118px;
        padding: 14px;
    }

    .dashboard-kpi strong {
        font-size: 21px;
    }

    .dashboard-panel {
        padding: 15px;
    }

    .dashboard-panel-head {
        align-items: flex-start;
    }

    .dashboard-summary-list > div {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
        padding: 9px 0;
    }

    .dashboard-sale-row {
        gap: 10px;
    }

    .dashboard-stock-alert {
        align-items: stretch;
        flex-direction: column;
    }

    .dashboard-stock-alert .btn {
        width: 100%;
    }
}

/* Product media + SHEIN import */
.shein-import-panel {
    margin-bottom: 18px;
    padding: 16px;
    border: 1px solid #cfdbe6;
    border-radius: 16px;
    background: linear-gradient(180deg, #fbfdff 0%, #f5f9fd 100%);
}

.shein-import-head,
.shein-import-row,
.product-detail-head,
.product-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.shein-import-head {
    justify-content: space-between;
    margin-bottom: 12px;
}

.shein-import-row {
    align-items: stretch;
}

.shein-import-row input {
    flex: 1;
    min-width: 0;
}

.shein-import-status {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
}

.shein-import-status.loading,
.shein-import-status.warning {
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fed7aa;
}

.shein-import-status.success {
    background: #ecfdf5;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.shein-import-status.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.shein-source-summary {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.shein-source-summary > div {
    padding: 10px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid var(--border);
}

.shein-source-summary span {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.shein-source-summary input {
    min-height: 38px;
    background: #f8fafc;
}

.product-media-grid {
    display: grid;
    grid-template-columns: minmax(240px, .72fr) minmax(0, 1.28fr);
    gap: 18px;
    align-items: start;
    margin-bottom: 16px;
}

.product-image-field > label:first-child {
    display: block;
    margin-bottom: 8px;
    font-weight: 800;
}

.product-image-preview-wrap {
    width: 100%;
    aspect-ratio: 4 / 3;
    margin-bottom: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #f8fafc;
}

.product-image-preview {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    background: #fff;
}

.product-image-placeholder {
    width: 100%;
    height: 100%;
    display: grid;
    place-content: center;
    text-align: center;
    color: var(--muted);
    gap: 5px;
}

.product-image-placeholder span {
    font-size: 24px;
    font-weight: 900;
}

.product-remove-image {
    display: flex;
    gap: 7px;
    align-items: center;
    margin-top: 8px;
    font-size: 13px;
    font-weight: 600;
}

.product-remove-image input {
    width: auto;
}

.source-option-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 7px;
}

.source-option-chip {
    padding: 5px 9px;
    border: 1px solid #cfdbe6;
    border-radius: 999px;
    background: #f8fbff;
    color: #24465f;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}

.source-option-chip:hover {
    background: #eaf4fb;
}

.product-list-item {
    align-items: flex-start;
}

.product-list-media {
    flex: 0 0 86px;
}

.product-list-body {
    flex: 1;
    min-width: 0;
}

.product-list-thumb {
    width: 86px;
    height: 86px;
    display: block;
    object-fit: cover;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
}

.product-list-thumb-empty {
    display: grid;
    place-items: center;
    padding: 8px;
    text-align: center;
    color: var(--muted);
    font-size: 10px;
    background: #f8fafc;
}

.product-detail-head {
    align-items: flex-start;
    margin-bottom: 14px;
}

.product-detail-image {
    width: 150px;
    height: 150px;
    flex: 0 0 150px;
    object-fit: contain;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fff;
}

.product-source-link {
    display: inline-flex;
    font-size: 12px;
    font-weight: 800;
}

.quick-product-image {
    width: 100%;
    height: 120px;
    display: block;
    object-fit: contain;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid var(--border);
}

@media (max-width: 700px) {
    .shein-import-row,
    .product-detail-head,
    .product-list-item {
        align-items: stretch;
    }

    .shein-import-row {
        flex-direction: column;
    }

    .shein-source-summary,
    .product-media-grid {
        grid-template-columns: 1fr;
    }

    .product-list-media {
        flex: 0 0 72px;
    }

    .product-list-thumb {
        width: 72px;
        height: 72px;
    }

    .product-detail-head {
        flex-direction: column;
    }

    .product-detail-image {
        width: 100%;
        height: auto;
        max-height: 320px;
        flex-basis: auto;
    }
}

/* SHEIN browser importer */
.shein-browser-box {
    margin: 12px 0;
    padding: 14px;
    border: 1px solid #bad7ea;
    border-radius: 14px;
    background: linear-gradient(180deg, #f7fcff 0%, #eef8fd 100%);
}

.shein-browser-title {
    margin-bottom: 5px;
    color: #163b53;
    font-size: 13px;
    font-weight: 900;
}

.shein-browser-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.shein-bookmarklet-link {
    cursor: grab;
    user-select: none;
}

.shein-bookmarklet-link:active {
    cursor: grabbing;
}

.shein-browser-note {
    margin-top: 8px;
}

.shein-server-fallback {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #cbd9e3;
}

@media (max-width: 700px) {
    .shein-browser-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .shein-browser-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Batch clothing product creation */
.product-combination-builder {
    margin: 18px 0;
    padding: 16px;
    border: 1px solid #dfe6ef;
    border-radius: 14px;
    background: #fbfdff;
}
.combination-builder-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.combination-builder-head h3 {
    margin: 0 0 4px;
    font-size: 18px;
}
.combination-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.combination-table-wrap {
    margin-top: 10px;
}
.combination-table th,
.combination-table td {
    vertical-align: middle;
    white-space: nowrap;
}
.combination-table input {
    min-width: 110px;
    margin: 0;
}
.combination-table [data-field="color"] {
    min-width: 140px;
}
.combination-table [data-field="barcode"] {
    min-width: 170px;
}
.combination-table [data-field="sale_price"] {
    min-width: 105px;
}
.combination-row-number {
    width: 44px;
    text-align: center;
    font-weight: 800;
    color: #64748b;
}
.combination-remove {
    min-width: 38px;
    padding-inline: 10px;
}
.combination-empty {
    padding: 18px;
    text-align: center;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    color: #64748b;
    background: #fff;
}
.product-batch-note {
    margin: 14px 0 18px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #bae6fd;
    background: #f0f9ff;
    color: #0c4a6e;
    line-height: 1.7;
}

@media (max-width: 700px) {
    .product-combination-builder {
        padding: 12px;
    }
    .combination-builder-head {
        flex-direction: column;
    }
    .combination-actions .btn {
        width: 100%;
    }
}

/* v126 - Purchase POS + product variants */
.purchase-pos-shell { display:grid; gap:14px; }
.purchase-pos-topbar { display:grid; grid-template-columns:minmax(220px,1.1fr) minmax(190px,.75fr) minmax(280px,1fr); gap:14px; align-items:end; margin:0; }
.purchase-pos-topbar .form-group { margin:0; }
.purchase-pos-input-action { display:flex; gap:8px; }
.purchase-pos-input-action input { flex:1; }
.purchase-pos-workspace { display:grid; grid-template-columns:minmax(330px,1.05fr) minmax(300px,.9fr) minmax(370px,1fr); gap:14px; align-items:start; }
.purchase-pos-workspace > .card { margin:0; min-height:560px; }
.purchase-pos-section-head { display:flex; justify-content:space-between; gap:12px; align-items:center; padding-bottom:12px; border-bottom:1px solid #e5e7eb; margin-bottom:12px; }
.purchase-pos-section-head > div { display:flex; flex-direction:column; gap:3px; }
.purchase-pos-section-head strong { font-size:16px; }
.purchase-pos-section-head span { color:#64748b; font-size:12px; }
.purchase-pos-search-row { display:grid; grid-template-columns:1fr 150px; gap:8px; margin-bottom:12px; }
.purchase-product-grid { display:grid; gap:8px; max-height:475px; overflow:auto; padding-left:3px; }
.purchase-product-card { width:100%; border:1px solid #e2e8f0; background:#fff; border-radius:12px; padding:9px; display:grid; grid-template-columns:62px 1fr; gap:10px; text-align:right; cursor:pointer; color:#0f172a; }
.purchase-product-card:hover { border-color:#94a3b8; background:#f8fafc; }
.purchase-product-card.selected { border-color:#2563eb; background:#eff6ff; box-shadow:0 0 0 1px #2563eb inset; }
.purchase-product-card img,.purchase-product-no-image { width:62px; height:62px; border-radius:10px; object-fit:cover; background:#f1f5f9; display:flex; align-items:center; justify-content:center; color:#94a3b8; font-size:11px; }
.purchase-product-card-copy { min-width:0; display:flex; flex-direction:column; gap:4px; }
.purchase-product-card-copy strong { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-size:14px; }
.purchase-product-card-copy span,.purchase-product-card-copy small { color:#64748b; font-size:11px; }
.purchase-variant-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; max-height:485px; overflow:auto; }
.purchase-variant-card { border:1px solid #e2e8f0; background:#fff; border-radius:12px; padding:11px; text-align:right; cursor:pointer; display:flex; flex-direction:column; gap:7px; color:#0f172a; }
.purchase-variant-card:hover { border-color:#2563eb; background:#f8fbff; }
.purchase-variant-card.in-cart { border-color:#16a34a; background:#f0fdf4; }
.purchase-variant-title { display:flex; justify-content:space-between; gap:8px; align-items:center; }
.purchase-variant-title b { background:#e2e8f0; border-radius:999px; padding:3px 8px; font-size:12px; }
.purchase-variant-meta { display:flex; flex-wrap:wrap; gap:6px; color:#64748b; font-size:11px; }
.purchase-variant-card small { color:#64748b; direction:ltr; text-align:right; }
.purchase-variant-card em { font-style:normal; color:#2563eb; font-size:12px; font-weight:700; }
.purchase-variant-card.in-cart em { color:#15803d; }
.purchase-pos-empty { color:#94a3b8; text-align:center; padding:35px 12px; grid-column:1/-1; }
.purchase-cart-rows { display:grid; gap:8px; max-height:360px; overflow:auto; padding-left:2px; }
.purchase-cart-row { display:grid; grid-template-columns:minmax(130px,1.4fr) 78px 100px 82px 32px; gap:7px; align-items:end; border:1px solid #e2e8f0; border-radius:11px; padding:9px; background:#fff; }
.purchase-cart-product { min-width:0; display:flex; flex-direction:column; gap:3px; align-self:center; }
.purchase-cart-product strong { font-size:12px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.purchase-cart-product span { font-size:11px; color:#64748b; }
.purchase-cart-row label { margin:0; font-size:10px; color:#64748b; }
.purchase-cart-row input { padding:7px 6px; min-height:36px; margin-top:3px; }
.purchase-cart-line { display:flex; flex-direction:column; gap:3px; align-self:center; }
.purchase-cart-line span { font-size:10px; color:#64748b; }
.purchase-cart-line strong { font-size:12px; }
.purchase-cart-remove { width:30px; height:34px; border:0; border-radius:8px; background:#fee2e2; color:#b91c1c; font-size:18px; cursor:pointer; }
.purchase-pos-summary { margin-top:14px; border-top:1px solid #e2e8f0; padding-top:12px; display:grid; gap:7px; }
.purchase-pos-summary > div { display:flex; justify-content:space-between; gap:10px; }
.purchase-pos-summary .total { border-top:1px dashed #cbd5e1; padding-top:9px; font-size:17px; color:#0f5fd7; }
.purchase-pos-footer-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.purchase-pos-footer-grid .card,.purchase-pos-save-card { margin:0; }
.purchase-pos-save-card { display:grid; grid-template-columns:1fr auto; align-items:end; gap:14px; }
.btn-small { padding:6px 9px; min-height:auto; }
.btn-lg { min-height:46px; padding-inline:24px; }

@media (max-width: 1250px) {
    .purchase-pos-workspace { grid-template-columns:1fr 1fr; }
    .purchase-pos-cart { grid-column:1/-1; min-height:auto !important; }
    .purchase-cart-rows { max-height:300px; }
}
@media (max-width: 820px) {
    .purchase-pos-topbar,.purchase-pos-workspace,.purchase-pos-footer-grid,.purchase-pos-save-card { grid-template-columns:1fr; }
    .purchase-pos-workspace > .card { min-height:auto; }
    .purchase-product-grid,.purchase-variant-grid { max-height:none; }
    .purchase-variant-grid { grid-template-columns:1fr 1fr; }
    .purchase-cart-row { grid-template-columns:1fr 1fr; }
    .purchase-cart-product { grid-column:1/-1; }
    .purchase-cart-remove { position:absolute; margin-right:calc(100% - 44px); }
    .purchase-pos-search-row { grid-template-columns:1fr; }
}
@media (max-width: 520px) {
    .purchase-variant-grid { grid-template-columns:1fr; }
    .purchase-pos-input-action { flex-direction:column; }
}


/* v128 - Purchase POS compact catalog */
.purchase-pos2-shell { display:grid; gap:14px; }
.purchase-pos2-header { margin:0; display:grid; grid-template-columns:minmax(220px,1fr) minmax(190px,.72fr) minmax(300px,1.15fr); gap:14px; align-items:end; }
.purchase-pos2-header .form-group { margin:0; }
.purchase-pos2-input-action { display:flex; gap:8px; }
.purchase-pos2-input-action input { flex:1; min-width:0; }

.purchase-pos2-layout { display:grid; grid-template-columns:minmax(0,1.8fr) minmax(340px,.82fr); gap:14px; align-items:start; }
.purchase-pos2-catalog,.purchase-pos2-cart { margin:0; }
.purchase-pos2-catalog { min-width:0; }
.purchase-pos2-cart { position:sticky; top:14px; }

.purchase-pos2-toolbar { display:grid; gap:10px; margin-bottom:12px; }
.purchase-pos2-title { display:flex; justify-content:space-between; align-items:center; gap:10px; }
.purchase-pos2-title strong { font-size:18px; }
.purchase-pos2-title span { color:#64748b; font-size:12px; background:#f1f5f9; border-radius:999px; padding:5px 9px; }
.purchase-pos2-searches { display:grid; grid-template-columns:minmax(0,1fr) 170px; gap:8px; }

.purchase-pos2-selected { border:1px solid #bfdbfe; background:#f8fbff; border-radius:14px; padding:11px; margin-bottom:12px; }
.purchase-pos2-selected[hidden] { display:none !important; }
.purchase-pos2-selected-head { display:flex; justify-content:space-between; gap:12px; align-items:center; margin-bottom:10px; }
.purchase-pos2-selected-info { display:flex; gap:10px; align-items:center; min-width:0; }
.purchase-pos2-selected-info img { width:48px !important; height:48px !important; max-width:48px !important; max-height:48px !important; min-width:48px; border-radius:9px; object-fit:cover !important; background:#e2e8f0; }
.purchase-pos2-selected-info > div { min-width:0; display:flex; flex-direction:column; gap:2px; }
.purchase-pos2-selected-info strong { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.purchase-pos2-selected-info span,.purchase-pos2-help { color:#64748b; font-size:11px; }

.purchase-pos2-variants { display:flex; flex-wrap:wrap; gap:7px; }
.purchase-pos2-variant { min-width:132px; border:1px solid #cbd5e1; background:#fff; border-radius:10px; padding:8px 10px; cursor:pointer; display:flex; flex-direction:column; gap:4px; text-align:right; color:#0f172a; }
.purchase-pos2-variant:hover { border-color:#2563eb; background:#eff6ff; }
.purchase-pos2-variant.in-cart { border-color:#16a34a; background:#f0fdf4; box-shadow:0 0 0 1px #16a34a inset; }
.purchase-pos2-variant-main { display:flex; justify-content:space-between; align-items:center; gap:7px; }
.purchase-pos2-variant-main b { font-size:12px; }
.purchase-pos2-variant-main strong { background:#e2e8f0; border-radius:999px; padding:2px 7px; font-size:11px; }
.purchase-pos2-variant-meta,.purchase-pos2-variant small { color:#64748b; font-size:10px; }

.purchase-pos2-products { display:grid; grid-template-columns:repeat(auto-fill,minmax(210px,1fr)); gap:8px; max-height:610px; overflow:auto; padding:1px 0 2px 2px; align-items:start; }
.purchase-pos2-product { width:100%; min-width:0; border:1px solid #e2e8f0; background:#fff; border-radius:12px; padding:8px; display:grid; grid-template-columns:72px minmax(0,1fr); gap:9px; align-items:center; text-align:right; cursor:pointer; color:#0f172a; overflow:hidden; }
.purchase-pos2-product:hover { border-color:#93c5fd; background:#f8fbff; }
.purchase-pos2-product.selected { border-color:#2563eb; background:#eff6ff; box-shadow:0 0 0 1px #2563eb inset; }
.purchase-pos2-product-image { width:72px !important; height:72px !important; min-width:72px; max-width:72px; overflow:hidden; border-radius:9px; background:#f1f5f9; display:flex; align-items:center; justify-content:center; }
.purchase-pos2-thumb { width:72px !important; height:72px !important; max-width:72px !important; max-height:72px !important; min-width:72px; min-height:72px; object-fit:cover !important; border-radius:9px; display:block !important; }
.purchase-pos2-no-image { width:72px !important; height:72px !important; font-size:10px; color:#94a3b8; text-align:center; }
.purchase-pos2-product-copy { min-width:0; display:flex; flex-direction:column; gap:4px; }
.purchase-pos2-product-copy strong { font-size:13px; line-height:1.45; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.purchase-pos2-product-copy span,.purchase-pos2-product-copy small { color:#64748b; font-size:10.5px; }
.purchase-pos2-empty { grid-column:1/-1; padding:28px 10px; color:#94a3b8; text-align:center; }

.purchase-pos2-cart-head { display:flex; justify-content:space-between; align-items:center; gap:10px; border-bottom:1px solid #e2e8f0; padding-bottom:10px; margin-bottom:10px; }
.purchase-pos2-cart-head > div { display:flex; flex-direction:column; gap:3px; }
.purchase-pos2-cart-head strong { font-size:16px; }
.purchase-pos2-cart-head span { font-size:11px; color:#64748b; }
.purchase-pos2-cart-rows { display:grid; gap:8px; max-height:460px; overflow:auto; padding-left:2px; }
.purchase-pos2-cart-row { border:1px solid #e2e8f0; border-radius:11px; padding:9px; display:grid; gap:8px; background:#fff; }
.purchase-pos2-cart-product { display:flex; justify-content:space-between; gap:10px; align-items:start; }
.purchase-pos2-cart-product strong { font-size:12px; line-height:1.4; }
.purchase-pos2-cart-product span { white-space:nowrap; background:#eff6ff; color:#1d4ed8; border-radius:999px; padding:3px 7px; font-size:10px; }
.purchase-pos2-cart-fields { display:grid; grid-template-columns:1fr 1fr; gap:7px; }
.purchase-pos2-cart-fields label { margin:0; font-size:10px; color:#64748b; }
.purchase-pos2-cart-fields input { margin-top:3px; padding:7px; min-height:35px; }
.purchase-pos2-cart-bottom { display:flex; justify-content:space-between; align-items:center; gap:8px; }
.purchase-pos2-cart-bottom > span { font-size:11px; }
.purchase-pos2-remove { border:0; border-radius:7px; padding:5px 8px; background:#fee2e2; color:#b91c1c; cursor:pointer; font-size:10px; }
.purchase-pos2-summary { margin-top:12px; border-top:1px solid #e2e8f0; padding-top:10px; display:grid; gap:6px; }
.purchase-pos2-summary > div { display:flex; justify-content:space-between; gap:10px; font-size:12px; }
.purchase-pos2-summary .total { font-size:16px; color:#0f5fd7; border-top:1px dashed #cbd5e1; padding-top:8px; }

@media (max-width: 1180px) {
    .purchase-pos2-layout { grid-template-columns:minmax(0,1.45fr) minmax(320px,.85fr); }
    .purchase-pos2-products { grid-template-columns:repeat(auto-fill,minmax(190px,1fr)); }
}
@media (max-width: 900px) {
    .purchase-pos2-header,.purchase-pos2-layout,.purchase-pos-footer-grid,.purchase-pos-save-card { grid-template-columns:1fr; }
    .purchase-pos2-cart { position:static; }
    .purchase-pos2-products { max-height:none; grid-template-columns:repeat(2,minmax(0,1fr)); }
    .purchase-pos2-searches { grid-template-columns:1fr; }
}
@media (max-width: 600px) {
    .purchase-pos2-products { grid-template-columns:1fr; }
    .purchase-pos2-selected-head { align-items:flex-start; }
    .purchase-pos2-help { display:none; }
    .purchase-pos2-variant { min-width:calc(50% - 4px); flex:1 1 calc(50% - 4px); }
    .purchase-pos2-input-action { flex-direction:column; }
}


/* v129 - Purchase allocated inventory costs */
.purchase-pos-footer-grid-3 { grid-template-columns:repeat(3,minmax(0,1fr)); }
.purchase-pos2-cost-allocation { display:flex; justify-content:space-between; gap:8px; align-items:center; padding-top:6px; border-top:1px dashed #e2e8f0; font-size:10px; color:#475569; }
.purchase-pos2-cost-allocation strong { color:#0f172a; }
.purchase-pos2-cost-allocation .loaded-cost { color:#0f766e; }
@media (max-width:1100px) { .purchase-pos-footer-grid-3 { grid-template-columns:1fr 1fr; } }
@media (max-width:900px) { .purchase-pos-footer-grid-3 { grid-template-columns:1fr; } }
