@import url('fonts/fonts.css');

/* Instant theme switching (disables transitions temporarily to eliminate UI freeze/lag) */
.theme-switching,
.theme-switching *,
.theme-switching *::before,
.theme-switching *::after {
    -webkit-transition: none !important;
    -moz-transition: none !important;
    -o-transition: none !important;
    transition: none !important;
    -webkit-animation: none !important;
    animation: none !important;
}

/* Arrival detail in product history: keep item names readable and serials stacked. */
.ph-arrival-info-card {
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 14px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 24px;
}

.ph-arrival-info-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    min-width: 0;
    margin-bottom: 8px;
    font-size: 0.84rem;
}

.ph-arrival-info-row>span {
    color: #9ca3af;
    flex: 0 0 150px;
}

.ph-arrival-info-row>strong {
    color: #f9fafb;
    min-width: 0;
    overflow-wrap: anywhere;
}

.ph-arrival-items-title {
    font-weight: 600;
    color: white;
    margin: 2px 0 8px;
    font-size: 0.9rem;
}

.ph-arrival-table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #1e293b;
    border-radius: 7px;
}

.ph-arrival-table {
    width: 100%;
    min-width: 760px;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.ph-arrival-table th,
.ph-arrival-table td {
    padding: 9px 10px;
    border-bottom: 1px solid #1e3a5f;
    vertical-align: top;
}

.ph-arrival-table th {
    text-align: left;
    white-space: normal;
}

.ph-arrival-table .ph-col-product {
    width: 31%;
}

.ph-arrival-table .ph-col-sku {
    width: 13%;
}

.ph-arrival-table .ph-col-qty {
    width: 7%;
}

.ph-arrival-table .ph-col-price {
    width: 10%;
}

.ph-arrival-table .ph-col-total {
    width: 11%;
}

.ph-arrival-table .ph-col-serials {
    width: 28%;
}

.ph-arrival-table .ph-arrival-product {
    color: #f9fafb;
    font-weight: 600;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.ph-arrival-table .ph-arrival-sku {
    color: #9ca3af;
    font-family: monospace;
    font-size: 0.75rem;
    overflow-wrap: anywhere;
}

.ph-arrival-table .ph-arrival-qty {
    text-align: center;
    color: #10b981;
    font-weight: 700;
}

.ph-arrival-table .ph-arrival-price {
    text-align: right;
    color: #cbd5e1;
    white-space: nowrap;
}

.ph-arrival-table .ph-arrival-total {
    text-align: right;
    color: #10b981;
    font-weight: 700;
    white-space: nowrap;
}

.ph-arrival-serial-list {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
}

.ph-arrival-serial-list .ph-sn-chip {
    display: inline-block;
    max-width: 100%;
    margin: 0;
    overflow-wrap: anywhere;
    white-space: normal;
    line-height: 1.35;
}

.ph-arrival-no-serials {
    color: #6b7280;
}

@media (max-width: 760px) {
    .ph-arrival-info-card {
        grid-template-columns: 1fr;
        column-gap: 0;
    }

    .ph-arrival-info-row>span {
        flex-basis: 135px;
    }

    .ph-arrival-table {
        min-width: 680px;
    }
}

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

body {
    font-family: 'Noto Sans Armenian', 'Inter', system-ui, sans-serif;
    background: radial-gradient(circle at top right, #0d1526, #070b14);
    color: #e2e8f0;
    overflow: hidden;
}

.glass {
    background: rgba(17, 24, 39, 0.7);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: #1e293b;
}

::-webkit-scrollbar-thumb {
    background: #4f46e5;
    border-radius: 5px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: .85rem;
    color: #94a3b8;
    transition: all .15s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.nav-link:hover {
    background: rgba(99, 102, 241, .12);
    color: #c7d2fe;
}

.nav-link.active {
    background: rgba(99, 102, 241, .2);
    color: #818cf8;
    font-weight: 600;
}

.tab-panel {
    display: none;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
}

.tab-panel.active {
    display: flex;
}

.card {
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

#cartBadge {
    background: #4f46e5;
    color: white;
    border-radius: 20px;
    padding: 2px 8px;
    font-size: 1.25rem;
    font-weight: 700;
    margin-left: 8px;
}

.card-title {
    font-size: 1.1rem;
    color: #e2e8f0;
    margin-bottom: 12px;
    font-weight: 600;
}

#auditTableContainer {
    height: 100%;
}

.card-premium {
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.8), rgba(13, 21, 38, 0.9));
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
}

.inp {
    background: #0a0f1e;
    border: 1px solid #1f2937;
    border-radius: 7px;
    color: #e2e8f0;
    padding: 7px 11px;
    outline: none;
    transition: border .15s;
    width: 100%;
    font-size: .85rem;
}

.inp:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, .2);
}

.inp::-webkit-input-placeholder {
    color: #4b5563;
}

.inp::-moz-placeholder {
    color: #4b5563;
}

.inp:-ms-input-placeholder {
    color: #4b5563;
}

.inp::-ms-input-placeholder {
    color: #4b5563;
}

.inp::placeholder {
    color: #4b5563;
}

/* Counterparty Search Dropdown */
#cpDropdown::-webkit-scrollbar {
    width: 4px;
}

#cpDropdown::-webkit-scrollbar-thumb {
    background: #4b5563;
    border-radius: 2px;
}

#cpClearBtn:hover {
    color: #f3f4f6 !important;
}

select option {
    background: #111827;
    color: #e2e8f0;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea,
button {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

input[type="checkbox"],
input[type="radio"] {
    -webkit-appearance: checkbox;
    -moz-appearance: checkbox;
    appearance: checkbox;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #4f46e5;
}

.btn {
    border-radius: 7px;
    padding: 7px 14px;
    font-weight: 500;
    font-size: .82rem;
    cursor: pointer;
    transition: all .15s;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
}

.btn-primary:hover {
    opacity: .9;
    transform: translateY(-1px);
}

/* Multiple Products Table Styles */
#productsTable {
    background: #0a0f1e;
    color: #e2e8f0;
    width: 100%;
}

#productsTable thead th {
    background: #1a2035;
    color: #d1d5db;
    font-weight: 600;
    padding: 10px;
    text-align: left;
    border: 1px solid #374151;
}

#productsTable tbody tr {
    border-bottom: 1px solid #1f2937;
    transition: background 0.15s;
}

#productsTable tbody tr:hover {
    background: #111827;
}

#productsTable td {
    padding: 6px;
    border-right: 1px solid #374151;
}

#productsTable input.inp,
#productsTable select.inp {
    width: 100%;
    background: #0a0f1e;
    border: 1px solid #1f2937;
    color: #e2e8f0;
    padding: 4px;
    border-radius: 4px;
    font-size: 0.75rem;
}

#productsTable input.inp:focus,
#productsTable select.inp:focus {
    border-color: #6366f1;
    outline: none;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

/* ==========================================================================
   Arrival Voucher Modal (Մուտքի Անդորրագիր) - Modern ERP Redesign
   ========================================================================== */
.arrival-modal-dialog {
    width: 96vw !important;
    max-width: 1560px !important;
    max-height: 94vh !important;
    background: rgba(15, 23, 42, 0.98) !important;
    backdrop-filter: blur(24px) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 18px !important;
    box-shadow: 0 25px 70px -15px rgba(0, 0, 0, 0.85), 0 0 40px rgba(99, 102, 241, 0.12) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    padding: 0 !important;
}

.arrival-modal-header {
    padding: 14px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.92));
    flex-shrink: 0;
    gap: 16px;
}

.arrival-modal-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.arrival-modal-icon-badge {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(139, 92, 246, 0.15));
    border: 1px solid rgba(99, 102, 241, 0.4);
    color: #818cf8;
    font-size: 1.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
    flex-shrink: 0;
}

.arrival-modal-title {
    font-weight: 800;
    font-size: 1.18rem;
    color: #ffffff;
    letter-spacing: -0.01em;
    line-height: 1.25;
}

.arrival-modal-subtitle {
    font-size: 0.76rem;
    color: #94a3b8;
    margin-top: 2px;
}

.arrival-modal-header-center {
    display: flex;
    align-items: center;
}

.arrival-doc-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: 9999px;
    font-size: 0.82rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 2px 10px rgba(0, 0, 0, 0.3);
}

.arrival-doc-badge-icon {
    font-size: 0.85rem;
}

.arrival-doc-badge-label {
    color: #94a3b8;
    font-weight: 500;
}

.arrival-doc-badge-val {
    color: #a5b4fc;
    font-weight: 700;
}

.arrival-modal-close-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    font-size: 1.15rem;
    cursor: pointer;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.arrival-modal-close-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
    transform: rotate(90deg);
}

.arrival-modal-form {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow-y: auto;
    padding: 16px 22px 12px;
    gap: 14px;
}

.arrival-header-grid {
    display: grid;
    grid-template-columns: 1fr 370px;
    gap: 14px;
    flex-shrink: 0;
}

@media (max-width: 1200px) {
    .arrival-header-grid {
        grid-template-columns: 1fr;
    }
}

.arrival-header-card {
    background: rgba(22, 30, 49, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.arrival-card-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #cbd5e1;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.arrival-card-title-icon {
    font-size: 0.95rem;
}

.arrival-form-row-3 {
    display: grid;
    grid-template-columns: 1.1fr 1.1fr 1.3fr;
    gap: 12px;
    align-items: flex-end;
}

@media (max-width: 900px) {
    .arrival-form-row-3 {
        grid-template-columns: 1fr;
    }
}

.arrival-form-row-2 {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

@media (max-width: 900px) {
    .arrival-form-row-2 {
        flex-direction: column;
        align-items: stretch;
    }
}

.arrival-field-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.arrival-field-label {
    font-size: 0.73rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.arrival-req {
    color: #f87171;
}

.arrival-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.arrival-input-icon {
    position: absolute;
    left: 10px;
    font-size: 0.85rem;
    color: #64748b;
    pointer-events: none;
    z-index: 2;
}

.arrival-input-wrapper .arrival-inp {
    padding-left: 32px !important;
}

.arrival-inp {
    width: 100%;
    background: rgba(15, 23, 42, 0.75) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #f8fafc !important;
    border-radius: 8px !important;
    font-size: 0.83rem !important;
    padding: 7px 11px !important;
    height: 38px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.arrival-inp:focus {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.22) !important;
    background: rgba(26, 38, 66, 0.9) !important;
    outline: none;
}

.arrival-select {
    cursor: pointer;
}

.arrival-rate-group {
    flex-shrink: 0;
}

.arrival-currency-group {
    display: flex;
    gap: 6px;
}

.arrival-currency-group .arrival-inp:first-child {
    width: 100px;
}

.arrival-curr-select {
    width: 115px !important;
    flex-shrink: 0;
}

.arrival-cp-clear-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.08);
    border: none;
    cursor: pointer;
    color: #94a3b8;
    font-size: 13px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    z-index: 3;
}

.arrival-cp-clear-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.arrival-cp-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    max-height: 220px;
    overflow-y: auto;
    z-index: 10000;
    display: none;
    box-shadow: 0 12px 30px -5px rgba(0, 0, 0, 0.7);
}

.arrival-cp-item:hover {
    background: rgba(99, 102, 241, 0.15) !important;
}

/* Card Summary / Audit & KPI */
.arrival-card-summary {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.arrival-audit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.arrival-audit-chip {
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 7px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.arrival-audit-label {
    font-size: 0.68rem;
    color: #94a3b8;
    font-weight: 500;
}

.arrival-audit-val {
    font-size: 0.8rem;
    font-weight: 700;
    color: #f1f5f9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.arrival-audit-date {
    font-size: 0.65rem;
    color: #64748b;
    white-space: nowrap;
}

.arrival-total-card {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.14), rgba(5, 150, 105, 0.06));
    border: 1px solid rgba(16, 185, 129, 0.32);
    border-radius: 12px;
    padding: 10px 14px;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.1);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.arrival-total-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.arrival-total-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #6ee7b7;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.arrival-total-badge {
    font-size: 0.68rem;
    font-weight: 800;
    background: rgba(16, 185, 129, 0.22);
    color: #34d399;
    padding: 2px 7px;
    border-radius: 6px;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.arrival-total-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: #10b981;
    line-height: 1.15;
    margin-top: 4px;
    text-shadow: 0 2px 12px rgba(16, 185, 129, 0.25);
    letter-spacing: -0.01em;
}

/* Table Toolbar */
.arrival-table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2px;
    flex-shrink: 0;
}

.arrival-toolbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.arrival-toolbar-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #f1f5f9;
}

.arrival-toolbar-count {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 9px;
    border-radius: 9999px;
}

.arrival-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 18px !important;
    font-size: 0.83rem !important;
    font-weight: 600 !important;
    border-radius: 9px !important;
    background: linear-gradient(135deg, #4f46e5, #6366f1) !important;
    border: none !important;
    color: #fff !important;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35) !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    cursor: pointer;
}

.arrival-add-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5) !important;
}

/* Products Table Wrapper */
.arrival-table-wrapper {
    flex: 1;
    min-height: 250px;
    max-height: 480px;
    overflow-y: auto;
    overflow-x: auto;
    background: rgba(11, 17, 32, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    position: relative;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.3);
}

.arrival-table-wrapper table {
    width: 100%;
    min-width: 1140px;
    border-collapse: separate;
    border-spacing: 0;
}

.arrival-table-wrapper thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    background: #172033;
    color: #94a3b8;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 10px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    border-right: 1px solid rgba(255, 255, 255, 0.04);
}

.arrival-row {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.15s ease;
}

.arrival-row:hover {
    background: rgba(30, 41, 59, 0.45);
}

.arrival-row td {
    padding: 5px 6px;
    border-right: 1px solid rgba(255, 255, 255, 0.04);
    vertical-align: middle;
}

.arrival-cell-inp {
    font-size: 0.78rem !important;
    padding: 6px 8px !important;
    border-radius: 6px !important;
    background: rgba(15, 23, 42, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.09) !important;
    color: #f1f5f9 !important;
    width: 100%;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.arrival-cell-inp:focus {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25) !important;
    background: rgba(22, 33, 58, 0.95) !important;
    outline: none;
}

.arrival-sn-textarea {
    height: 32px !important;
    min-height: 32px !important;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
    font-size: 0.73rem !important;
    line-height: 1.25 !important;
    resize: vertical !important;
    transition: height 0.2s ease;
}

.arrival-sn-textarea:focus {
    height: 64px !important;
    position: relative;
    z-index: 10;
}

.arrival-line-total {
    background: rgba(16, 185, 129, 0.08) !important;
    border-color: rgba(16, 185, 129, 0.22) !important;
    color: #34d399 !important;
    font-weight: 700 !important;
    text-align: right !important;
    cursor: not-allowed;
}

.arrival-row-del-btn {
    background: transparent;
    border: 1px solid transparent;
    color: #64748b;
    font-size: 0.85rem;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.arrival-row-del-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

/* Hide entire delete column and row action buttons in view-only mode */
.arrival-modal-dialog.arrival-view-only .arrival-th-del,
.arrival-modal-dialog.arrival-view-only .arrival-td-del,
.arrival-modal-dialog.arrival-view-only .arrival-row-del-btn {
    display: none !important;
}

.arrival-modal-dialog.arrival-view-only .arrival-cell-inp:disabled,
.arrival-modal-dialog.arrival-view-only input:disabled,
.arrival-modal-dialog.arrival-view-only select:disabled,
.arrival-modal-dialog.arrival-view-only textarea:disabled {
    cursor: default !important;
    opacity: 0.85;
}

.arrival-row-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: rgba(99, 102, 241, 0.1);
    color: #a5b4fc;
    font-size: 0.74rem;
    font-weight: 700;
}

.arrival-empty-message {
    text-align: center;
    padding: 44px 16px;
    color: #94a3b8;
}

.arrival-empty-icon {
    font-size: 2.6rem;
    margin-bottom: 8px;
    opacity: 0.75;
}

.arrival-empty-title {
    font-size: 1rem;
    font-weight: 700;
    color: #e2e8f0;
    margin-bottom: 4px;
}

.arrival-empty-desc {
    font-size: 0.8rem;
    color: #64748b;
    max-width: 400px;
    margin: 0 auto;
}

/* Footer Bar */
.arrival-footer-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    padding: 12px 22px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.8), rgba(11, 17, 32, 0.98));
    flex-shrink: 0;
}

.arrival-footer-left {
    color: #cbd5e1;
    font-size: 0.85rem;
}

.arrival-footer-pill {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 5px 12px;
    border-radius: 9999px;
    font-size: 0.78rem;
    color: #94a3b8;
}

.arrival-footer-pill b {
    color: #e2e8f0;
}

.arrival-footer-center {
    display: flex;
    justify-content: center;
    flex: 1;
}

.arrival-mode-btn {
    border-radius: 8px !important;
    padding: 6px 14px !important;
    font-size: 0.78rem !important;
}

.arrival-footer-right {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
}

.arrival-btn-save {
    background: linear-gradient(135deg, #059669, #10b981) !important;
    color: #fff !important;
    font-weight: 700 !important;
    padding: 8px 22px !important;
    border-radius: 8px !important;
    border: none !important;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35) !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    cursor: pointer;
}

.arrival-btn-save:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5) !important;
}

.arrival-btn-draft {
    background: linear-gradient(135deg, #d97706, #f59e0b) !important;
    color: #fff !important;
    font-weight: 600 !important;
    padding: 8px 18px !important;
    border-radius: 8px !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25) !important;
    cursor: pointer;
}

.arrival-btn-draft:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.4) !important;
}

.arrival-btn-clear {
    background: transparent !important;
    border: 1px solid rgba(239, 68, 68, 0.35) !important;
    color: #f87171 !important;
    padding: 8px 16px !important;
    border-radius: 8px !important;
    font-weight: 500 !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    cursor: pointer;
}

.arrival-btn-clear:hover {
    background: rgba(239, 68, 68, 0.12) !important;
    border-color: #ef4444 !important;
}

.arrival-btn-print {
    padding: 8px 16px !important;
    border-radius: 8px !important;
    font-weight: 500 !important;
}

/* Light Theme Support */
body.light-theme .arrival-modal-dialog {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.2), 0 0 35px rgba(99, 102, 241, 0.1) !important;
}

body.light-theme .arrival-modal-header {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-color: #e2e8f0;
}

body.light-theme .arrival-modal-title {
    color: #1e293b;
}

body.light-theme .arrival-modal-close-btn {
    border-color: #cbd5e1;
    color: #64748b;
}

body.light-theme .arrival-doc-badge {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

body.light-theme .arrival-header-card {
    background: #f8fafc;
    border-color: #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

body.light-theme .arrival-card-title-row {
    color: #334155;
    border-color: #e2e8f0;
}

body.light-theme .arrival-inp {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #1e293b !important;
}

body.light-theme .arrival-inp:focus {
    background: #ffffff !important;
    border-color: #4f46e5 !important;
}

body.light-theme .arrival-audit-chip {
    background: #ffffff;
    border-color: #e2e8f0;
}

body.light-theme .arrival-audit-val {
    color: #1e293b;
}

body.light-theme .arrival-total-card {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(5, 150, 105, 0.04));
    border-color: rgba(16, 185, 129, 0.35);
}

body.light-theme .arrival-toolbar-title {
    color: #1e293b;
}

body.light-theme .arrival-table-wrapper {
    background: #ffffff;
    border-color: #e2e8f0;
}

body.light-theme .arrival-table-wrapper thead th {
    background: #f1f5f9;
    color: #475569;
    border-color: #e2e8f0;
}

body.light-theme .arrival-row:hover {
    background: #f8fafc;
}

body.light-theme .arrival-row td {
    border-color: #e2e8f0;
}

body.light-theme .arrival-cell-inp {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #1e293b !important;
}

body.light-theme .arrival-empty-title {
    color: #1e293b;
}

body.light-theme .arrival-footer-bar {
    background: #f8fafc;
    border-color: #e2e8f0;
}

body.light-theme .arrival-cp-dropdown {
    background: #ffffff;
    border-color: #cbd5e1;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15);
}

body.light-theme .arrival-cp-item {
    color: #1e293b !important;
    border-color: #f1f5f9 !important;
}

body.light-theme .arrival-cp-item:hover {
    background: #eef2ff !important;
}

.btn-block {
    width: 100%;
}

.btn-success {
    background: linear-gradient(135deg, #047857, #10b981);
    color: #fff;
}

.btn-success:hover {
    opacity: .9;
}

.btn-danger {
    background: linear-gradient(135deg, #b91c1c, #ef4444);
    color: #fff;
}

.btn-warn {
    background: linear-gradient(135deg, #b45309, #f59e0b);
    color: #fff;
}

.btn-outline {
    background: transparent;
    border: 1px solid #374151;
    color: #9ca3af;
}

.btn-outline:hover {
    border-color: #6366f1;
    color: #a5b4fc;
    background: rgba(99, 102, 241, .08);
}

.btn-sm {
    padding: 4px 10px;
    font-size: .76rem;
    border-radius: 5px;
}

.modal-bg {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .75);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    z-index: 2000 !important;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 12px;
}

.modal-bg.open {
    display: flex;
}

.modal {
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 14px;
    width: min(580px, 100%);
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: 0 30px 60px rgba(0, 0, 0, .6);
}

.toast-wrap {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    align-items: center;
}

.toast {
    padding: 8px 18px;
    border-radius: 10px;
    font-size: 0.83rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 9px;
    pointer-events: all;
    -webkit-animation: tIn 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: tIn 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4), 0 0 1px rgba(255, 255, 255, 0.1);
    min-width: 200px;
    max-width: 420px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    background: rgba(17, 24, 39, 0.96);
    color: #f8fafc;
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: all 0.2s ease;
    letter-spacing: 0.01em;
}

.toast-icon {
    font-size: 1.05rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toast-msg {
    line-height: 1.35;
    word-break: break-word;
}

/* Success / OK: Emerald accent */
.toast.ok,
.toast.success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.14), rgba(17, 24, 39, 0.96));
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-left: 4px solid #10b981;
    color: #f0fdf4;
}

/* Error: Crimson accent */
.toast.err,
.toast.error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.14), rgba(17, 24, 39, 0.96));
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-left: 4px solid #ef4444;
    color: #fef2f2;
}

/* Warning: Amber accent */
.toast.warn,
.toast.warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.14), rgba(17, 24, 39, 0.96));
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-left: 4px solid #f59e0b;
    color: #fffbeb;
}

/* Info: Sky blue accent */
.toast.info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.14), rgba(17, 24, 39, 0.96));
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-left: 4px solid #3b82f6;
    color: #eff6ff;
}

/* Premium SweetAlert Modal Overrides */
.premium-alert-popup {
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 16px !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5) !important;
    font-family: 'Inter', 'Noto Sans Armenian', sans-serif !important;
}

body.light-theme .premium-alert-popup {
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 25px 50px -12px rgba(31, 41, 55, 0.15) !important;
}

@-webkit-keyframes tIn {
    from {
        transform: translateY(-50px) scale(0.9);
        opacity: 0;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes tIn {
    from {
        transform: translateY(-50px) scale(0.9);
        opacity: 0;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@-webkit-keyframes tOut {
    from {
        transform: translateY(0) scale(1);
        opacity: 1;
    }

    to {
        transform: translateY(-20px) scale(0.9);
        opacity: 0;
    }
}

@keyframes tOut {
    from {
        transform: translateY(0) scale(1);
        opacity: 1;
    }

    to {
        transform: translateY(-20px) scale(0.9);
        opacity: 0;
    }
}

.tbl {
    width: -webkit-fill-available;
    border-collapse: collapse;
    table-layout: fixed;
}

.tbl th {
    padding: 10px 8px;
    font-size: .72rem;
    font-weight: 600;
    color: #41cd46;
    text-transform: uppercase;
    letter-spacing: .05em;
    border-bottom: 2px solid #1f2937;
    text-align: left;
    white-space: nowrap;
    background: linear-gradient(135deg, #0a0f1e, #111827);
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 10;
    text-align: center;
    width: 100%;
}

.tbl td {
    padding: 8px;
    font-size: .8rem;
    border-bottom: 1px solid #111827;
    vertical-align: middle;
    /* overflow: hidden; */
    text-overflow: ellipsis;
    word-break: break-word;
    width: 100%;
}

.tbl td[data-column="sn"],
.tbl td[data-column="name"] {
    max-width: 150px;
    white-space: pre-wrap;
    word-break: break-all;
}

.tbl td[data-column="sku"],
.tbl td[data-column="expense"],
.tbl td[data-column="incoming"] {
    max-width: 120px;
    font-family: 'Courier New', monospace;
    font-size: .75rem;
}

.tbl tr:hover td {
    background: rgba(99, 102, 241, .06);
}

.tbl-cell-truncate {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

.tbl-cell-truncate[title]:hover {
    overflow: visible;
    white-space: normal;
    background: #1a2035;
    border: 1px solid #4f46e5;
    border-radius: 4px;
    padding: 4px;
    z-index: 100;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: 20px;
    font-size: .68rem;
    font-weight: 600;
    white-space: nowrap;
}

.b-green {
    background: rgba(16, 185, 129, .15);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, .3);
}

.b-yellow {
    background: rgba(245, 158, 11, .15);
    color: #fcd34d;
    border: 1px solid rgba(245, 158, 11, .3);
}

.b-red {
    background: rgba(239, 68, 68, .15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, .3);
}

.b-blue {
    background: rgba(99, 102, 241, .15);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, .3);
}

.b-purple {
    background: rgba(139, 92, 246, .15);
    color: #c4b5fd;
    border: 1px solid rgba(139, 92, 246, .3);
}

.stat-card {
    background: linear-gradient(135deg, #111827, #0d1526);
    border: 1px solid #1f2937;
    border-radius: 10px;
    padding: 16px;
}

.price-tier-toggle {
    display: flex;
    background: #0a0f1e;
    border: 1px solid #1f2937;
    border-radius: 7px;
    padding: 3px;
    gap: 2px;
}

.price-tier-toggle button {
    padding: 5px 14px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-size: .78rem;
    font-weight: 600;
    transition: all .2s;
    color: #6b7280;
    background: transparent;
}

.price-tier-toggle button.active {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
}

.cart-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #1f2937;
}

.field-label {
    font-size: .75rem;
    font-weight: 500;
    color: #6b7280;
    margin-bottom: 4px;
    display: block;
}

.product-card {
    transition: all 0.2s;
}

.product-card:hover {
    transform: translateY(-2px);
    border-color: #6366f1;
}

/* Cart Item Hover Effect */
.cart-item {
    transition: all 0.2s;
}

.cart-item:hover {
    transform: translateX(-2px);
    border-color: #4f46e5 !important;
}

/* Custom Scrollbar for Cart */
#cartItems::-webkit-scrollbar {
    width: 4px;
}

#cartItems::-webkit-scrollbar-track {
    background: #1f2937;
}

#cartItems::-webkit-scrollbar-thumb {
    background: #4f46e5;
    border-radius: 4px;
}

/* Animation for cart updates */
@-webkit-keyframes cartUpdate {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes cartUpdate {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.cart-badge-update {
    -webkit-animation: cartUpdate 0.3s ease;
    animation: cartUpdate 0.3s ease;
}

/* Tools Tab Specifics */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: auto auto;
    gap: 20px;
    padding: 20px;
}

.analytics-card {
    grid-column: span 2;
}

.tool-section {
    padding: 20px;
}

/* Autocomplete Product Search Styles */
.product-search-wrapper {
    position: relative;
    width: 100%;
}

.product-search-input {
    width: 100%;
    background: #0a0f1e;
    border: 1px solid #1f2937;
    border-radius: 7px;
    color: #e2e8f0;
    padding: 7px 11px;
    outline: none;
    transition: border .15s;
    font-size: .85rem;
}

.product-search-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, .2);
}

.product-search-input::-webkit-input-placeholder {
    color: #4b5563;
}

.product-search-input::-moz-placeholder {
    color: #4b5563;
}

.product-search-input:-ms-input-placeholder {
    color: #4b5563;
}

.product-search-input::-ms-input-placeholder {
    color: #4b5563;
}

.product-search-input::placeholder {
    color: #4b5563;
}

.product-dropdown {
    position: fixed;
    background: #0a0f1e;
    border: 1px solid #1f2937;
    border-radius: 0 0 7px 7px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .5);
    min-width: 200px;
}

.product-dropdown.show {
    display: block;
}

.product-dropdown::-webkit-scrollbar {
    width: 4px;
}

.product-dropdown::-webkit-scrollbar-track {
    background: #111827;
}

.product-dropdown::-webkit-scrollbar-thumb {
    background: #4b5563;
    border-radius: 2px;
}

.product-dropdown::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

.product-dropdown-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #1a2035;
    transition: background .15s;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.product-dropdown-item:hover {
    background: #1a2035;
}

.product-dropdown-item.selected,
.product-dropdown-item.highlighted {
    background: rgba(99, 102, 241, .15);
    border-left: 3px solid #6366f1;
    padding-left: 9px;
}

.product-dropdown-item-name {
    font-size: .8rem;
    color: #e2e8f0;
    font-weight: 500;
}

.product-dropdown-item-sku {
    font-size: .7rem;
    color: #9ca3af;
    font-family: 'Courier New', monospace;
}

.product-dropdown-empty {
    padding: 10px 12px;
    text-align: center;
    color: #6b7280;
    font-size: .8rem;
}

.barcode-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.profit-results {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 20px;
}

.profit-stat {
    background: rgba(10, 15, 30, 0.5);
    padding: 12px;
    border-radius: 8px;
    text-align: center;
}

.stock-alert-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s;
}

.stock-alert-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* POS List View Specifics */
.pos-product-container {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.pos-refined-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 0;
}

.pos-list-item {
    background: rgba(17, 24, 39, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.pos-list-item:hover {
    background: rgba(31, 41, 55, 0.8);
    border-color: rgba(79, 70, 229, 0.3);
}

.pos-list-item.no-stock-here {
    border-color: rgba(245, 158, 11, 0.22);
    background: rgba(245, 158, 11, 0.045);
}

.pos-item-details {
    flex: 1;
}

/* ================================================================ */
/* ANALYTICS DASHBOARD STYLES */
/* ================================================================ */

/* Quick Stats Grid */
.quick-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.quick-stats-grid-dynamic {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.stat-low-card-btn:hover {
    border-color: rgba(245, 158, 11, 0.3) !important;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(13, 21, 38, 0.9)) !important;
    box-shadow: 0 10px 20px -10px rgba(245, 158, 11, 0.2) !important;
    transform: translateY(-2px);
}

body.light-theme .stat-low-card-btn:hover {
    border-color: rgba(245, 158, 11, 0.3) !important;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.05), #ffffff) !important;
    box-shadow: 0 10px 25px rgba(245, 158, 11, 0.08) !important;
}

.stat-card {
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.8), rgba(13, 21, 38, 0.9));
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 10px 20px -10px rgba(99, 102, 241, 0.2);
    transform: translateY(-2px);
}

.stat-card.stat-primary {
    border-left: 4px solid #6366f1;
}

.stat-card.stat-success {
    border-left: 4px solid #10b981;
}

.stat-card.stat-warning {
    border-left: 4px solid #f59e0b;
}

.stat-card.stat-info {
    border-left: 4px solid #3b82f6;
}

.stat-icon {
    font-size: 2rem;
    line-height: 1;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 0.75rem;
    color: #9ca3af;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

.stat-trend {
    font-size: 0.75rem;
    font-weight: 600;
}

.stat-trend.positive {
    color: #10b981;
}

.stat-trend.negative {
    color: #ef4444;
}

.stat-items {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 4px;
}

/* Charts Grid */
.analytics-charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

@media (max-width: 1400px) {
    .analytics-charts-grid {
        grid-template-columns: 1fr;
    }
}

.chart-card {
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.8), rgba(13, 21, 38, 0.9));
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

/* Analytics panel refinements */
.analytics-period-summary {
    margin: 0 0 22px;
}

.audit-state {
    padding: 28px 16px;
    text-align: center;
    color: #94a3b8;
}

.audit-state-loading::before {
    content: '';
    display: inline-block;
    width: 13px;
    height: 13px;
    margin-right: 9px;
    border: 2px solid rgba(148, 163, 184, .3);
    border-top-color: #818cf8;
    border-radius: 50%;
    vertical-align: -2px;
    animation: audit-spin .8s linear infinite;
}

.audit-state-error {
    color: #fca5a5;
}

.audit-retry-btn {
    margin-left: 10px;
    padding: 6px 11px;
    color: #e0e7ff;
    background: rgba(99, 102, 241, .18);
    border: 1px solid rgba(129, 140, 248, .35);
    border-radius: 8px;
    cursor: pointer;
}

@keyframes audit-spin {
    to {
        transform: rotate(360deg);
    }
}

.analytics-summary-heading {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
    margin: 0 2px 10px;
    color: #e5e7eb;
}

.analytics-summary-heading span {
    color: #94a3b8;
    font-size: .8rem;
}

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

.analytics-summary-card {
    min-width: 0;
    padding: 16px 18px;
    border: 1px solid rgba(148, 163, 184, .15);
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(30, 41, 59, .72), rgba(15, 23, 42, .9));
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 11px;
    align-items: center;
}

.analytics-summary-icon {
    grid-row: span 2;
    font-size: 1.35rem;
}

.analytics-summary-label {
    color: #9ca3af;
    font-size: .76rem;
}

.analytics-summary-card strong {
    color: #f8fafc;
    font-size: 1.08rem;
    overflow-wrap: anywhere;
}

#analyticsWarehouseFilter,
#analyticsCategoryFilter,
#analyticsEmployeeFilter,
#analyticsStartDate,
#analyticsEndDate {
    min-height: 38px;
    border-color: rgba(148, 163, 184, .22);
    border-radius: 9px;
}

.analytics-charts-grid .chart-card {
    background: radial-gradient(ellipse at top left, rgba(79, 70, 229, .11), transparent 58%),
        linear-gradient(145deg, rgba(17, 24, 39, .96), rgba(10, 15, 30, .96));
    border-color: rgba(148, 163, 184, .14);
    border-radius: 16px;
    padding: 22px;
}

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

    .analytics-summary-card {
        padding: 12px;
    }

    .analytics-summary-card strong {
        font-size: .92rem;
    }

    .analytics-summary-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .analytics-charts-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .analytics-charts-grid .chart-card {
        padding: 15px;
    }

    #analyticsWarehouseFilter,
    #analyticsCategoryFilter,
    #analyticsEmployeeFilter {
        width: 100%;
    }
}

.chart-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 10px 20px -10px rgba(99, 102, 241, 0.2);
}

/* Category Chart Custom Layout & Legend */
.category-chart-layout {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    height: 250px;
}

.category-chart-wrapper {
    flex: 1.1;
    min-width: 0;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.category-chart-wrapper canvas {
    max-width: 100% !important;
    max-height: 100% !important;
}

.category-legend-container {
    flex: 1;
    max-height: 240px;
    overflow-y: auto;
    padding-right: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Custom scrollbar for category legend */
.category-legend-container::-webkit-scrollbar {
    width: 6px;
}

.category-legend-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
}

.category-legend-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.category-legend-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.category-legend-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #e2e8f0;
    padding: 6px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: all 0.2s ease;
}

.category-legend-item:hover {
    background-color: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.2);
    transform: translateX(3px);
}

.category-legend-label {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.category-legend-color {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
}

.category-legend-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-legend-value {
    font-weight: 600;
    color: #cbd5e1;
    margin-left: 8px;
    flex-shrink: 0;
}

/* Barcode Generator */
.barcode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
}

/* A4 Paper Layout - 3 columns for optimal print */
.barcode-grid-a4 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

/* Thermal/Receipt Paper Layout - Single column for 58mm/80mm printers */
.barcode-grid-thermal {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    max-width: 300px;
    margin: 0 auto;
}

.barcode-item {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.barcode-item-thermal {
    max-width: 280px;
    margin: 0 auto;
}

.barcode-item:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.barcode-preview-container {
    display: grid;
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
    padding: 20px;
    background: rgba(99, 102, 241, 0.05);
    border-radius: 8px;
    border: 1px dashed rgba(99, 102, 241, 0.2);
    min-height: 150px;
    align-content: start;
}

.barcode-preview-a4 {
    grid-template-columns: repeat(3, 1fr);
}

.barcode-preview-thermal {
    grid-template-columns: 1fr;
    max-width: 320px;
    margin: 0 auto;
}

.barcode-container {
    background: white;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 12px;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.barcode-svg {
    max-width: 100%;
    height: auto;
}

.barcode-sku-product {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.barcode-number {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    font-weight: 700;
    color: #1f2937;
    margin: 6px 0;
    letter-spacing: 1px;
}

.btn-print-barcode {
    width: 100%;
    padding: 6px 8px;
    background: #6366f1;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-print-barcode:hover {
    background: #4f46e5;
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.3);
}

.btn-print-barcode:active {
    transform: scale(0.98);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-print-barcode:hover {
    background: #4f46e5;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* Date Filter Buttons */
.btn-filter {
    padding: 8px 16px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-filter:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.5);
}

.btn-filter.active {
    background: #6366f1;
    border-color: #6366f1;
    color: white;
}

/* Audit Logs Table */
.audit-logs-table {
    overflow-x: auto;
}

.audit-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.audit-table thead {
    background: rgba(99, 102, 241, 0.1);
    border-bottom: 2px solid rgba(99, 102, 241, 0.2);
}

.audit-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 700;
    color: #a5b4fc;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.75rem;
}

.audit-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
}

.audit-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.1);
}

.audit-table td {
    padding: 12px 16px;
    color: #e2e8f0;
}

/* Color-Coded Badges */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

.badge-create {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.badge-update {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.badge-delete {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.badge-login {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.4);
}

.badge-logout {
    background: rgba(107, 114, 128, 0.2);
    color: #9ca3af;
    border: 1px solid rgba(107, 114, 128, 0.4);
}

.badge-transfer {
    background: rgba(139, 92, 246, 0.2);
    color: #d8b4fe;
    border: 1px solid rgba(139, 92, 246, 0.4);
}

.badge-transaction {
    background: rgba(236, 72, 153, 0.2);
    color: #fb7185;
    border: 1px solid rgba(236, 72, 153, 0.4);
}

.badge-default {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.4);
}

.btn-details {
    padding: 4px 8px;
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 4px;
    color: #a5b4fc;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-details:hover {
    background: rgba(99, 102, 241, 0.4);
    border-color: rgba(99, 102, 241, 0.6);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    -webkit-animation: fadeIn 0.3s ease;
    animation: fadeIn 0.3s ease;
}

@-webkit-keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.95), rgba(13, 21, 38, 0.99));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    width: 600px;
    height: auto;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
    -webkit-animation: slideUp 0.3s ease;
    animation: slideUp 0.3s ease;
}

@-webkit-keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    margin: 0;
}

.modal-close {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.4);
    border-color: rgba(239, 68, 68, 0.6);
}

.modal-body {
    padding: 20px;
}

.detail-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.detail-row {
    display: flex;
    gap: 12px;
    padding: 8px;
    background: rgba(99, 102, 241, 0.05);
    border-radius: 6px;
}

/* ==================== PRINT STYLES FOR BARCODES ==================== */

@media print {

    /* === CRITICAL: HIDE ALL BODY CONTENT FIRST === */
    * {
        display: none !important;
        visibility: hidden !important;
    }

    html,
    body {
        display: block !important;
        visibility: visible !important;
        margin: 0 !important;
        padding: 0 !important;
        background: white !important;
        width: 100% !important;
        height: 100% !important;
    }

    /* === SHOW PRINT CONTAINER === */
    #printContainer,
    #printContainer * {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    /* === SHOW BARCODE PREVIEW (main container) === */
    #barcodePreview,
    #barcodePreview * {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    /* === BARCODE PAGE (contains multiple labels in grid) === */
    .barcode-page {
        display: grid !important;
        visibility: visible !important;
        width: 210mm !important;
        height: 297mm !important;
        margin: 0 !important;
        padding: 5mm !important;
        box-sizing: border-box !important;
        background: white !important;
        page-break-after: always !important;
        page-break-inside: avoid !important;
        -moz-column-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    /* === BARCODE LABEL (individual label) === */
    .barcode-label {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        visibility: visible !important;
        opacity: 1 !important;
        background: white !important;
        border: 0.5px solid #000 !important;
        padding: 2mm !important;
        margin: 1mm !important;
        box-sizing: border-box !important;
        page-break-inside: avoid !important;
        -moz-column-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    /* === TEXT AND CONTENT INSIDE LABELS === */
    .barcode-label div {
        display: block !important;
        visibility: visible !important;
        color: #000 !important;
        opacity: 1 !important;
        margin: 0 !important;
        padding: 0 !important;
        font-family: Arial, sans-serif !important;
        background: white !important;
    }

    /* === BARCODE SVG IMAGE === */
    .barcode-label svg,
    svg[id^="barcode-"] {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: 100% !important;
        height: auto !important;
        margin: 1mm 0 !important;
        background: white !important;
        print-color-adjust: exact !important;
        -webkit-print-color-adjust: exact !important;
    }

    /* === ENSURE SVG PATHS ARE RENDERED === */
    svg path,
    svg line,
    svg rect {
        visibility: visible !important;
        opacity: 1 !important;
        display: block !important;
    }

    /* === PAGE LAYOUT === */
    @page {
        size: A4;
        margin: 0;
        padding: 0;
        orphans: 1;
        widows: 1;
    }

    /* === REMOVE ALL HEADERS/FOOTERS === */
    header,
    footer,
    .no-print,
    nav,
    aside,
    .navbar,
    .sidebar,
    [role="navigation"] {
        display: none !important;
        visibility: hidden !important;
    }

    /* === FORCE TEXT TO BLACK === */
    body,
    p,
    span,
    div,
    text {
        color: #000 !important;
        text-shadow: none !important;
    }
}


.detail-key {
    font-weight: 700;
    color: #a5b4fc;
    min-width: 120px;
}

.detail-value {
    color: #e2e8f0;
    flex: 1;
}

.detail-json {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 12px;
    color: #10b981;
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    overflow-x: auto;
    margin: 12px 0;
}

/* Additional Button Styles */
.btn-primary {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-primary:hover {
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
    transform: translateY(-2px);
}

.btn-outline {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-outline:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.6);
}

.field-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pos-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pos-item-sku {
    font-size: 0.7rem;
    color: #64748b;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
}

.pos-item-name {
    font-size: 0.95rem;
    font-weight: 500;
    color: #f1f5f9;
}

.pos-item-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
    gap: 12px;
}

.pos-item-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #10b981;
    min-width: 100px;
}

.pos-item-stock-container {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
    flex: 1;
}

.pos-stock-primary {
    font-size: 0.78rem;
    color: #a5b4fc;
    font-weight: 700;
}

.pos-stock-primary.low {
    color: #f59e0b;
}

.pos-stock-all {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
}

.pos-stock-hint {
    font-size: 0.7rem;
    color: #fbbf24;
}

.pos-item-stock {
    font-size: 0.75rem;
    color: #94a3b8;
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 999px;
    padding: 2px 7px;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pos-item-stock.low {
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.3);
}

.pos-item-stock.empty {
    color: #64748b;
    border-color: rgba(100, 116, 139, 0.2);
}

.pos-item-add {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: rgba(79, 70, 229, 0.1);
    color: #818cf8;
    border: 1px solid rgba(79, 70, 229, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.pos-item-add:disabled {
    opacity: 0.38;
    cursor: not-allowed;
    background: rgba(71, 85, 105, 0.18);
    border-color: rgba(100, 116, 139, 0.25);
}

.pos-item-add:hover {
    background: #4f46e5;
    color: white;
    transform: scale(1.05);
}

.pos-item-add:active {
    transform: scale(0.95);
}

.pos-cat-header {
    background: rgba(79, 70, 229, 0.05);
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #86efac;
    border-left: 4px solid #86efac;
    margin: 16px 0 6px 0;
    border-radius: 0 6px 6px 0;
}

@media (max-width: 768px) {
    .pos-cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

/* ================================================================ */
/* LIGHT THEME STYLES (ԱՄԲՈՂՋԱԿԱՆ ՈՒ ՈՒՂՂՎԱԾ ՏԱՐԲԵՐԱԿ) */
/* ================================================================ */

body.light-theme {
    /* Փոխվեց ավելի մեղմ, կաթնագույն-մոխրագույն ետնաֆոնի, որը չի հոգնեցնում աչքերը */
    background: #f8fafc;
    color: #1e293b;
    /* Մաքուր սևի փոխարեն՝ հանգիստ մուգ Slate տեքստ */
}

body.light-theme .glass {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(0, 0, 0, 0.04);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

/* Scrollbars for light theme */
body.light-theme::-webkit-scrollbar-track {
    background: #f1f5f9;
}

body.light-theme::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

body.light-theme::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Navigation Links */
body.light-theme .nav-link {
    color: #64748b;
}

body.light-theme .nav-link:hover {
    background: rgba(88, 86, 214, .08);
    color: #4f46e5;
}

body.light-theme .nav-link.active {
    background: rgba(88, 86, 214, .12);
    color: #4f46e5;
    font-weight: 600;
}

/* Cards (Ապրանքների տողերը և բլոկները) */
body.light-theme .card {
    background: #ffffff;
    /* Մաքուր սպիտակ քարտերը հիանալի կառանձնանան մեղմ ֆոնից */
    border: 1px solid #e2e8f0;
    /* Ավելացվեց փափուկ ստվեր՝ խորության էֆեկտ ստեղծելու համար */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

body.light-theme .card-premium {
    background: #ffffff;
    border: 1px solid rgba(88, 86, 214, 0.15);
    box-shadow: 0 10px 15px -3px rgba(88, 86, 214, 0.05);
}

/* Inputs */
body.light-theme .inp {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #1e293b;
}

body.light-theme .inp:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

body.light-theme .inp::-webkit-input-placeholder {
    color: #94a3b8;
}

body.light-theme .inp::-moz-placeholder {
    color: #94a3b8;
}

body.light-theme .inp:-ms-input-placeholder {
    color: #94a3b8;
}

body.light-theme .inp::-ms-input-placeholder {
    color: #94a3b8;
}

body.light-theme .inp::placeholder {
    color: #94a3b8;
}

body.light-theme select option {
    background: #ffffff !important;
    color: #1e293b !important;
}

/* Buttons */
body.light-theme .btn-primary {
    background: linear-gradient(135deg, #4f46e5, #4338ca);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}

body.light-theme .btn-primary:hover {
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
    opacity: 0.95;
}

body.light-theme .btn-outline {
    background: rgba(79, 70, 229, 0.06);
    border: 1px solid rgba(79, 70, 229, 0.25);
    color: #4f46e5;
}

body.light-theme .btn-outline:hover {
    border-color: #4f46e5;
    color: #4f46e5;
    background: rgba(79, 70, 229, 0.12);
}

body.light-theme .btn-success {
    background: linear-gradient(135deg, #16a34a, #15803d);
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.25);
}

body.light-theme .btn-danger {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.25);
}

body.light-theme .btn-warn {
    background: linear-gradient(135deg, #f97316, #ea580c);
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.25);
}

/* Table Styles */
body.light-theme #productsTable {
    background: #ffffff;
    color: #1e293b;
}

body.light-theme #productsTable thead th {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

body.light-theme #productsTable tbody tr {
    border-bottom: 1px solid #f1f5f9;
}

body.light-theme #productsTable tbody tr:hover {
    background: #f8fafc;
}

body.light-theme #productsTable td {
    border-right: 1px solid #e2e8f0;
    color: #334155;
}

body.light-theme #productsTable input.inp,
body.light-theme #productsTable select.inp {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #1e293b;
}

body.light-theme #productsTable input.inp:focus,
body.light-theme #productsTable select.inp:focus {
    border-color: #4f46e5;
}

/* Modal */
body.light-theme .modal-bg {
    background: rgba(15, 23, 42, 0.3);
    /* Ավելի բնական մուգ ֆոն modal-ի հետևում */
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

body.light-theme .modal {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Toast Styles */
body.light-theme .toast.ok {
    background: linear-gradient(135deg, rgba(22, 163, 74, 0.05), #ffffff) !important;
    border: 1px solid rgba(22, 163, 74, 0.15) !important;
    border-left: 5px solid #16a34a !important;
    color: #1e293b !important;
    box-shadow: 0 10px 25px rgba(22, 163, 74, 0.08) !important;
}

body.light-theme .toast.err {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.05), #ffffff) !important;
    border: 1px solid rgba(220, 38, 38, 0.15) !important;
    border-left: 5px solid #dc2626 !important;
    color: #1e293b !important;
    box-shadow: 0 10px 25px rgba(220, 38, 38, 0.08) !important;
}

body.light-theme .toast.warn {
    background: linear-gradient(135deg, rgba(234, 88, 12, 0.05), #ffffff) !important;
    border: 1px solid rgba(234, 88, 12, 0.15) !important;
    border-left: 5px solid #ea580c !important;
    color: #1e293b !important;
    box-shadow: 0 10px 25px rgba(234, 88, 12, 0.08) !important;
}

body.light-theme .toast.info {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), #ffffff) !important;
    border: 1px solid rgba(37, 99, 235, 0.15) !important;
    border-left: 5px solid #2563eb !important;
    color: #1e293b !important;
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.08) !important;
}

/* Tables */
body.light-theme .tbl th {
    background: #f1f5f9;
    color: #475569;
    border-bottom: 2px solid #e2e8f0;
}

body.light-theme .tbl td {
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
}

body.light-theme .tbl tr:hover td {
    background: rgba(79, 70, 229, 0.04);
}

/* Badges */
body.light-theme .badge {
    background: rgba(79, 70, 229, 0.08);
    color: #4f46e5;
    border: 1px solid rgba(79, 70, 229, 0.15);
}

body.light-theme .b-green {
    background: rgba(22, 163, 74, 0.08);
    color: #16a34a;
    border: 1px solid rgba(22, 163, 74, 0.2);
}

body.light-theme .b-yellow {
    background: rgba(249, 115, 22, 0.08);
    color: #ea580c;
    border: 1px solid rgba(249, 115, 22, 0.2);
}

body.light-theme .b-red {
    background: rgba(220, 38, 38, 0.08);
    color: #dc2626;
    border: 1px solid rgba(220, 38, 38, 0.2);
}

body.light-theme .b-blue {
    background: rgba(59, 130, 246, 0.08);
    color: #2563eb;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

body.light-theme .b-purple {
    background: rgba(139, 92, 246, 0.08);
    color: #7c3aed;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.categories_table {
    background: #ffffff;
    border: 1px solid #e2e8f0;
}

/* Stat Cards */
body.light-theme .stat-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02), 0 1px 2px rgba(0, 0, 0, 0.04);
}

body.light-theme .stat-card:hover {
    border-color: rgba(79, 70, 229, 0.25);
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.05);
}

body.light-theme .stat-label {
    color: #64748b;
}

body.light-theme .stat-value {
    color: #1e293b;
}

/* Product Dropdown */
body.light-theme .product-dropdown {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body.light-theme .product-dropdown::-webkit-scrollbar-track {
    background: #f8fafc;
}

body.light-theme .product-dropdown::-webkit-scrollbar-thumb {
    background: #cbd5e1;
}

body.light-theme .product-dropdown-item {
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
}

body.light-theme .product-dropdown-item:hover {
    background: #f8fafc;
}

body.light-theme .product-dropdown-item.selected,
body.light-theme .product-dropdown-item.highlighted {
    background: rgba(79, 70, 229, 0.08);
    border-left-color: #4f46e5;
}

body.light-theme .product-dropdown-item-name {
    color: #1e293b;
}

body.light-theme .product-dropdown-item-sku {
    color: #64748b;
}

/* Price Tier Toggle */
body.light-theme .price-tier-toggle {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
}

body.light-theme .price-tier-toggle button {
    color: #64748b;
}

body.light-theme .price-tier-toggle button.active {
    background: linear-gradient(135deg, #4f46e5, #4338ca);
    color: #fff;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.2);
}

/* POS Item Styles (Ապրանքների տողերը վաճառքի պատուհանում) */
body.light-theme .pos-list-item {
    background: #ffffff;
    /* Դարձավ մաքուր սպիտակ */
    border: 1px solid #e2e8f0;
}

body.light-theme .pos-list-item:hover {
    background: #ffffff;
    border-color: #4f46e5;
    box-shadow: 0 4px 12px rgba(88, 86, 214, 0.08);
}

body.light-theme .pos-item-sku {
    background: #f1f5f9;
    color: #475569;
}

body.light-theme .pos-item-name {
    color: #1e293b;
    font-weight: 500;
}

body.light-theme .pos-item-price {
    color: #16a34a;
    /* Պրոֆեսիոնալ, հանգիստ կանաչ գների համար */
    font-weight: 600;
}

body.light-theme .pos-item-stock {
    color: #64748b;
}

body.light-theme .pos-item-add {
    background: rgba(79, 70, 229, 0.08);
    color: #4f46e5;
    border: 1px solid rgba(79, 70, 229, 0.15);
}

body.light-theme .pos-item-add:hover {
    background: #4f46e5;
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.pos-item-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.pos-item-info-btn,
.pos-item-add {
    width: 38px;
    height: 38px;
    min-width: 38px;
}

.pos-item-info-btn {
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.82);
    border: 1px solid rgba(148, 163, 184, 0.22);
    color: #93c5fd;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.16s ease;
}

.pos-item-info-btn:hover {
    background: rgba(59, 130, 246, 0.16);
    border-color: rgba(96, 165, 250, 0.45);
    color: #bfdbfe;
}

body.light-theme .pos-item-info-btn {
    background: #f8fafc;
    border-color: #dbeafe;
    color: #2563eb;
}

body.light-theme .pos-item-info-btn:hover {
    background: #eff6ff;
    border-color: #93c5fd;
}

.cart-item-v2-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.cart-item-v2-info {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.25);
    color: #93c5fd;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    font-family: inherit;
    transition: all 0.15s;
}

.cart-item-v2-info:hover {
    background: rgba(59, 130, 246, 0.24);
    border-color: rgba(96, 165, 250, 0.5);
}

.pos-item-copy-btn {
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.25);
}

.pos-item-copy-btn:hover {
    background: rgba(56, 189, 248, 0.16) !important;
    border-color: rgba(56, 189, 248, 0.45) !important;
    color: #7dd3fc !important;
    transform: translateY(-1px);
}

.pos-item-copy-btn:active {
    transform: scale(0.95);
}

.pos-item-copy-btn.pos-btn-copied {
    background: rgba(16, 185, 129, 0.2) !important;
    border-color: #10b981 !important;
    color: #10b981 !important;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.35);
}

body.light-theme .pos-item-copy-btn {
    background: #f0f9ff;
    border-color: #bae6fd;
    color: #0284c7;
}

body.light-theme .pos-item-copy-btn:hover {
    background: #e0f2fe !important;
    border-color: #38bdf8 !important;
    color: #0369a1 !important;
}

body.light-theme .pos-item-copy-btn.pos-btn-copied {
    background: #d1fae5 !important;
    border-color: #10b981 !important;
    color: #059669 !important;
}

.cart-item-v2-copy {
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.25);
    color: #38bdf8;
}

.cart-item-v2-copy:hover {
    background: rgba(56, 189, 248, 0.24);
    border-color: rgba(56, 189, 248, 0.5);
    color: #7dd3fc;
}

.pos-item-name:hover {
    text-decoration: underline dotted rgba(255, 255, 255, 0.35);
}

body.light-theme .pos-item-name:hover {
    text-decoration: underline dotted rgba(0, 0, 0, 0.35);
}

.cart-item-price-input.readonly {
    opacity: 0.65;
    cursor: not-allowed;
    background: rgba(15, 23, 42, 0.72);
    color: #94a3b8;
}

/* 🔵 ԿԱՏԵԳՈՐԻԱՆԵՐԻ ԳԼԽԱՄԱՍԸ */
body.light-theme .pos-cat-header {
    background: #f1f5f9;
    /* Մեղմ, հանգիստ մոխրագույն ֆոն */
    color: #1e3a8a;
    /* Մուգ ազնվական կապույտ տեքստ՝ հստակ կոնտրաստով */
    border-left: 4px solid #3b82f6;
    /* Գեղեցիկ, կոկիկ կապույտ գիծ ձախից */
    font-weight: 600;
    font-size: 0.95rem;
    padding: 10px 14px;
    border-radius: 4px;
}

/* Detail Styles */
body.light-theme .detail-key {
    color: #4f46e5;
}

body.light-theme .detail-value {
    color: #1e293b;
}

body.light-theme .detail-json {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #15803d;
}

/* Field Labels */
body.light-theme .field-label {
    color: #64748b;
}

/* Header and Sidebar */
body.light-theme header {
    background: #d4d4d4;
    border-bottom: 1px solid #e2e8f0;
    height: 76px;
}

body.light-theme aside {
    background: #f1f5f9;
    /* Ձախ մենյուի ֆոնը մի փոքր ավելի մուգ է, քան հիմնական էկրանը */
    border-right: 1px solid #e2e8f0;
}

/* Theme Toggle Button */
body.light-theme .theme-toggle-btn {
    border-color: rgba(245, 158, 11, 0.3);
    background: rgba(245, 158, 11, 0.08);
    color: #f59e0b;
}

body.light-theme .theme-toggle-btn:hover {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.5);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

/* ================================================================ */
/* GLOBAL LIGHT THEME OVERRIDES - FINAL PERFECTED VERSION            */
/* ================================================================ */

/* 1. ՃԻՇՏ ԳԼՈԲԱԼ ՓՈՓՈԽԱԿԱՆՆԵՐ */
:root {
    /* Dark Theme Colors */
    --bg-main: #0d1526;
    --bg-surface: #0a0f1e;
    --bg-card: #111827;
    --text-main: #e2e8f0;
    --text-muted: #9ca3af;
    --border-main: #1f2937;
    --accent: #6366f1;
}

body.light-theme {
    /* Light Theme Colors */
    --bg-main: #dbdbdb;
    /* Մեղմ կաթնագույն ֆոն */
    --bg-surface: #f1f5f9;
    /* Sidebar և Headers */
    --bg-card: #ffffff;
    /* Սպիտակ բլոկներ */
    --text-main: #1e293b;
    /* Մուգ հանգիստ տեքստ */
    --text-muted: #626e80;
    /* Երկրորդական տեքստ */
    --border-main: #e2e8f0;
    /* Նուրբ սլաթ սահմանագիծ */
    --accent: #4a43d6;
    /* Մանուշակագույն/Ինդիգո */
}

/* 2. ՖՈՆԵՐԻ ԵՎ ՏԵՔՍՏԵՐԻ ԳԼՈԲԱԼ ՃՇՏՈՒՄ */
body.light-theme {
    background: var(--bg-main) !important;
    color: var(--text-main) !important;
}

/* Կիրառում ենք փոփոխականները */
body.light-theme main,
body.light-theme section,
body.light-theme .card,
body.light-theme .pos-list-item,
body.light-theme [role="region"] {
    background: var(--bg-card) !important;
    color: var(--text-main) !important;
    border-color: var(--border-main) !important;
}

/* 🛠️ ԶԱՄԲՅՈՒՂԻ ՎԵՐԱԴԱՐՁ */
body.light-theme aside,
body.light-theme .glass,
body.light-theme [style*="background: #0d1526"],
body.light-theme [style*="background:#0d1526"],
body.light-theme [style*="background: #0a0f1a"],
body.light-theme [style*="background:#0a0f1a"],
body.light-theme [style*="background: #0a0f1e"],
body.light-theme [style*="background:#0a0f1e"] {
    background: var(--bg-card) !important;
    /* Սպիտակ ֆոն Զամբյուղի համար */
    color: var(--text-main) !important;
    /* Մուգ տեքստ Զամբյուղի համար */
    border-color: var(--border-main) !important;
}

/* 🛠️ ՎՃԱՐՄԱՆ ԵՂԱՆԱԿԻ ՈՒՂՂՈՒՄ */
body.light-theme .glass table td[style*="background: #1a2035"],
body.light-theme [style*="background: #1a2035"],
body.light-theme [style*="background:#1a2035"] {
    background: #f1f5f9 !important;
    /* Մեղմ մոխրագույն ֆոն */
    color: #1e3a8a !important;
    /* Հստակ մուգ կապույտ տեքստ */
    border-color: var(--border-main) !important;
}

/* Ապահովում ենք ճիշտ տեքստի գույնը բոլոր էլեմենտների համար */
body.light-theme h1,
body.light-theme h2,
body.light-theme h3,
body.light-theme h4,
body.light-theme h5,
body.light-theme h6,
body.light-theme p,
body.light-theme span,
body.light-theme div,
body.light-theme label {
    color: var(--text-main);
}

/* 🔵 ԿԱՏԵԳՈՐԻԱՆԵՐԻ ԳԼԽԱՄԱՍԵՐԸ */
body.light-theme .pos-cat-header,
body.light-theme [style*="background: #1a2035"],
body.light-theme [style*="background:#1a2035"] {
    background: var(--bg-surface) !important;
    color: #1e3a8a !important;
    /* Հստակ մուգ կապույտ վերնագրեր */
    border-left: 4px solid #3b82f6 !important;
}

/* 🟢 ԳՆԵՐԻ ԿԱՆԱՉ ԳՈՒՅՆԸ */
body.light-theme .pos-item-price,
body.light-theme [style*="color: #10b981"],
body.light-theme [style*="color: #16a34a"],
body.light-theme [style*="color:#10b981"] {
    color: #16a34a !important;
    font-weight: 700 !important;
}

/* ⚪ ՄԵՂՄԱՑՎԱԾ ՏԵՔՍՏԵՐ */
body.light-theme .pos-item-stock,
body.light-theme .product-muted,
body.light-theme [style*="color: #9ca3af"],
body.light-theme [style*="color:#9ca3af"],
body.light-theme [style*="color: #6b7280"] {
    color: var(--text-muted) !important;
}

/* 3. ՖՈՐՄԱՆԵՐ ԵՎ ԻՆՊՈՒՏՆԵՐ */
body.light-theme input,
body.light-theme textarea,
body.light-theme select {
    background: #ffffff !important;
    color: var(--text-main) !important;
    border: 1px solid #cbd5e1 !important;
}

body.light-theme input::-webkit-input-placeholder {
    color: var(--text-muted) !important;
}

body.light-theme input::-moz-placeholder {
    color: var(--text-muted) !important;
}

body.light-theme input:-ms-input-placeholder {
    color: var(--text-muted) !important;
}

body.light-theme input::-ms-input-placeholder {
    color: var(--text-muted) !important;
}

body.light-theme input::placeholder {
    color: var(--text-muted) !important;
}

/* 4. ԱՂՅՈՒՍԱԿՆԵՐ */
body.light-theme table {
    background: #ffffff !important;
}

body.light-theme thead th {
    background: var(--bg-surface) !important;
    color: var(--text-main) !important;
    border-bottom: 2px solid var(--border-main) !important;
}

body.light-theme tbody tr:hover {
    background: var(--bg-main) !important;
}

body.light-theme td {
    border-color: var(--border-main) !important;
}

/* 5. ԿՈՃԱԿՆԵՐ */
body.light-theme .btn-primary {
    background: linear-gradient(135deg, #4f46e5, #4338ca) !important;
    color: #ffffff !important;
}

/* Product dropdown for transfer modal */
.product-dropdown-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #334155;
    transition: background 0.1s;
}

.product-dropdown-item:hover {
    background: #1e293b;
}

.product-dropdown-empty {
    padding: 12px;
    color: #9ca3af;
    text-align: center;
}

/* ==================== Returns Page (Pro Redesign) ==================== */
.tab-panel.returns-page,
#tab-returns {
    display: none;
}

.tab-panel.returns-page.active,
#tab-returns.active {
    display: flex !important;
    flex-direction: column;
    height: 100%;
    color: #e2e8f0;
}

.returns-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.returns-header-titles {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.returns-page-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #f8fafc;
}

.returns-title-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(79, 70, 229, 0.1));
    border: 1px solid rgba(99, 102, 241, 0.35);
    font-size: 1.1rem;
}

.returns-page-subtitle {
    font-size: 0.82rem;
    color: #94a3b8;
    line-height: 1.4;
}

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

.returns-clean-btn {
    border-color: rgba(255, 255, 255, 0.12) !important;
    color: #cbd5e1 !important;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 8px;
    transition: all 0.2s;
}

.returns-clean-btn:hover {
    background: rgba(255, 255, 255, 0.06) !important;
    border-color: rgba(255, 255, 255, 0.22) !important;
    color: #ffffff !important;
}

/* --- KPI Metric Cards Strip --- */
.returns-stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

@media (max-width: 1100px) {
    .returns-stats-bar {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .returns-stats-bar {
        grid-template-columns: 1fr;
    }
}

.returns-stat-card {
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s, box-shadow 0.2s;
}

.returns-stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, 0.35);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.returns-stat-icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.returns-stat-indigo {
    background: rgba(99, 102, 241, 0.18);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #818cf8;
}

.returns-stat-emerald {
    background: rgba(16, 185, 129, 0.18);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.returns-stat-amber {
    background: rgba(245, 158, 11, 0.18);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fbbf24;
}

.returns-stat-blue {
    background: rgba(59, 130, 246, 0.18);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #60a5fa;
}

.returns-stat-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.returns-stat-label {
    font-size: 0.74rem;
    color: #94a3b8;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.returns-stat-value {
    font-size: 1.15rem;
    font-weight: 800;
    color: #f8fafc;
    letter-spacing: -0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.returns-stat-value.text-emerald {
    color: #10b981;
}

.returns-stat-value.text-amber {
    color: #f59e0b;
}

/* --- Work Grid Layout (Wizard Left, Ledger Right) --- */
.returns-page-grid {
    display: grid;
    grid-template-columns: 460px 1fr;
    gap: 16px;
    align-items: start;
    flex: 1;
}

@media (max-width: 1200px) {
    .returns-page-grid {
        grid-template-columns: 1fr;
    }
}

.returns-form-card,
.returns-history-card {
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 18px 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
}

.returns-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    margin-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.returns-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.05rem;
    font-weight: 700;
    color: #f8fafc;
}

.returns-card-badge {
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
    font-size: 0.72rem;
    font-weight: 700;
}

/* --- Wizard Steps --- */
.returns-step {
    display: flex;
    gap: 14px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
}

.returns-step:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.returns-step-badge {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.22);
    color: white;
    font-size: 0.85rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.returns-step-content {
    flex: 1;
    min-width: 0;
}

.returns-step-content .field-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: #94a3b8;
    margin-bottom: 6px;
}

.returns-search-row {
    display: flex;
    gap: 8px;
}

.returns-search-row .inp {
    flex: 1;
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #f8fafc;
    border-radius: 9px;
    font-size: 0.88rem;
    padding: 9px 12px;
}

.returns-search-row .inp:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}

.returns-search-btn {
    border-radius: 9px;
    padding: 0 16px;
    font-weight: 700;
    background: linear-gradient(135deg, #4f46e5, #6366f1);
}

.returns-recent-select {
    margin-top: 8px;
    width: 100%;
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 0.82rem;
    color: #cbd5e1;
}

/* Sale Meta Preview Card */
.returns-sale-meta {
    margin-top: 12px;
    padding: 12px 14px;
    background: rgba(10, 15, 30, 0.85);
    border-radius: 12px;
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-left: 4px solid #6366f1;
    display: none;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.returns-sale-meta.visible {
    display: block;
    animation: fadeInReturnsMeta 0.2s ease-out;
}

@keyframes fadeInReturnsMeta {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.returns-sale-meta-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
}

.returns-sale-meta-id {
    font-weight: 800;
    color: #e0e7ff;
    font-size: 0.94rem;
}

.returns-sale-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px 14px;
}

.returns-sale-meta-row {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    font-size: 0.78rem;
}

.returns-sale-meta-row .rsm-label {
    color: #94a3b8;
}

.returns-sale-meta-row .rsm-value {
    color: #f1f5f9;
    font-weight: 600;
    text-align: right;
}

.returns-sale-meta-total-row {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
    padding-top: 8px;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
}

.returns-sale-meta-total-row .rsm-label {
    font-size: 0.8rem;
    color: #cbd5e1;
    font-weight: 600;
}

.returns-sale-meta-total-row .rsm-value {
    font-size: 1.15rem;
    color: #10b981;
    font-weight: 800;
}

/* Items Selection list */
.returns-items-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.returns-items-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.returns-selected-count {
    display: none;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.4);
    color: #c7d2fe;
    font-size: 0.72rem;
    font-weight: 700;
}

.returns-selected-count.visible {
    display: inline-block;
}

.returns-select-all {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #cbd5e1;
    cursor: pointer;
    user-select: none;
}

.returns-select-all input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #6366f1;
    cursor: pointer;
}

.returns-items-panel {
    max-height: 280px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 4px;
}

.return-line-pick {
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 10px;
    background: rgba(30, 41, 59, 0.65);
    transition: all 0.15s ease-out;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.return-line-pick:hover {
    border-color: rgba(99, 102, 241, 0.4);
    background: rgba(30, 41, 59, 0.9);
}

.return-line-pick.selected {
    border-color: #6366f1;
    background: rgba(30, 27, 75, 0.65);
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.3);
}

.return-line-checkbox {
    flex-shrink: 0;
    width: 17px;
    height: 17px;
    margin-top: 3px;
    accent-color: #6366f1;
    cursor: pointer;
}

.return-line-body {
    flex: 1;
    min-width: 0;
}

.return-line-name {
    font-weight: 600;
    color: #f8fafc;
    font-size: 0.88rem;
    line-height: 1.3;
}

.return-line-meta {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 4px;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
}

.return-line-price {
    color: #10b981;
    font-weight: 700;
}

.return-line-qty-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
}

.return-line-qty-inline label {
    font-size: 0.74rem;
    color: #cbd5e1;
    font-weight: 600;
}

.return-line-qty-inline input[type="number"] {
    width: 70px;
    padding: 4px 8px;
    font-size: 0.85rem;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    border-radius: 6px;
    text-align: center;
}

.return-line-subtotal {
    margin-left: auto;
    font-weight: 800;
    color: #10b981;
    font-size: 0.88rem;
}

.return-line-serials {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
}

.return-line-serials-label {
    font-size: 0.72rem;
    color: #c7d2fe;
    font-weight: 600;
    margin-bottom: 6px;
}

.return-serials-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.return-serial-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.72rem;
    font-family: monospace;
    color: #cbd5e1;
    cursor: pointer;
    transition: all 0.15s;
}

.return-serial-chip:hover {
    border-color: #6366f1;
}

.return-serial-chip.checked {
    background: rgba(79, 70, 229, 0.3);
    border-color: #6366f1;
    color: #e0e7ff;
    font-weight: 700;
}

.return-serial-chip input[type="checkbox"] {
    width: 12px;
    height: 12px;
    accent-color: #6366f1;
    cursor: pointer;
    margin: 0;
}

/* Step 3 Form Elements */
.returns-selected-summary {
    padding: 8px 12px;
    background: rgba(16, 185, 129, 0.08);
    border-radius: 9px;
    border: 1px solid rgba(16, 185, 129, 0.25);
    margin-bottom: 12px;
    font-size: 0.82rem;
}

.returns-selected-table {
    width: 100%;
    border-collapse: collapse;
}

.returns-selected-table th {
    text-align: left;
    color: #94a3b8;
    font-weight: 600;
    font-size: 0.72rem;
    padding: 3px 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.returns-selected-table td {
    padding: 4px 4px;
    color: #f1f5f9;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.returns-selected-table .returns-selected-remove {
    cursor: pointer;
    color: #ef4444;
    font-weight: bold;
    text-align: center;
}

.returns-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.returns-form-full {
    grid-column: 1 / -1;
}

.returns-refund-preview {
    padding: 10px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(5, 150, 105, 0.08));
    border-radius: 10px;
    text-align: center;
    font-size: 1.25rem;
    font-weight: 800;
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.4);
    letter-spacing: -0.02em;
}

.returns-form-actions {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.returns-submit-btn {
    width: 100%;
    padding: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: 10px;
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
    transition: transform 0.15s, box-shadow 0.15s;
}

.returns-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.45);
}

/* Empty State */
.returns-empty-state {
    text-align: center;
    padding: 38px 20px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.35);
    border: 2px dashed rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    margin-top: 8px;
}

.returns-empty-icon {
    font-size: 2.2rem;
    margin-bottom: 8px;
    opacity: 0.7;
}

.returns-empty-title {
    font-size: 0.94rem;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 4px;
}

.returns-empty-desc {
    font-size: 0.78rem;
    color: #64748b;
    max-width: 320px;
    margin: 0 auto;
    line-height: 1.4;
}

/* --- Right Side Ledger / History --- */
.returns-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-wrap: wrap;
}

.returns-history-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.returns-history-badge {
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.35);
    color: #a5b4fc;
    font-size: 0.75rem;
    font-weight: 700;
}

.returns-history-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.returns-search-wrap {
    position: relative;
}

.returns-search-inp {
    width: 170px;
    height: 33px;
    padding: 6px 10px;
    font-size: 0.8rem;
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: #f8fafc;
}

.returns-filter-select {
    height: 33px;
    padding: 5px 10px;
    font-size: 0.8rem;
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: #cbd5e1;
}

.returns-refresh-btn {
    height: 33px;
    padding: 0 10px;
    border-radius: 8px;
    border-color: rgba(255, 255, 255, 0.12) !important;
}

.returns-history-scroll {
    overflow-x: auto;
    max-height: calc(100vh - 290px);
    overflow-y: auto;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.returns-history-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 680px;
}

.returns-history-table th {
    position: sticky;
    top: 0;
    background: #0f172a;
    z-index: 2;
    padding: 10px 12px;
    font-size: 0.74rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
}

.returns-history-table td {
    padding: 10px 12px;
    font-size: 0.82rem;
    color: #cbd5e1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    vertical-align: middle;
}

.returns-history-table tr:hover td {
    background: rgba(99, 102, 241, 0.05);
}

/* Status Badges */
.returns-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

.returns-status-refunded {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.returns-status-pending {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.returns-status-approved {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.return-reason-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 6px;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.25);
    color: #c7d2fe;
    font-size: 0.74rem;
    font-weight: 600;
}

.return-notes-bubble {
    font-size: 0.74rem;
    color: #94a3b8;
    background: rgba(0, 0, 0, 0.25);
    padding: 3px 7px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    max-width: 220px;
    white-space: normal;
    word-break: break-word;
    line-height: 1.3;
}

/* ================================================================ */
/* Returns Page — Light Theme Support                                */
/* ================================================================ */
body.light-theme .returns-page {
    color: #1e293b;
}

body.light-theme .returns-page-header {
    border-bottom-color: #e2e8f0;
}

body.light-theme .returns-page-title {
    color: #0f172a !important;
}

body.light-theme .returns-page-subtitle {
    color: #64748b !important;
}

body.light-theme .returns-title-icon {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(79, 70, 229, 0.05));
    border-color: rgba(99, 102, 241, 0.25);
}

body.light-theme .returns-clean-btn {
    border-color: #cbd5e1 !important;
    color: #475569 !important;
}

body.light-theme .returns-clean-btn:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
}

body.light-theme .returns-stat-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

body.light-theme .returns-stat-card:hover {
    border-color: #6366f1 !important;
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.08) !important;
}

body.light-theme .returns-stat-label {
    color: #64748b !important;
}

body.light-theme .returns-stat-value {
    color: #0f172a !important;
}

body.light-theme .returns-form-card,
body.light-theme .returns-history-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05) !important;
}

body.light-theme .returns-card-header {
    border-bottom-color: #e2e8f0;
}

body.light-theme .returns-card-title {
    color: #0f172a !important;
}

body.light-theme .returns-step {
    border-bottom-color: #e2e8f0;
}

body.light-theme .returns-step-content .field-label {
    color: #475569 !important;
}

body.light-theme .returns-search-row .inp,
body.light-theme .returns-recent-select,
body.light-theme .returns-search-inp,
body.light-theme .returns-filter-select {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

body.light-theme .returns-search-row .inp:focus,
body.light-theme .returns-search-inp:focus {
    background: #ffffff !important;
    border-color: #6366f1 !important;
}

body.light-theme .returns-sale-meta {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
}

body.light-theme .returns-sale-meta-header,
body.light-theme .returns-sale-meta-total-row {
    border-bottom-color: #e2e8f0;
    border-top-color: #e2e8f0;
}

body.light-theme .returns-sale-meta-id {
    color: #1e1b4b !important;
}

body.light-theme .returns-sale-meta-row .rsm-label {
    color: #64748b !important;
}

body.light-theme .returns-sale-meta-row .rsm-value {
    color: #0f172a !important;
}

body.light-theme .returns-sale-meta-total-row .rsm-label {
    color: #334155 !important;
}

body.light-theme .return-line-pick {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
}

body.light-theme .return-line-pick:hover {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
}

body.light-theme .return-line-pick.selected {
    background: #eef2ff !important;
    border-color: #6366f1 !important;
}

body.light-theme .return-line-name {
    color: #0f172a !important;
}

body.light-theme .return-line-meta {
    color: #64748b !important;
}

body.light-theme .return-line-qty-inline,
body.light-theme .return-line-serials {
    border-top-color: #e2e8f0;
}

body.light-theme .return-line-qty-inline input[type="number"] {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

body.light-theme .return-serial-chip {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    color: #334155 !important;
}

body.light-theme .return-serial-chip.checked {
    background: #eef2ff !important;
    border-color: #6366f1 !important;
    color: #4338ca !important;
}

body.light-theme .returns-selected-summary {
    background: #f0fdf4 !important;
    border-color: #bbf7d0 !important;
}

body.light-theme .returns-selected-table th {
    color: #64748b !important;
    border-bottom-color: #dcfce7 !important;
}

body.light-theme .returns-selected-table td {
    color: #14532d !important;
    border-bottom-color: #f0fdf4 !important;
}

body.light-theme .returns-refund-preview {
    background: #f0fdf4 !important;
    border-color: #86efac !important;
    color: #15803d !important;
}

body.light-theme .returns-empty-state {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
}

body.light-theme .returns-empty-title {
    color: #0f172a !important;
}

body.light-theme .returns-empty-desc {
    color: #64748b !important;
}

body.light-theme .returns-history-header {
    border-bottom-color: #e2e8f0;
}

body.light-theme .returns-history-table th {
    background: #f8fafc !important;
    color: #475569 !important;
    border-bottom-color: #e2e8f0 !important;
}

body.light-theme .returns-history-table td {
    color: #1e293b !important;
    border-bottom-color: #f1f5f9 !important;
}

body.light-theme .returns-history-table tr:hover td {
    background: #f8fafc !important;
}

body.light-theme .return-reason-badge {
    background: #eef2ff !important;
    border-color: #c7d2fe !important;
    color: #4338ca !important;
}

body.light-theme .return-notes-bubble {
    background: #f1f5f9 !important;
    border-color: #e2e8f0 !important;
    color: #475569 !important;
}

body.light-theme .returns-refresh-btn {
    border-color: #cbd5e1 !important;
    color: #475569 !important;
}

/* ================================================================ */
/* Transfer Modals — Light Theme Support                            */
/* ================================================================ */
body.light-theme #transferInvoiceModal .modal,
body.light-theme #transferDetailsModal .modal,
body.light-theme #transferEditModal .modal {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12) !important;
    color: #0f172a !important;
}

body.light-theme #transferInvoiceModal .modal>div:first-child,
body.light-theme #transferDetailsModal .modal>div:first-child,
body.light-theme #transferEditModal .modal>div:first-child {
    background: #f8fafc !important;
    border-bottom-color: #e2e8f0 !important;
}

body.light-theme #transferInvoiceModal .modal>div:first-child>div>div:first-child,
body.light-theme #transferDetailsModal .modal>div:first-child>div,
body.light-theme #transferEditModal .modal>div:first-child>div:first-child {
    color: #0f172a !important;
}

body.light-theme #transferDocNumberDisplay {
    color: #4f46e5 !important;
}

body.light-theme #transferInvoiceModal .inp,
body.light-theme #transferInvoiceModal select.inp,
body.light-theme #transferInvoiceModal textarea.inp,
body.light-theme #transferEditModal .inp,
body.light-theme #transferEditModal textarea.inp {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}

body.light-theme #transferInvoiceModal .inp:focus,
body.light-theme #transferInvoiceModal select.inp:focus,
body.light-theme #transferInvoiceModal textarea.inp:focus,
body.light-theme #transferEditModal .inp:focus {
    background: #ffffff !important;
    border-color: #6366f1 !important;
}

body.light-theme #transferInvoiceModal label,
body.light-theme #transferEditModal label {
    color: #475569 !important;
}

body.light-theme #transferInvoiceModal table,
body.light-theme #transferDetailsModal table {
    border-color: #e2e8f0 !important;
}

body.light-theme #transferInvoiceModal table tr,
body.light-theme #transferInvoiceModal table thead tr {
    background: #f1f5f9 !important;
}

body.light-theme #transferInvoiceModal table th {
    color: #475569 !important;
    border-color: #e2e8f0 !important;
}

body.light-theme #transferInvoiceModal table td {
    color: #0f172a !important;
    border-color: #f1f5f9 !important;
}

body.light-theme #transferInvoiceModal div[style*="border: 1px solid #334155"] {
    border-color: #e2e8f0 !important;
}

/* Login card styles */

#loginScreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0b0f19 !important;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    font-family: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
}

#loginScreen::before {
    content: '';
    position: absolute;
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.22) 0%, rgba(99, 102, 241, 0) 70%);
    top: 10%;
    right: 15%;
    border-radius: 50%;
    z-index: 0;
    filter: blur(60px);
    pointer-events: none;
}

#loginScreen::after {
    content: '';
    position: absolute;
    width: 550px;
    height: 550px;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.15) 0%, rgba(236, 72, 153, 0) 70%);
    bottom: 5%;
    left: 10%;
    border-radius: 50%;
    z-index: 0;
    filter: blur(80px);
    pointer-events: none;
}

.login-container-wrapper {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 420px;
    padding: 20px;
    box-sizing: border-box;
}

.login-card {
    background: rgba(17, 25, 40, 0.55) !important;
    border: 1px solid rgba(255, 255, 255, 0.125) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6), 0 0 40px rgba(0, 0, 0, 0.2) !important;
    border-radius: 24px !important;
    padding: 56px 40px 40px !important;
    position: relative;
    width: 100%;
    box-sizing: border-box;
    margin: 20px auto;
}

.login-logo-floating {
    width: 120px;
    height: 100px;
    border-radius: 8px;
    /* background: linear-gradient(135deg, #3b82f6, #ec4899); */
    background: #0f1526;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.3);
    position: absolute;
    top: -32px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.login-title-h1 {
    font-size: 26px;
    font-weight: 700;
    color: white;
    text-align: center;
    margin: 10px 0 6px;
    letter-spacing: 0.5px;
}

.login-subtitle-p {
    font-size: 13px;
    color: #94a3b8;
    text-align: center;
    margin: 0 0 32px;
    line-height: 1.4;
}

.input-group-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 8px;
}

.input-field-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 24px;
}

.input-field {
    width: 100%;
    padding: 14px 16px 14px 44px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: white;
    font-size: 14px;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05);
    box-sizing: border-box;
}

.input-field:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(99, 102, 241, 0.6);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05), 0 0 16px rgba(99, 102, 241, 0.35);
}

.input-field::placeholder {
    color: #64748b;
}

.input-icon-left {
    position: absolute;
    left: 14px;
    color: #64748b;
    font-size: 1.1rem;
    pointer-events: none;
    user-select: none;
}

.input-icon-right {
    position: absolute;
    right: 14px;
    color: #64748b;
    font-size: 1.1rem;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
}

.input-icon-right:hover {
    color: #a5b4fc;
}

.login-options-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    font-size: 13px;
}

.login-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #94a3b8;
    cursor: pointer;
    user-select: none;
}

.login-checkbox-label input {
    accent-color: #6366f1;
    width: 16px;
    height: 16px;
    border-radius: 4px;
    cursor: pointer;
}

.login-forgot-link {
    color: #818cf8;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.login-forgot-link:hover {
    color: #a5b4fc;
}

.login-btn-premium {
    width: 100%;
    padding: 14px;
    background: linear-gradient(90deg, #6366f1, #a855f7);
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 700;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 10px 20px rgba(99, 102, 241, 0.35);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-btn-premium:hover {
    background: linear-gradient(90deg, #4f46e5, #9333ea);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 12px 24px rgba(99, 102, 241, 0.45);
    transform: translateY(-1px);
}

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

/* ================================================================ */
/* Light theme final layer                                           */
/* ================================================================ */

body.light-theme {
    --bg-main: #f5f7fb;
    --bg-surface: #eef3f8;
    --bg-card: #ffffff;
    --bg-card-soft: #f8fafc;
    --text-main: #243044;
    --text-muted: #69778c;
    --border-main: #dbe3ee;
    --border-soft: #e8eef6;
    --accent: #4f46e5;
    --accent-soft: rgba(79, 70, 229, 0.09);
    --success: #16814a;
    --warning: #b7791f;
    --danger: #c2413b;
    background: linear-gradient(180deg, #f8fafc 0%, var(--bg-main) 100%) !important;
    color: var(--text-main) !important;
}

body.light-theme ::-moz-selection {
    background: rgba(79, 70, 229, 0.18);
    color: var(--text-main);
}

body.light-theme ::selection {
    background: rgba(79, 70, 229, 0.18);
    color: var(--text-main);
}

body.light-theme::-webkit-scrollbar-track,
body.light-theme *::-webkit-scrollbar-track {
    background: var(--bg-surface);
}

body.light-theme::-webkit-scrollbar-thumb,
body.light-theme *::-webkit-scrollbar-thumb {
    background: #c7d2e1;
    border-radius: 4px;
}

body.light-theme::-webkit-scrollbar-thumb:hover,
body.light-theme *::-webkit-scrollbar-thumb:hover {
    background: #9fb0c5;
}

body.light-theme header {
    background: rgba(255, 255, 255, 0.92) !important;
    border-bottom: 1px solid var(--border-main) !important;
    box-shadow: 0 8px 28px rgba(31, 41, 55, 0.06);
}

body.light-theme aside,
body.light-theme .glass {
    background: rgba(255, 255, 255, 0.84) !important;
    border-color: var(--border-main) !important;
    color: var(--text-main) !important;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 30px rgba(31, 41, 55, 0.04);
}

body.light-theme main,
body.light-theme .tab-panel,
body.light-theme .card,
body.light-theme .card-premium,
body.light-theme .modal,
body.light-theme .modal-content,
body.light-theme .chart-card,
body.light-theme .stat-card,
body.light-theme .product-dropdown,
body.light-theme .returns-form-card,
body.light-theme .returns-history-card,
body.light-theme .login-card,
body.light-theme [role="region"],
body.light-theme [style*="background: #0d1526"],
body.light-theme [style*="background:#0d1526"],
body.light-theme [style*="background: #0a0f1e"],
body.light-theme [style*="background:#0a0f1e"],
body.light-theme [style*="background: #111827"],
body.light-theme [style*="background:#111827"],
body.light-theme [style*="background: #050812"],
body.light-theme [style*="background:#050812"] {
    background: var(--bg-card) !important;
    color: var(--text-main) !important;
    border-color: var(--border-main) !important;
    box-shadow: 0 10px 30px rgba(31, 41, 55, 0.06);
}

body.light-theme [style*="background: #0a0f1a"],
body.light-theme [style*="background:#0a0f1a"],
body.light-theme [style*="background: #1a2035"],
body.light-theme [style*="background:#1a2035"],
body.light-theme [style*="background: #1f2937"],
body.light-theme [style*="background:#1f2937"],
body.light-theme .returns-sale-meta,
body.light-theme .returns-selected-summary,
body.light-theme .returns-refund-preview,
body.light-theme .return-line-pick,
body.light-theme .pos-cat-header,
body.light-theme .pos-item-sku,
body.light-theme .price-tier-toggle,
body.light-theme .barcode-preview-container {
    background: var(--bg-card-soft) !important;
    color: var(--text-main) !important;
    border-color: var(--border-main) !important;
}

body.light-theme h1,
body.light-theme h2,
body.light-theme h3,
body.light-theme h4,
body.light-theme h5,
body.light-theme h6,
body.light-theme .card-title,
body.light-theme .returns-page-title,
body.light-theme .return-line-pick .return-line-name,
body.light-theme .product-dropdown-item-name,
body.light-theme .stat-value,
body.light-theme .detail-value,
body.light-theme [style*="color:white"],
body.light-theme [style*="color: white"],
body.light-theme [style*="color:#e2e8f0"],
body.light-theme [style*="color: #e2e8f0"],
body.light-theme [style*="color:#f1f5f9"],
body.light-theme [style*="color: #f1f5f9"] {
    color: var(--text-main) !important;
}

body.light-theme .field-label,
body.light-theme .stat-label,
body.light-theme .returns-page-subtitle,
body.light-theme .product-dropdown-item-sku,
body.light-theme .pos-item-stock,
body.light-theme .product-muted,
body.light-theme .returns-empty-state,
body.light-theme .return-line-pick .return-line-meta,
body.light-theme .stat-items,
body.light-theme [style*="color:#9ca3af"],
body.light-theme [style*="color: #9ca3af"],
body.light-theme [style*="color:#6b7280"],
body.light-theme [style*="color: #6b7280"],
body.light-theme [style*="color:#9398a1"],
body.light-theme [style*="color: #9398a1"] {
    color: var(--text-muted) !important;
}

body.light-theme .nav-link {
    color: var(--text-muted);
}

body.light-theme .nav-link:hover,
body.light-theme .nav-link.active {
    background: var(--accent-soft);
    color: var(--accent);
}

body.light-theme .card,
body.light-theme .card-premium,
body.light-theme .stat-card,
body.light-theme .pos-list-item,
body.light-theme .return-line-pick {
    border: 1px solid var(--border-main);
    box-shadow: 0 8px 24px rgba(31, 41, 55, 0.05);
}

body.light-theme .card:hover,
body.light-theme .stat-card:hover,
body.light-theme .pos-list-item:hover,
body.light-theme .return-line-pick:hover {
    border-color: rgba(79, 70, 229, 0.28);
    box-shadow: 0 12px 30px rgba(79, 70, 229, 0.08);
}

body.light-theme .inp,
body.light-theme .input-field,
body.light-theme input,
body.light-theme textarea,
body.light-theme select {
    background: #ffffff !important;
    color: var(--text-main) !important;
    border: 1px solid #cbd6e4 !important;
}

body.light-theme .inp:focus,
body.light-theme .input-field:focus,
body.light-theme input:focus,
body.light-theme textarea:focus,
body.light-theme select:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12) !important;
}

body.light-theme .inp::-webkit-input-placeholder,
body.light-theme .input-field::-webkit-input-placeholder,
body.light-theme input::-webkit-input-placeholder,
body.light-theme textarea::-webkit-input-placeholder {
    color: #98a6b8 !important;
}

body.light-theme .inp::-moz-placeholder,
body.light-theme .input-field::-moz-placeholder,
body.light-theme input::-moz-placeholder,
body.light-theme textarea::-moz-placeholder {
    color: #98a6b8 !important;
}

body.light-theme .inp:-ms-input-placeholder,
body.light-theme .input-field:-ms-input-placeholder,
body.light-theme input:-ms-input-placeholder,
body.light-theme textarea:-ms-input-placeholder {
    color: #98a6b8 !important;
}

body.light-theme .inp::-ms-input-placeholder,
body.light-theme .input-field::-ms-input-placeholder,
body.light-theme input::-ms-input-placeholder,
body.light-theme textarea::-ms-input-placeholder {
    color: #98a6b8 !important;
}

body.light-theme .inp::placeholder,
body.light-theme .input-field::placeholder,
body.light-theme input::placeholder,
body.light-theme textarea::placeholder {
    color: #98a6b8 !important;
}

body.light-theme select.inp option,
body.light-theme select option {
    background: #ffffff;
    color: var(--text-main);
}

body.light-theme .btn-primary,
body.light-theme .price-tier-toggle button.active,
body.light-theme .login-btn,
body.light-theme .returns-submit-btn {
    background: linear-gradient(135deg, #5b55e6, #3f37c9) !important;
    color: #ffffff !important;
    box-shadow: 0 8px 18px rgba(79, 70, 229, 0.18);
}

body.light-theme .btn-outline,
body.light-theme .theme-toggle-btn,
body.light-theme .pos-item-add {
    background: rgba(79, 70, 229, 0.07) !important;
    border-color: rgba(79, 70, 229, 0.22) !important;
    color: var(--accent) !important;
}

body.light-theme .btn-outline:hover,
body.light-theme .theme-toggle-btn:hover,
body.light-theme .pos-item-add:hover {
    background: rgba(79, 70, 229, 0.13) !important;
    border-color: rgba(79, 70, 229, 0.36) !important;
    box-shadow: 0 8px 18px rgba(79, 70, 229, 0.12);
}

body.light-theme .btn-success {
    background: linear-gradient(135deg, #22a66a, #16814a) !important;
}

body.light-theme .btn-danger,
body.light-theme [style*="background: #7f1d1d"],
body.light-theme [style*="background:#7f1d1d"] {
    background: linear-gradient(135deg, #dc5a52, #b93832) !important;
    color: #fff7f7 !important;
    border-color: rgba(185, 56, 50, 0.3) !important;
}

body.light-theme .btn-warn {
    background: linear-gradient(135deg, #e0a344, #c17a18) !important;
}

body.light-theme table,
body.light-theme #productsTable,
body.light-theme .categories_table {
    background: #ffffff !important;
}

body.light-theme thead th,
body.light-theme .tbl th,
body.light-theme #productsTable thead th {
    background: #edf3f9 !important;
    color: #536076 !important;
    border-color: var(--border-main) !important;
}

body.light-theme tbody tr,
body.light-theme #productsTable tbody tr {
    border-color: var(--border-soft) !important;
}

body.light-theme td,
body.light-theme .tbl td,
body.light-theme #productsTable td {
    color: #314058 !important;
    border-color: var(--border-soft) !important;
}

body.light-theme tbody tr:hover,
body.light-theme .tbl tr:hover td,
body.light-theme #productsTable tbody tr:hover {
    background: #f7f9fd !important;
}

body.light-theme .modal-bg,
body.light-theme .modal-overlay,
body.light-theme [style*="background: rgba(0,0,0,0.8)"] {
    background: rgba(36, 48, 68, 0.28) !important;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

body.light-theme .toast {
    background: rgba(255, 255, 255, 0.95) !important;
    color: #1e293b !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 10px 25px rgba(31, 41, 55, 0.1);
}

body.light-theme .badge {
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px solid rgba(79, 70, 229, 0.16);
}

body.light-theme .b-green,
body.light-theme .returns-status-refunded {
    background: rgba(22, 129, 74, 0.1);
    color: var(--success);
    border-color: rgba(22, 129, 74, 0.2);
}

body.light-theme .b-yellow,
body.light-theme .returns-status-pending {
    background: rgba(183, 121, 31, 0.12);
    color: var(--warning);
    border-color: rgba(183, 121, 31, 0.22);
}

body.light-theme .b-red {
    background: rgba(194, 65, 59, 0.1);
    color: var(--danger);
    border-color: rgba(194, 65, 59, 0.2);
}

body.light-theme .b-blue,
body.light-theme .returns-status-approved {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
    border-color: rgba(59, 130, 246, 0.2);
}

body.light-theme .b-purple {
    background: rgba(124, 58, 237, 0.1);
    color: #6d28d9;
    border-color: rgba(124, 58, 237, 0.2);
}

body.light-theme .product-dropdown-item {
    color: #314058;
    border-bottom-color: var(--border-soft);
}

body.light-theme .product-dropdown-item:hover,
body.light-theme .product-dropdown-item.selected,
body.light-theme .product-dropdown-item.highlighted,
body.light-theme .return-line-pick.selected {
    background: #eef2ff !important;
    border-color: rgba(79, 70, 229, 0.34) !important;
}

body.light-theme .pos-cat-header {
    color: #2f4d83 !important;
    border-left: 4px solid #6d8ed8 !important;
    font-weight: 650;
}

body.light-theme .pos-item-price,
body.light-theme [style*="color: #10b981"],
body.light-theme [style*="color: #16a34a"],
body.light-theme [style*="color:#10b981"] {
    color: var(--success) !important;
    font-weight: 650 !important;
}

body.light-theme .detail-key {
    color: var(--accent);
}

body.light-theme .detail-json,
body.light-theme .tbl-cell-truncate[title]:hover {
    background: var(--bg-card-soft) !important;
    border-color: var(--border-main) !important;
    color: var(--success) !important;
}

body.light-theme #cartItems::-webkit-scrollbar-track {
    background: var(--bg-surface);
}

body.light-theme #cartItems::-webkit-scrollbar-thumb {
    background: #b7c4d6;
}

body.light-theme [style*="background: #0f172a"],
body.light-theme [style*="background:#0f172a"],
body.light-theme [style*="background: #374151"],
body.light-theme [style*="background:#374151"],
body.light-theme [style*="background:linear-gradient(135deg, #111827"],
body.light-theme [style*="background: linear-gradient(135deg, #111827"],
body.light-theme [style*="background:linear-gradient(135deg,#111827"],
body.light-theme [style*="background: linear-gradient(135deg,#111827"],
body.light-theme [style*="background:linear-gradient(135deg, #1f2937"],
body.light-theme [style*="background: linear-gradient(135deg, #1f2937"],
body.light-theme [style*="background:linear-gradient(90deg, #1f2937"],
body.light-theme [style*="background: linear-gradient(90deg, #1f2937"] {
    background: var(--bg-card-soft) !important;
    color: var(--text-main) !important;
    border-color: var(--border-main) !important;
}

body.light-theme button[style*="color: white"],
body.light-theme button[style*="color:white"],
body.light-theme #userBadge,
body.light-theme #globalStockAlertBtn,
body.light-theme #globalStockAlertBtn *,
body.light-theme [style*="background: #4f46e5"],
body.light-theme [style*="background:#4f46e5"],
body.light-theme [style*="background: #10b981"],
body.light-theme [style*="background:#10b981"],
body.light-theme [style*="background:linear-gradient(135deg,#4f46e5"],
body.light-theme [style*="background: linear-gradient(135deg,#4f46e5"],
body.light-theme [style*="background:linear-gradient(135deg, #4f46e5"],
body.light-theme [style*="background: linear-gradient(135deg, #4f46e5"],
body.light-theme [style*="background:linear-gradient(135deg,#2563eb"],
body.light-theme [style*="background: linear-gradient(135deg,#2563eb"] {
    color: #ffffff !important;
}

body.light-theme .modal-header,
body.light-theme .modal-body,
body.light-theme .arrival-header-card,
body.light-theme .arrival-table-wrapper,
body.light-theme .profit-stat,
body.light-theme .detail-row,
body.light-theme .stock-alert-item,
body.light-theme .sh-detail-meta,
body.light-theme .return-line-pick,
body.light-theme [style*="background: rgba(0, 0, 0, 0.6)"],
body.light-theme .modal [style*="background: #0f172a"],
body.light-theme .modal [style*="background:#0f172a"],
body.light-theme .modal [style*="background: #0a0f1e"],
body.light-theme .modal [style*="background:#0a0f1e"],
body.light-theme .modal [style*="background: #111827"],
body.light-theme .modal [style*="background:#111827"],
body.light-theme .modal [style*="background: #1f2937"],
body.light-theme .modal [style*="background:#1f2937"],
body.light-theme .modal [style*="background: #1e293b"],
body.light-theme .modal [style*="background:#1e293b"],
body.light-theme .modal [style*="background:linear-gradient(135deg, #111827"],
body.light-theme .modal [style*="background: linear-gradient(135deg, #111827"],
body.light-theme .modal [style*="background:linear-gradient(135deg, #1f2937"],
body.light-theme .modal [style*="background: linear-gradient(135deg, #1f2937"] {
    background: var(--bg-card-soft) !important;
    color: var(--text-main) !important;
    border-color: var(--border-main) !important;
    box-shadow: none;
}

body.light-theme .arrival-header-card,
body.light-theme .arrival-table-wrapper,
body.light-theme .detail-row,
body.light-theme .profit-stat,
body.light-theme .stock-alert-item {
    border: 1px solid var(--border-main);
}

body.light-theme .arrival-header-label,
body.light-theme .arrival-meta-label,
body.light-theme .badge-title,
body.light-theme .arrival-footer-left,
body.light-theme #lowStockModalSummary,
body.light-theme .modal [style*="color:#cbd5e1"],
body.light-theme .modal [style*="color: #cbd5e1"],
body.light-theme .modal [style*="color:#a5b4fc"],
body.light-theme .modal [style*="color: #a5b4fc"] {
    color: var(--text-muted) !important;
}

body.light-theme .arrival-badge,
body.light-theme .arrival-total-card {
    background: #eef2ff !important;
    border-color: rgba(79, 70, 229, 0.18) !important;
    color: var(--text-main) !important;
}

body.light-theme .arrival-badge span,
body.light-theme .arrival-meta-value,
body.light-theme .arrival-total-value,
body.light-theme .modal-header h3,
body.light-theme .close-modal,
body.light-theme .modal-close {
    color: var(--text-main) !important;
}

body.light-theme .arrival-table-wrapper {
    box-shadow: inset 0 0 0 1px rgba(219, 227, 238, 0.65);
}

body.light-theme .arrival-footer-bar,
body.light-theme .modal-header {
    border-color: var(--border-main) !important;
}

body.light-theme .modal-close {
    background: rgba(194, 65, 59, 0.08) !important;
    border-color: rgba(194, 65, 59, 0.2) !important;
}

body.light-theme .stock-alert-item:hover {
    background: #eef2ff !important;
}

#mergeIncomingCheckbox {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    z-index: 9999 !important;
    position: relative !important;
    width: 22px !important;
    height: 22px !important;
    cursor: pointer !important;
}

.cb-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgb(0 0 0 / 65%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.cb-card {
    background: #111827;
    width: 100%;
    max-width: 440px;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    border: 1px solid #1f2937;
    animation: cbSlideIn 0.2s ease-out;
}

@keyframes cbSlideIn {
    from {
        transform: translateY(-15px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cb-header {
    background: #0d1526;
    color: #f8fafc;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #1f2937;
}

.cb-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cb-header-title h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.cb-close-btn {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 24px;
    cursor: pointer;
}

.cb-close-btn:hover {
    color: #fff;
}

.cb-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cb-form-field {
    display: flex;
    flex-direction: column;
}

.cb-field-label {
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #94a3b8;
}

.cb-transaction-toggle {
    display: flex;
    background: #1f2937;
    padding: 4px;
    border-radius: 8px;
    gap: 4px;
}

.cb-toggle-option {
    flex: 1;
    cursor: pointer;
}

.cb-toggle-option input {
    display: none;
}

.cb-toggle-button {
    display: block;
    text-align: center;
    padding: 8px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #94a3b8;
    transition: all 0.2s;
}

.cb-toggle-option input:checked+.cb-inflow-btn {
    background: #10b981;
    color: white;
}

.cb-toggle-option input:checked+.cb-outflow-btn {
    background: #ef4444;
    color: white;
}

.cb-select,
.cb-input-num,
.cb-textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #374151;
    border-radius: 8px;
    font-size: 14px;
    color: #fff;
    background-color: #1f2937;
    box-sizing: border-box;
    outline: none;
}

.cb-select:focus,
.cb-input-num:focus,
.cb-textarea:focus {
    border-color: #6366f1;
}

.cb-input-currency-group {
    display: flex;
    align-items: center;
}

.cb-input-currency-group .cb-input-num {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
}

.cb-currency-select {
    width: 90px;
    padding: 10px;
    background-color: #374151;
    border: 1px solid #4b5563;
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    outline: none;
}

.cb-textarea {
    resize: none;
    font-family: inherit;
}

.cb-form-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 10px;
}

.cb-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    flex: 1;
    text-align: center;
}

.cb-btn-secondary {
    background-color: #374151;
    color: #94a3b8;
}

.cb-btn-secondary:hover {
    background-color: #4b5563;
    color: #fff;
}

.cb-btn-primary {
    background-color: #4f46e5;
    color: white;
}

.cb-btn-primary:hover {
    background-color: #4338ca;
}

/* ================================================================
   REDESIGNED MODULES: CART, PRODUCT HISTORY, SALES HISTORY, AUDIT
   Multi-user safe — no shared client-side state mutations
   ================================================================ */

/* === CART REDESIGN === */
.cart-v2-container {
    width: 520px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #0d1526 0%, #0a0f1e 100%);
    border-left: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
}

.cart-v2-header {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(13, 21, 38, 0.8);
    backdrop-filter: blur(12px);
    flex-shrink: 0;
}

.cart-v2-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.cart-v2-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-v2-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.3), rgba(124, 58, 237, 0.3));
    border: 1px solid rgba(99, 102, 241, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.cart-v2-label {
    font-size: 1rem;
    font-weight: 700;
    color: white;
    letter-spacing: -0.01em;
}

.cart-v2-count-badge {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    border-radius: 20px;
    padding: 2px 9px;
    font-size: 0.78rem;
    font-weight: 700;
    min-width: 24px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.4);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cart-v2-count-badge.bump {
    animation: cartBadgeBump 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cartBadgeBump {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.4);
    }

    100% {
        transform: scale(1);
    }
}

.cart-v2-actions {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(15, 23, 42, 0.55);
    padding: 3px 5px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(8px);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.cart-v2-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 6px 11px;
    border-radius: 7px;
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    letter-spacing: 0.01em;
    user-select: none;
    position: relative;
    white-space: nowrap;
}

.cart-v2-btn:active {
    transform: scale(0.95);
}

.cart-v2-btn-hold {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.28);
    color: #fbbf24;
}

.cart-v2-btn-hold:hover {
    background: rgba(245, 158, 11, 0.24);
    border-color: rgba(245, 158, 11, 0.65);
    color: #fef3c7;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.28);
}

.cart-v2-btn-load {
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.28);
    color: #38bdf8;
}

.cart-v2-btn-load:hover {
    background: rgba(56, 189, 248, 0.24);
    border-color: rgba(56, 189, 248, 0.65);
    color: #e0f2fe;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(56, 189, 248, 0.28);
}

.cart-v2-btn-clear {
    background: rgba(244, 63, 94, 0.12);
    border-color: rgba(244, 63, 94, 0.28);
    color: #fb7185;
}

.cart-v2-btn-clear:hover {
    background: rgba(244, 63, 94, 0.24);
    border-color: rgba(244, 63, 94, 0.65);
    color: #ffe4e6;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(244, 63, 94, 0.28);
}

.cart-v2-configurator-btn {
    width: 100%;
    margin-top: 10px;
    margin-bottom: 6px;
    padding: 9px 14px;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 9px;
    color: #a5b4fc;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    font-size: 0.86rem;
}

.cart-v2-configurator-btn:hover {
    background: rgba(99, 102, 241, 0.24);
    border-color: rgba(129, 140, 248, 0.6);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.25);
}

/* Parked Sales Chip */
.parked-chip {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(217, 119, 6, 0.07) 100%);
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 11px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 7px;
    margin-bottom: 3px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(8px);
}

.parked-chip::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3.5px;
    height: 100%;
    background: linear-gradient(to bottom, #f59e0b, #d97706);
    border-radius: 4px 0 0 4px;
}

.parked-chip:hover {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.25) 0%, rgba(217, 119, 6, 0.14) 100%);
    border-color: rgba(245, 158, 11, 0.7);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(245, 158, 11, 0.24);
}

.parked-chip:active {
    transform: scale(0.98);
}

.parked-chip.visible {
    display: flex;
}

.parked-chip-icon-box {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    background: rgba(245, 158, 11, 0.22);
    border: 1px solid rgba(245, 158, 11, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fbbf24;
    font-size: 0.85rem;
    flex-shrink: 0;
    animation: parkedPulse 2.4s infinite ease-in-out;
}

@keyframes parkedPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.08);
        opacity: 0.75;
    }
}

.parked-chip-label {
    font-size: 0.78rem;
    color: #fef3c7;
    font-weight: 600;
    flex: 1;
    letter-spacing: 0.01em;
}

.parked-chip-badge {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #0f172a;
    border-radius: 20px;
    padding: 2px 9px;
    font-size: 0.72rem;
    font-weight: 800;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.4);
}

.parked-chip-arrow {
    font-size: 0.85rem;
    color: rgba(254, 243, 199, 0.6);
    transition: transform 0.2s ease, color 0.2s ease;
}

.parked-chip:hover .parked-chip-arrow {
    transform: translateX(3px);
    color: #fbbf24;
}

/* Cart Items Area */
.cart-v2-items {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cart-v2-items::-webkit-scrollbar {
    width: 4px;
}

.cart-v2-items::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.cart-v2-items::-webkit-scrollbar-thumb {
    background: #4f46e5;
    border-radius: 4px;
}

.cart-v2-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px 20px;
    color: #374151;
    text-align: center;
}

.cart-v2-empty-icon {
    font-size: 3rem;
    opacity: 0.4;
}

.cart-v2-empty-text {
    font-size: 0.85rem;
    color: #4b5563;
}

/* Cart Item Cards */
.cart-item-v2 {
    height: auto;
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.9), rgba(10, 15, 30, 0.9));
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 15px 15px;
    transition: all 0.2s;
    animation: cartItemIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    /* overflow: hidden; */
}

.cart-item-v2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #4f46e5, #7c3aed);
    border-radius: 3px 0 0 3px;
    opacity: 0;
    transition: opacity 0.2s;
}

.cart-item-v2:hover {
    border-color: rgba(99, 102, 241, 0.4);
    background: linear-gradient(135deg, rgba(22, 30, 52, 0.95), rgba(15, 22, 42, 0.95));
    transform: translateX(2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.cart-item-v2:hover::before {
    opacity: 1;
}

@keyframes cartItemIn {
    from {
        opacity: 0;
        transform: translateX(20px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.cart-item-v2.removing {
    animation: cartItemOut 0.2s ease forwards;
}

@keyframes cartItemOut {
    to {
        opacity: 0;
        transform: translateX(-20px) scale(0.95);
        height: 0;
        padding: 0;
        margin: 0;
    }
}

.cart-item-v2-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 8px;
}

.cart-item-v2-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: #e2e8f0;
    line-height: 1.3;
    flex: 1;
    margin-right: 8px;
}

.cart-item-v2-remove {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #f87171;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    transition: all 0.15s;
    flex-shrink: 0;
    line-height: 1;
    font-family: inherit;
}

.cart-item-v2-remove:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.5);
    transform: scale(1.1);
}

.cart-item-v2-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.cart-item-v2-qty-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cart-item-v2-qty-btn {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.25);
    color: #a5b4fc;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    transition: all 0.15s;
    line-height: 1;
    font-family: inherit;
}

.cart-item-v2-qty-btn:hover {
    background: rgba(99, 102, 241, 0.25);
    border-color: rgba(99, 102, 241, 0.5);
    transform: scale(1.05);
}

.cart-item-v2-qty-display {
    font-size: 0.88rem;
    font-weight: 700;
    color: white;
    min-width: 24px;
    text-align: center;
}

.cart-item-v2-price-col {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.cart-item-v2-unit-price {
    font-size: 0.68rem;
    color: #6b7280;
}

.cart-item-v2-total-price {
    font-size: 0.9rem;
    font-weight: 700;
    color: #a5b4fc;
}

.cart-item-v2-sn {
    font-size: 0.65rem;
    color: #4b5563;
    font-family: monospace;
    background: rgba(0, 0, 0, 0.3);
    padding: 1px 5px;
    border-radius: 4px;
    margin-top: 4px;
    display: inline-block;
}

.cart-item-v2-discount {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.cart-item-v2-discount label {
    font-size: 0.68rem;
    color: #6b7280;
    flex-shrink: 0;
}

.cart-item-v2-discount input {
    width: 60px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 5px;
    color: #fcd34d;
    font-size: 0.75rem;
    padding: 2px 6px;
    text-align: center;
    outline: none;
    font-family: inherit;
}

.cart-item-v2-discount input:focus {
    border-color: rgba(245, 158, 11, 0.5);
}

/* Cart Summary */
.cart-v2-summary {
    padding: 14px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(7, 11, 20, 0.9);
    flex-shrink: 0;
}

.cart-v2-summary-rows {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 12px;
}

.cart-v2-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
}

.cart-v2-summary-row.label {
    color: #6b7280;
}

.cart-v2-summary-row.label span:last-child {
    color: #9ca3af;
    font-weight: 500;
}

.cart-v2-summary-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.3), transparent);
    margin: 8px 0;
}

.cart-v2-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.cart-v2-total-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #d1d5db;
}

.cart-v2-total-value {
    font-size: 1.35rem;
    font-weight: 800;
    background: linear-gradient(135deg, #10b981, #34d399);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    transition: all 0.3s;
}

/* --- POS Cart Checkout Action Button (Primary CTA) --- */
.cart-v2-checkout-btn {
    width: 100%;
    padding: 13px 20px;
    margin-top: 4px;
    margin-bottom: 2px;
    background: linear-gradient(135deg, #10b981 0%, #059669 60%, #047857 100%);
    border: 1px solid rgba(52, 211, 153, 0.45);
    border-radius: 10px;
    color: #ffffff;
    font-weight: 800;
    font-size: 1.02rem;
    letter-spacing: 0.03em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    box-shadow: 0 5px 18px rgba(16, 185, 129, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    position: relative;
    overflow: hidden;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.cart-v2-checkout-btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(60deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: rotate(30deg) translateY(-100%);
    transition: transform 0.6s ease;
    pointer-events: none;
}

.cart-v2-checkout-btn:hover {
    background: linear-gradient(135deg, #34d399 0%, #10b981 60%, #059669 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    border-color: rgba(110, 231, 183, 0.7);
}

.cart-v2-checkout-btn:hover::after {
    transform: rotate(30deg) translateY(100%);
}

.cart-v2-checkout-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

/* === PRODUCT HISTORY ENTERPRISE SUITE (V3) === */
.ph-main-shell,
.ph-v2-container,
#tab-product-history {
    display: none;
    flex-direction: row;
    height: 100%;
    width: 100%;
    overflow: hidden;
    background: #060a15;
}

.tab-panel.ph-main-shell.active,
.tab-panel.ph-v2-container.active,
#tab-product-history.active {
    display: flex !important;
}

/* --- Left Sidebar: Product Catalog Navigator --- */
.ph-sidebar,
.ph-v2-left {
    width: 390px !important;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: #080d1c;
    border-right: 1px solid rgba(255, 255, 255, 0.07);
    overflow: hidden;
    z-index: 10;
}

.ph-sidebar-header {
    padding: 12px 14px 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

.ph-sidebar-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ph-sidebar-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #e2e8f0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ph-sidebar-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: rgba(99, 102, 241, 0.15);
    border-radius: 6px;
    font-size: 12px;
}

.ph-count-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.ph-search-wrap {
    position: relative;
    width: 100%;
}

.ph-search-input {
    width: 100%;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #f8fafc;
    padding: 7px 26px 7px 28px;
    font-size: 11.5px;
    outline: none;
    transition: all 0.2s;
    font-family: inherit;
}

.ph-search-input:focus {
    border-color: #6366f1;
    background: rgba(15, 23, 42, 0.95);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.ph-search-icon {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    color: #64748b;
    pointer-events: none;
}

.ph-search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 11px;
    padding: 2px 4px;
}

.ph-sidebar-filters {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ph-category-select {
    width: 100%;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 7px;
    color: #cbd5e1;
    padding: 5px 8px;
    font-size: 11px;
    outline: none;
    cursor: pointer;
}

.ph-stock-pills {
    display: flex;
    gap: 3px;
    background: rgba(0, 0, 0, 0.35);
    padding: 2px;
    border-radius: 7px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.ph-pill-btn {
    flex: 1;
    padding: 3px 6px;
    font-size: 10.5px;
    font-weight: 600;
    text-align: center;
    border: none;
    border-radius: 5px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.15s;
}

.ph-pill-btn:hover {
    color: #f1f5f9;
}

.ph-pill-btn.active {
    background: #4f46e5;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.4);
}

/* Product list items */
.ph-product-list,
.ph-v2-product-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ph-product-list::-webkit-scrollbar,
.ph-v2-product-list::-webkit-scrollbar {
    width: 4px;
}

.ph-product-list::-webkit-scrollbar-thumb,
.ph-v2-product-list::-webkit-scrollbar-thumb {
    background: #1e293b;
    border-radius: 4px;
}

.ph-product-item,
.ph-v2-product-item {
    padding: 9px 12px;
    border-radius: 9px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.18s;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ph-product-item:hover,
.ph-v2-product-item:hover {
    background: rgba(30, 41, 59, 0.7);
    border-color: rgba(99, 102, 241, 0.35);
    transform: translateY(-1px);
}

.ph-product-item.active,
.ph-v2-product-item.active {
    background: rgba(79, 70, 229, 0.16);
    border-color: #6366f1;
    box-shadow: 0 0 0 1px #6366f1 inset, 0 4px 14px rgba(79, 70, 229, 0.25);
}

.ph-product-item.active::before,
.ph-v2-product-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 15%;
    bottom: 15%;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: linear-gradient(180deg, #6366f1, #a855f7);
}

.ph-item-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 6px;
}

.ph-item-name,
.ph-v2-product-item-name {
    font-size: 12px;
    font-weight: 700;
    color: #f1f5f9;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.ph-product-item.active .ph-item-name,
.ph-v2-product-item.active .ph-v2-product-item-name {
    color: #c7d2fe;
}

.ph-item-stock-badge {
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

.ph-item-stock-badge.in-stock {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.ph-item-stock-badge.low-stock {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.ph-item-stock-badge.zero-stock {
    background: rgba(148, 163, 184, 0.1);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.ph-item-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10.5px;
    color: #64748b;
    margin-top: 1px;
}

.ph-item-sku {
    font-family: monospace;
    font-size: 10.5px;
    color: #818cf8;
}

.ph-item-price {
    font-weight: 700;
    color: #38bdf8;
    font-size: 11px;
}

.ph-item-sn-preview {
    font-family: monospace;
    font-size: 9.5px;
    color: #94a3b8;
    background: rgba(0, 0, 0, 0.25);
    padding: 2px 5px;
    border-radius: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --- Right Canvas: Enterprise Command Center --- */
.ph-canvas,
.ph-v2-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #060a16;
    overflow: hidden;
    position: relative;
}

/* Level 1: Canvas Header */
.ph-canvas-header,
.ph-v2-right-header {
    padding: 10px 18px;
    background: #080d1c;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    z-index: 5;
}

.ph-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.ph-product-avatar {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
    flex-shrink: 0;
}

.ph-title-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.ph-header-title,
.ph-v2-selected-name {
    font-size: 15px;
    font-weight: 800;
    color: #ffffff;
    margin: 0;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ph-header-badges {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.ph-sku-badge,
.ph-v2-selected-sku {
    font-family: monospace;
    font-size: 11px;
    font-weight: 700;
    color: #818cf8;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.25);
    padding: 1px 7px;
    border-radius: 5px;
}

.ph-cat-badge,
.ph-brand-badge {
    font-size: 10.5px;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1px 7px;
    border-radius: 5px;
}

.ph-stock-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 1px 8px;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.ph-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* Level 2: Compact Metrics Ribbon */
.ph-metrics-ribbon {
    padding: 8px 18px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    background: rgba(9, 14, 28, 0.7);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.ph-metric-card {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 9px;
    padding: 7px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    min-width: 0;
}

.ph-metric-card.action-tile {
    cursor: pointer;
    border-color: rgba(99, 102, 241, 0.25);
}

.ph-metric-card.action-tile:hover {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.12);
    transform: translateY(-1px);
}

.ph-metric-icon {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.ph-metric-icon.stock {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.ph-metric-icon.price {
    background: rgba(14, 165, 233, 0.15);
    color: #38bdf8;
}

.ph-metric-icon.arrival {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

.ph-metric-icon.sale {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

.ph-metric-icon.sn {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
}

.ph-metric-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.ph-metric-label {
    font-size: 9.5px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.ph-metric-val {
    font-size: 13.5px;
    font-weight: 800;
    color: #f8fafc;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ph-metric-sub {
    font-size: 10px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

.text-emerald {
    color: #34d399 !important;
}

.text-amber {
    color: #fbbf24 !important;
}

.text-indigo {
    color: #a5b4fc !important;
}

/* SN Drawer */
.ph-sn-drawer {
    background: #0d152a;
    border-bottom: 1px solid rgba(99, 102, 241, 0.25);
    padding: 10px 18px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    max-height: 160px;
    overflow-y: auto;
    flex-shrink: 0;
    animation: fadeInDown 0.18s ease;
}

.ph-sn-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ph-sn-filter-input {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 11px;
    color: #f1f5f9;
    outline: none;
    width: 140px;
}

.ph-sn-chips-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    max-height: 100px;
    overflow-y: auto;
}

.ph-sn-chip {
    font-family: monospace;
    font-size: 10.5px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 5px;
    background: rgba(99, 102, 241, 0.12);
    color: #c7d2fe;
    border: 1px solid rgba(99, 102, 241, 0.25);
    cursor: pointer;
    transition: all 0.15s;
    user-select: all;
}

.ph-sn-chip:hover {
    background: #4f46e5;
    color: #ffffff;
    border-color: #4f46e5;
}

.ph-sn-chip.highlight {
    background: #4f46e5;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.6);
}

/* Level 3: Toolbar & Quick Filter Bar */
.ph-toolbar {
    padding: 7px 18px;
    background: #080d1a;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.ph-date-presets,
.ph-action-presets {
    display: flex;
    gap: 3px;
    align-items: center;
}

.ph-date-pill,
.ph-action-pill {
    padding: 4px 9px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.03);
    color: #94a3b8;
    border: 1px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.ph-date-pill:hover,
.ph-action-pill:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #f1f5f9;
}

.ph-date-pill.active,
.ph-action-pill.active {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    border-color: rgba(99, 102, 241, 0.4);
    font-weight: 700;
}

.ph-filter-divider {
    width: 1px;
    height: 18px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 4px;
}

.ph-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ph-table-search-wrap {
    position: relative;
    width: 170px;
}

.ph-table-search-input {
    width: 100%;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 4px 8px 4px 24px;
    font-size: 11px;
    color: #e2e8f0;
    outline: none;
    font-family: inherit;
}

.ph-table-search-input:focus {
    border-color: #6366f1;
}

.ph-view-toggle {
    display: inline-flex;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 7px;
    padding: 2px;
    gap: 2px;
}

.ph-view-toggle button {
    padding: 4px 10px;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 11px;
    font-weight: 600;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.ph-view-toggle button.active {
    background: rgba(99, 102, 241, 0.25);
    color: #a5b4fc;
    font-weight: 700;
}

.ph-records-tag {
    font-size: 11px;
    color: #64748b;
    white-space: nowrap;
}

/* Level 4: Content Container */
.ph-timeline-container,
.ph-v2-timeline-wrap {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

.ph-table-view-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 10px 18px 18px 18px;
}

.ph-table-view-scroll::-webkit-scrollbar,
.ph-timeline-view-scroll::-webkit-scrollbar {
    width: 5px;
}

.ph-table-view-scroll::-webkit-scrollbar-thumb,
.ph-timeline-view-scroll::-webkit-scrollbar-thumb {
    background: #1e293b;
    border-radius: 4px;
}

.ph-history-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 3px;
    font-size: 11.5px;
}

.ph-history-table thead th {
    position: sticky;
    top: 0;
    background: #090e1d;
    color: #64748b;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 7px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    z-index: 2;
    text-align: left;
}

.ph-history-table thead th.center {
    text-align: center;
}

.ph-history-table thead th.right {
    text-align: right;
}

.ph-history-table tbody tr {
    background: rgba(13, 21, 38, 0.6);
    transition: all 0.12s;
    cursor: pointer;
}

.ph-history-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.1);
    transform: translateY(-1px);
}

.ph-history-table tbody tr.row-arrival {
    border-left: 3px solid #10b981;
}

.ph-history-table tbody tr.row-sale {
    border-left: 3px solid #f59e0b;
}

.ph-history-table tbody tr.row-transfer {
    border-left: 3px solid #8b5cf6;
}

.ph-history-table tbody tr.row-return {
    border-left: 3px solid #fb923c;
}

.ph-history-table tbody tr.row-create {
    border-left: 3px solid #3b82f6;
}

.ph-history-table tbody tr.row-update {
    border-left: 3px solid #60a5fa;
}

.ph-history-table tbody tr.row-delete {
    border-left: 3px solid #ef4444;
}

.ph-history-table tbody td {
    padding: 7px 10px;
    color: #cbd5e1;
    vertical-align: middle;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

.ph-history-table tbody td.center {
    text-align: center;
}

.ph-history-table tbody td.right {
    text-align: right;
}

.ph-doc-link {
    color: #818cf8;
    text-decoration: none;
    cursor: pointer;
    font-family: monospace;
    font-weight: 700;
    transition: all 0.15s;
    padding: 2px 5px;
    background: rgba(99, 102, 241, 0.08);
    border-radius: 4px;
}

.ph-doc-link:hover {
    color: #ffffff;
    background: #4f46e5;
}

.ph-qty-plus {
    color: #34d399;
    font-weight: 700;
}

.ph-qty-minus {
    color: #f87171;
    font-weight: 700;
}

.ph-qty-neutral {
    color: #a78bfa;
    font-weight: 700;
}

/* Timeline View */
.ph-timeline-view-scroll,
.ph-v2-timeline {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    position: relative;
}

.ph-timeline-track,
.ph-v2-timeline-line {
    position: absolute;
    left: 45px;
    top: 20px;
    bottom: 20px;
    width: 2px;
    background: linear-gradient(180deg, #4f46e5, rgba(99, 102, 241, 0.1));
}

.ph-v2-timeline-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 14px;
    position: relative;
}

.ph-v2-timeline-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    background: #0d152a;
    border: 2px solid #6366f1;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
    flex-shrink: 0;
    z-index: 2;
}

.ph-v2-timeline-card {
    flex: 1;
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 10px 14px;
    transition: all 0.2s;
}

.ph-v2-timeline-card:hover {
    background: rgba(30, 41, 59, 0.7);
    border-color: rgba(99, 102, 241, 0.3);
}

/* Level 5: Rich Empty State */
.ph-empty-hero,
.ph-v2-placeholder {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.ph-hero-card {
    max-width: 500px;
    text-align: center;
    background: rgba(13, 21, 38, 0.7);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 20px;
    padding: 36px 30px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(79, 70, 229, 0.1);
    backdrop-filter: blur(14px);
}

.ph-hero-icon-wrap {
    position: relative;
    width: 68px;
    height: 68px;
    margin: 0 auto 16px auto;
    border-radius: 20px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    box-shadow: 0 10px 30px rgba(79, 70, 229, 0.4);
}

.ph-hero-title {
    font-size: 18px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 8px;
}

.ph-hero-subtitle {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.5;
    margin-bottom: 20px;
}

.ph-hero-quick-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 24px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.ph-quick-stat-box {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 9px;
    padding: 8px;
    text-align: center;
}

.ph-quick-stat-num {
    font-size: 16px;
    font-weight: 800;
    color: #f8fafc;
}

.ph-quick-stat-lbl {
    font-size: 10px;
    color: #64748b;
    text-transform: uppercase;
    margin-top: 2px;
}

/* Pagination Bar */
.ph-pagination-bar,
.ph-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px 18px;
    background: #080d1a;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.ph-pagination-bar button,
.ph-pagination button {
    font-size: 0.72rem;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.ph-pagination button:hover:not(:disabled) {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    border-color: rgba(99, 102, 241, 0.3);
}

.ph-pagination button.active {
    background: rgba(99, 102, 241, 0.25);
    color: #c7d2fe;
    border-color: rgba(99, 102, 241, 0.4);
    font-weight: 700;
}

.ph-pagination button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.ph-pagination .ph-page-info {
    font-size: 0.7rem;
    color: #6b7280;
    padding: 0 8px;
}

/* Toolbar row */
.ph-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 20px 10px;
    flex-shrink: 0;
}

.ph-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* === SALES HISTORY REDESIGN === */
.sh-v2-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 16px;
    gap: 14px;
    overflow: hidden;
}

.sh-v2-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.sh-v2-title-block {
    display: flex;
    flex-direction: column;
}

.sh-v2-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: white;
    letter-spacing: -0.02em;
}

.sh-v2-subtitle {
    font-size: 0.78rem;
    color: #6b7280;
    margin-top: 2px;
}

.sh-v2-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sh-v2-refresh-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: all 0.2s;
    font-family: inherit;
}

.sh-v2-refresh-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    transform: rotate(180deg);
}

/* Filter Bar */
.sh-v2-filter-bar {
    display: grid;
    grid-template-columns: 1fr 1fr 1.5fr 1fr 1.2fr 1.2fr auto auto;
    gap: 10px;
    align-items: end;
    background: rgba(10, 15, 30, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 14px 16px;
    flex-shrink: 0;
    backdrop-filter: blur(8px);
}

.sh-v2-filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sh-v2-filter-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: #4b5563;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.sh-v2-filter-inp {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: #e2e8f0;
    padding: 8px 11px;
    font-size: 0.8rem;
    outline: none;
    transition: all 0.2s;
    font-family: inherit;
    width: 100%;
}

.sh-v2-filter-inp:focus {
    border-color: rgba(99, 102, 241, 0.5);
    background: rgba(99, 102, 241, 0.05);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.sh-v2-filter-inp::placeholder {
    color: #374151;
}

.sh-v2-apply-btn {
    padding: 8px 18px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    font-family: inherit;
    height: 38px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.sh-v2-apply-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

/* Sales Table */
.sh-v2-table-wrap {
    flex: 1;
    overflow: auto;
    background: rgba(10, 15, 30, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    backdrop-filter: blur(8px);
    min-height: 0;
}

.sh-v2-table {
    width: 100%;
    border-collapse: collapse;
}

.sh-v2-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(7, 11, 20, 0.95);
    backdrop-filter: blur(8px);
}

.sh-v2-table th {
    padding: 11px 14px;
    font-size: 0.67rem;
    font-weight: 700;
    color: #4b5563;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    text-align: left;
    white-space: nowrap;
}

.sh-v2-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: all 0.15s;
    cursor: pointer;
}

.sh-v2-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.06);
}

.sh-v2-table tbody tr.sh-v2-row-expanded {
    background: rgba(99, 102, 241, 0.04);
}

.sh-v2-table td {
    padding: 10px 14px;
    font-size: 0.8rem;
    color: #d1d5db;
    vertical-align: middle;
}

.sh-v2-date-col {
    font-size: 0.75rem;
    color: #6b7280;
    white-space: nowrap;
}

.sh-v2-receipt-col {
    font-family: monospace;
    font-size: 0.75rem;
    color: #a5b4fc;
}

.sh-v2-amount-col {
    font-weight: 700;
    color: #34d399;
}

.sh-payment-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 0.68rem;
    font-weight: 700;
}

.sh-pay-cash {
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.sh-pay-transfer {
    background: rgba(99, 102, 241, 0.12);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.25);
}

.sh-pay-credit {
    background: rgba(245, 158, 11, 0.12);
    color: #fcd34d;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.sh-pay-mixed {
    background: rgba(139, 92, 246, 0.12);
    color: #c4b5fd;
    border: 1px solid rgba(139, 92, 246, 0.25);
}

.sh-tier-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 600;
}

.sh-tier-retail {
    background: rgba(16, 185, 129, 0.1);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.sh-tier-dealer {
    background: rgba(245, 158, 11, 0.1);
    color: #fcd34d;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

/* Expanded Row */
.sh-v2-expand-row td {
    padding: 0;
    background: rgba(7, 11, 20, 0.6);
}

.sh-v2-expand-content {
    padding: 12px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-top: 1px solid rgba(99, 102, 241, 0.15);
    animation: expandIn 0.2s ease;
}

@keyframes expandIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sh-v2-expand-items {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.sh-v2-expand-item-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(17, 24, 39, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 5px 10px;
    font-size: 0.73rem;
    color: #c7d2fe;
}

.sh-v2-expand-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.sh-v2-expand-meta-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sh-v2-expand-meta-label {
    font-size: 0.62rem;
    color: #4b5563;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sh-v2-expand-meta-value {
    font-size: 0.78rem;
    color: #9ca3af;
}

.sh-v2-expand-actions {
    display: flex;
    gap: 6px;
}

/* Multi-user live indicator */
.sh-v2-live-dot {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.68rem;
    color: #10b981;
}

.sh-v2-live-dot::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    animation: livePulse 2s infinite;
}

@keyframes livePulse {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }

    50% {
        opacity: 0.7;
        box-shadow: 0 0 0 4px rgba(16, 185, 129, 0);
    }
}

.sh-v2-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 12px;
    color: #374151;
    text-align: center;
}

.sh-v2-empty-icon {
    font-size: 3rem;
    opacity: 0.3;
}

.sh-v2-empty-text {
    font-size: 0.85rem;
}

/* === AUDIT REDESIGN === */
.audit-v2-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 16px;
    gap: 14px;
    overflow: hidden;
}

.audit-v2-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    gap: 12px;
    flex-wrap: wrap;
}

.audit-v2-subtabs {
    display: flex;
    background: rgba(10, 15, 30, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 5px;
    gap: 4px;
}

.audit-v2-subtab {
    padding: 7px 14px;
    border-radius: 7px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    background: transparent;
    color: #6b7280;
    transition: all 0.2s;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 6px;
}

.audit-v2-subtab:hover {
    color: #c7d2fe;
    background: rgba(99, 102, 241, 0.1);
}

.audit-v2-subtab.active {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.25), rgba(124, 58, 237, 0.25));
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.35);
}

.audit-v2-top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Summary Cards */
.audit-v2-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    flex-shrink: 0;
}

.audit-v2-summary-card {
    background: rgba(10, 15, 30, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.2s;
}

.audit-v2-summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.audit-v2-summary-icon {
    width: 44px;
    height: 44px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.audit-v2-summary-text {
    display: flex;
    flex-direction: column;
}

.audit-v2-summary-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: #4b5563;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.audit-v2-summary-val {
    font-size: 1.7rem;
    font-weight: 800;
    color: white;
    line-height: 1.1;
}

/* Audit Filters */
.audit-v2-filter-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    background: rgba(10, 15, 30, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 14px 16px;
    flex-shrink: 0;
}

.audit-v2-filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.audit-v2-filter-label {
    font-size: 0.63rem;
    font-weight: 700;
    color: #4b5563;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.audit-v2-filter-inp {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: #e2e8f0;
    padding: 7px 10px;
    font-size: 0.78rem;
    outline: none;
    transition: all 0.2s;
    font-family: inherit;
    width: 100%;
}

.audit-v2-filter-inp:focus {
    border-color: rgba(99, 102, 241, 0.5);
    background: rgba(99, 102, 241, 0.04);
}

.audit-v2-filter-actions {
    display: flex;
    flex-direction: column;
    gap: 5px;
    justify-content: flex-end;
}

/* Audit Table */
.audit-v2-table-wrap {
    flex: 1;
    overflow: auto;
    background: rgba(10, 15, 30, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    min-height: 0;
}

.audit-v2-table {
    width: 100%;
    border-collapse: collapse;
}

.audit-v2-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(7, 11, 20, 0.97);
    backdrop-filter: blur(8px);
}

.audit-v2-table th {
    padding: 11px 14px;
    font-size: 0.67rem;
    font-weight: 700;
    color: #4b5563;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    text-align: left;
    white-space: nowrap;
}

.audit-v2-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: all 0.15s;
    cursor: pointer;
}

.audit-v2-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.05);
}

.audit-v2-table td {
    padding: 9px 14px;
    font-size: 0.79rem;
    color: #d1d5db;
    vertical-align: middle;
}

/* Action Type Badges */
.audit-action-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.68rem;
    font-weight: 700;
    white-space: nowrap;
}

.audit-act-create {
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.audit-act-update {
    background: rgba(99, 102, 241, 0.12);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.25);
}

.audit-act-delete {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.audit-act-login {
    background: rgba(16, 185, 129, 0.08);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.18);
}

.audit-act-logout {
    background: rgba(107, 114, 128, 0.12);
    color: #9ca3af;
    border: 1px solid rgba(107, 114, 128, 0.2);
}

.audit-act-sale {
    background: rgba(139, 92, 246, 0.12);
    color: #c4b5fd;
    border: 1px solid rgba(139, 92, 246, 0.25);
}

.audit-act-transfer {
    background: rgba(245, 158, 11, 0.12);
    color: #fcd34d;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.audit-act-default {
    background: rgba(107, 114, 128, 0.1);
    color: #9ca3af;
    border: 1px solid rgba(107, 114, 128, 0.18);
}

/* User Badge in Audit */
.audit-user-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    color: #c7d2fe;
}

.audit-user-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.audit-detail-btn {
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    font-size: 0.68rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    white-space: nowrap;
}

.audit-detail-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
}

/* === AUDIT DETAILS MODAL === */
.audit-details-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 9000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.audit-details-modal-overlay.open {
    display: flex;
}

.audit-details-modal {
    background: linear-gradient(180deg, #111827, #0d1526);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 16px;
    width: min(900px, 100%);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.7);
    animation: modalIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.audit-details-header {
    padding: 18px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

.audit-details-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.audit-details-modal-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.audit-details-title {
    font-size: 1rem;
    font-weight: 700;
    color: white;
}

.audit-details-subtitle {
    font-size: 0.72rem;
    color: #6b7280;
    margin-top: 2px;
}

.audit-details-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #9ca3af;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.15s;
    font-family: inherit;
}

.audit-details-close:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.audit-details-meta-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 14px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.audit-details-meta-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.audit-details-meta-label {
    font-size: 0.62rem;
    color: #4b5563;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.audit-details-meta-value {
    font-size: 0.8rem;
    color: #d1d5db;
    font-weight: 500;
}

.audit-details-body {
    flex: 1;
    overflow-y: auto;
    padding: 18px 22px;
}

.audit-details-body::-webkit-scrollbar {
    width: 4px;
}

.audit-details-body::-webkit-scrollbar-thumb {
    background: #1f2937;
    border-radius: 4px;
}

/* Key-Value view (Redesigned) */
.audit-kv-grid-redesign {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.audit-kv-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.audit-kv-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.audit-kv-val {
    font-size: 0.82rem;
    font-weight: 500;
    color: #e2e8f0;
    word-break: break-word;
}

/* Visual Diff Table */
.audit-diff-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

.audit-diff-title {
    font-size: 0.8rem;
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.audit-diff-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(10, 15, 30, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
}

.audit-diff-table th {
    background: rgba(0, 0, 0, 0.25);
    padding: 10px 14px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.audit-diff-table td {
    padding: 12px 14px;
    font-size: 0.82rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    vertical-align: middle;
}

.audit-diff-table tr:last-child td {
    border-bottom: none;
}

.audit-diff-field {
    font-weight: 600;
    color: #cbd5e1;
    width: 30%;
}

.audit-diff-val-old {
    display: inline-block;
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 3px 8px;
    border-radius: 6px;
    text-decoration: line-through;
    font-family: monospace;
    font-size: 0.8rem;
    word-break: break-word;
}

.audit-diff-arrow {
    display: inline-block;
    color: #64748b;
    margin: 0 8px;
    font-weight: bold;
}

.audit-diff-val-new {
    display: inline-block;
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 3px 8px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 0.8rem;
    word-break: break-word;
}

/* Accordion for JSON */
.audit-details-accordion {
    margin-top: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    overflow: hidden;
}

.audit-details-accordion summary {
    padding: 10px 14px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #818cf8;
    background: rgba(99, 102, 241, 0.05);
    cursor: pointer;
    user-select: none;
    outline: none;
    transition: background 0.15s;
}

.audit-details-accordion summary:hover {
    background: rgba(99, 102, 241, 0.1);
}

.audit-details-accordion-content {
    background: #090d16;
    padding: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* JSON viewer */
.audit-json-viewer {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 16px;
    font-family: 'Courier New', monospace;
    font-size: 0.78rem;
    line-height: 1.7;
    overflow-x: auto;
    white-space: pre;
}

.audit-json-key {
    color: #93c5fd;
}

.audit-json-string {
    color: #86efac;
}

.audit-json-number {
    color: #fcd34d;
}

.audit-json-boolean {
    color: #f0abfc;
}

.audit-json-null {
    color: #6b7280;
}

/* Responsive scrolling helper for audit tab */
@media (max-height: 768px) {
    #tab-audit {
        overflow-y: auto !important;
    }

    .audit-v2-container {
        height: auto !important;
        overflow: visible !important;
    }

    .audit-v2-table-wrap {
        flex: none !important;
        overflow: visible !important;
        min-height: 300px;
    }
}

.audit-details-footer {
    padding: 14px 22px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.audit-details-copy-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.25);
    color: #a5b4fc;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.audit-details-copy-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    transform: translateY(-1px);
}

.audit-details-copy-btn.copied {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
    color: #34d399;
}

/* ==================== MODERN ONLINE USERS SYSTEM ==================== */
.online-users-trigger-badge,
.audit-v2-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #34d399;
    cursor: pointer;
    user-select: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.1);
}

.online-users-trigger-badge:hover,
.audit-v2-live-badge:hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.5);
    box-shadow: 0 0 14px rgba(16, 185, 129, 0.25);
    transform: translateY(-1px);
}

.online-pulse-dot,
.audit-v2-live-dot {
    position: relative;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    display: inline-block;
}

.online-pulse-dot::after,
.audit-v2-live-dot::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 50%;
    border: 2px solid #10b981;
    animation: liveDotPulse 1.8s infinite;
}

@keyframes liveDotPulse {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }

    70% {
        transform: scale(2.2);
        opacity: 0;
    }

    100% {
        transform: scale(2.2);
        opacity: 0;
    }
}

/* Online Users Floating Dropdown Popover */
.online-users-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 320px;
    max-width: 90vw;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.6), 0 0 20px rgba(99, 102, 241, 0.1);
    z-index: 10000;
    overflow: hidden;
    animation: dropdownFadeIn 0.2s ease-out;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.online-users-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.95));
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.online-users-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #f8fafc;
}

.online-users-header-badge {
    font-size: 0.72rem;
    font-weight: 700;
    color: #10b981;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 2px 8px;
    border-radius: 12px;
}

.online-users-list {
    max-height: 380px;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.online-users-list::-webkit-scrollbar {
    width: 5px;
}

.online-users-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.online-user-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    transition: all 0.2s ease;
}

.online-user-item:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateX(2px);
}

.online-user-item.is-self {
    border-color: rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.05);
}

.online-user-avatar {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.online-user-avatar .avatar-dot {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid #0f172a;
}

.online-user-info {
    flex: 1;
    min-width: 0;
}

.online-user-name {
    font-size: 0.84rem;
    font-weight: 600;
    color: #f1f5f9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.online-user-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 3px;
    font-size: 0.72rem;
    color: #94a3b8;
    flex-wrap: wrap;
}

/* Loading skeleton */
.skeleton-row {
    display: flex;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    animation: skeletonPulse 1.5s ease-in-out infinite;
}

.skeleton-cell {
    height: 14px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.04);
}

@keyframes skeletonPulse {

    0%,
    100% {
        opacity: 0.4;
    }

    50% {
        opacity: 0.8;
    }
}

/* Toast for copy action */
.audit-copy-toast {
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 16px;
    background: rgba(16, 185, 129, 0.95);
    border: 1px solid rgba(16, 185, 129, 0.5);
    border-radius: 8px;
    color: white;
    font-size: 0.81rem;
    font-weight: 600;
    z-index: 999999;
    animation: copyToastIn 0.25s ease;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

@keyframes copyToastIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modern Light Theme */
body.light-theme {
    font-family: 'Inter', sans-serif;
    background: #f5f7fa;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 1rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.btn-primary,
.btn-secondary {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary {
    background: #0066ff;
    color: #fff;
}

.btn-primary:hover {
    background: #0052cc;
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background: #cfcfcf;
}

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

.styled-table th,
.styled-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #ddd;
    text-align: left;
}

.styled-table tbody tr:hover {
    background: #f1f7ff;
}

/* ERP Extension: Product History Subsystem Component Styles */
.history-log-card {
    background: #ffffff;
    border: 1px solid #e3e6ec;
    border-radius: 8px;
    padding: 20px;
    margin-top: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.history-controls-panel {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    align-items: flex-end;
}

.history-control-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #4e5664;
}

.history-control-group input,
.history-control-group select {
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    outline: none;
    font-size: 14px;
}

.history-data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.history-data-table th,
.history-data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
    font-size: 14px;
}

.history-data-table th {
    background: #f8fafc;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.history-data-table tbody tr:hover {
    background: #f1f5f9;
}

/* Status Badges */
.badge-mvmt {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
}

.badge-mvmt.arrival {
    background-color: #d1e7dd;
    color: #0f5132;
}

.badge-mvmt.transfer {
    background-color: #cff4fc;
    color: #055160;
}

.badge-mvmt.sale {
    background-color: #f8d7da;
    color: #842029;
}

.badge-mvmt.return {
    background-color: #fff3cd;
    color: #664d03;
}

.badge-mvmt.price-change {
    background-color: #f3f0ff;
    color: #651fff;
}

/* Զամբյուղի քանակի input դաշտի ադապտիվ ոճավորում */
.cart-item-qty-input {
    background: var(--bg-input, rgba(0, 0, 0, 0.2));
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    color: var(--text-main, #ffffff);
    border-radius: 6px;
    padding: 2px 0;
}

/* Զամբյուղի տեղադրության կոճակների ադապտիվ ոճերը */
#cartLocationStore,
#cartLocationWarehouse {
    background: var(--bg-card, #1f2937);
    color: var(--text-muted, #9ca3af);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    transition: all 0.2s ease;
}

#cartLocationStore.active,
#cartLocationWarehouse.active {
    background: var(--accent-color, #4f46e5) !important;
    color: #ffffff !important;
    box-shadow: 0 0 10px rgba(79, 70, 229, 0.3);
}

/* Վճարման եղանակների բազային կոճակներ */
#payMethodCash,
#payMethodTransfer,
#payMethodCredit {
    background: var(--bg-card, #1f2937);
    color: var(--text-muted, #9ca3af);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    transition: all 0.2s ease;
    font-weight: 600;
}

/* Ակտիվ վիճակներ ըստ գույների (Թեմաներին հարմարվող) */
#payMethodCash.active-cash {
    background: #10b981 !important;
    /* Կանաչ */
    color: #ffffff !important;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
}

#payMethodTransfer.active-transfer {
    background: #3b82f6 !important;
    /* Կապույտ */
    color: #ffffff !important;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.3);
}

#payMethodCredit.active-credit {
    background: #d97706 !important;
    /* Մեղրագույն/Նարնջագույն (Ուղղված է Light Mode-ի կոնտրաստի համար) */
    color: #ffffff !important;
    box-shadow: 0 0 12px rgba(217, 119, 6, 0.3);
}

/* Կայանված վաճառքների վերին տեղեկատվական գծիկ */
#parkedSalesStrip {
    display: none;
    /* Լռելյայն թաքցված */
    align-items: center;
    justify-content: space-between;
    background: var(--bg-warning-light, rgba(217, 119, 6, 0.15));
    border: 1px solid var(--border-warning, #d97706);
    padding: 8px 16px;
    border-radius: 8px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

/* Երբ գծիկը դառնում է ակտիվ */
#parkedSalesStrip.visible {
    display: flex !important;
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Գլոբալ տագնապի կոճակի բազային ադապտիվ ոճերը */
#globalStockAlertBtn {
    display: none;
    /* Լռելյայն թաքցված է */
    align-items: center;
    gap: 6px;
    background: var(--bg-danger-light, rgba(239, 68, 68, 0.15));
    color: var(--text-danger, #ef4444);
    border: 1px solid var(--border-danger, #ef4444);
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

/* Երբ ակտիվանում է (պակասորդ կա) */
#globalStockAlertBtn.visible {
    display: inline-flex !important;
    animation: softPulse 2s infinite ease-in-out;
}

/* Premium Թարթող Էֆեկտ (Pulse) */
@keyframes softPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }

    70% {
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

#globalStockAlertBtn {
    background: rgba(239, 68, 68, 0.15);
    /* Մեղմ թափանցիկ կարմիր */
    color: #ef4444;
    /* Հստակ կարմիր տեքստ */
    border: 1px solid #ef4444;
}

/* === LIGHT THEME OVERRIDES FOR POS CART, DETAILS, AUDIT, REPORTS === */

/* 1. ԶԱՄԲՅՈՒՂ (POS Cart / Checkout) */
body.light-theme .cart-v2-container {
    background: #ffffff !important;
    border-left: 1px solid #cbd5e1 !important;
}

body.light-theme .cart-v2-header {
    background: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

body.light-theme .cart-v2-summary {
    background: #f8fafc !important;
    border-top: 1px solid #cbd5e1 !important;
}

body.light-theme .cart-v2-summary-row.label span:last-child {
    color: var(--text-main) !important;
}

body.light-theme .cart-v2-total-label {
    color: var(--text-main) !important;
}

body.light-theme .cart-v2-total-value {
    color: #16a34a !important;
    background: none !important;
    -webkit-text-fill-color: initial !important;
}

body.light-theme .cart-v2-checkout-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35) !important;
}

body.light-theme .cart-v2-checkout-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45) !important;
}

body.light-theme .cart-v2-configurator-btn {
    background: #eef2ff !important;
    border-color: #c7d2fe !important;
    color: #4f46e5 !important;
}

body.light-theme .cart-v2-empty-text {
    color: var(--text-muted) !important;
}

body.light-theme .cart-item-v2 {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
}

body.light-theme .cart-item-v2:hover {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
}

body.light-theme .cart-item-v2-name {
    color: var(--text-main) !important;
}

body.light-theme .cart-item-v2-qty-btn {
    background: rgba(79, 70, 229, 0.08) !important;
    border-color: rgba(79, 70, 229, 0.2) !important;
    color: var(--accent) !important;
}

body.light-theme .cart-item-v2-qty-btn:hover {
    background: rgba(79, 70, 229, 0.15) !important;
}

body.light-theme .cart-item-v2-qty-display {
    color: var(--text-main) !important;
}

body.light-theme .cart-item-qty-input {
    background: var(--bg-card) !important;
    color: var(--text-main) !important;
    border: 1px solid var(--border-main) !important;
}

body.light-theme .cart-item-v2-total-price {
    color: var(--accent) !important;
}

body.light-theme .cart-item-v2-sn {
    background: rgba(0, 0, 0, 0.04) !important;
    color: var(--text-muted) !important;
}

body.light-theme .cart-item-v2-discount {
    border-top: 1px solid var(--border-main) !important;
}

body.light-theme .cart-item-v2-discount input {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-main) !important;
    color: #b45309 !important;
}

body.light-theme #posCheckoutModal .modal {
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
}

body.light-theme #posCheckoutModal .modal>div:first-child {
    background: rgba(0, 0, 0, 0.04) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
}

body.light-theme #posCheckoutModal .modal>div:first-child span {
    color: var(--text-main) !important;
}

body.light-theme #posCheckoutModal .modal>div:nth-child(2) {
    background: rgba(0, 0, 0, 0.02) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
}

body.light-theme #posCheckoutModal .field-label {
    color: var(--accent) !important;
}

body.light-theme #checkoutCreatorName,
body.light-theme #checkoutDate {
    color: var(--text-main) !important;
}

body.light-theme #checkoutPriceTierSelect,
body.light-theme #checkoutPaymentMethodSelect {
    background: var(--bg-card) !important;
    color: var(--text-main) !important;
    border-color: var(--border-main) !important;
}

body.light-theme #cpDropdown {
    background: var(--bg-card) !important;
    border-color: var(--border-main) !important;
}

body.light-theme #posCheckoutModal .modal>div:nth-child(3) {
    background: rgba(0, 0, 0, 0.03) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
    color: var(--text-muted) !important;
}

body.light-theme #checkoutItemsList {
    background: var(--bg-card) !important;
}

body.light-theme #checkoutItemsList>div {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
}

body.light-theme #checkoutItemsList>div span[style*="color: white"],
body.light-theme #checkoutItemsList>div span[style*="color:white"] {
    color: var(--text-main) !important;
}

body.light-theme #checkoutItemsList>div span[style*="color: #60a5fa"] {
    background: rgba(79, 70, 229, 0.08) !important;
    color: var(--accent) !important;
}

body.light-theme #checkoutItemsList>div div[style*="color: #a5b4fc"] {
    color: var(--accent) !important;
}

body.light-theme #checkoutItemsList>div span[style*="color: #9ca3af"] {
    color: var(--text-muted) !important;
}

body.light-theme #checkoutItemsList textarea {
    background: var(--bg-card) !important;
    color: var(--text-main) !important;
    border-color: var(--border-main) !important;
}

body.light-theme #checkoutItemsList button[style*="background: #7f1d1d"] {
    background: #fee2e2 !important;
    border-color: #fca5a5 !important;
    color: #b91c1c !important;
}

/* POS Checkout Modal & Edit Transaction HDM Sidebar (Light Theme) */
body.light-theme #posCheckoutModal .pos-checkout-hdm-sidebar,
body.light-theme #editTransactionModal .pos-checkout-hdm-sidebar {
    background: #f8fafc !important;
    border-left: 1px solid #e2e8f0 !important;
}

body.light-theme #posCheckoutModal .pos-checkout-hdm-sidebar>div:first-child,
body.light-theme #editTransactionModal .pos-checkout-hdm-sidebar>div:first-child {
    color: #059669 !important;
}

body.light-theme #posCheckoutModal .pos-checkout-hdm-sidebar label,
body.light-theme #editTransactionModal .pos-checkout-hdm-sidebar label {
    color: #334155 !important;
}

body.light-theme #checkoutHdmAddress {
    color: #64748b !important;
}

body.light-theme #checkoutHdmLockBadge {
    color: #b45309 !important;
    background: #fef3c7 !important;
    border-color: #fde68a !important;
}

body.light-theme #checkoutHdmWarehouse,
body.light-theme #checkoutHdmDepartment,
body.light-theme #checkoutHdmEmark {
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
}

/* Payment box container */
body.light-theme #posCheckoutModal .pos-checkout-hdm-sidebar div[style*="background: rgba(17, 24, 39, 0.7)"],
body.light-theme #posCheckoutModal .pos-checkout-hdm-sidebar div[style*="background:rgba(17, 24, 39, 0.7)"],
body.light-theme #posCheckoutModal .pos-checkout-hdm-sidebar div[style*="background: rgba(17,24,39,0.7)"] {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

body.light-theme #posCheckoutModal .pos-checkout-hdm-sidebar div[style*="background: rgba(17, 24, 39, 0.7)"] label:first-child span:first-child,
body.light-theme #posCheckoutModal .pos-checkout-hdm-sidebar div[style*="background:rgba(17, 24, 39, 0.7)"] label:first-child span:first-child {
    color: #1e293b !important;
}

body.light-theme #posCheckoutModal .pos-checkout-hdm-sidebar div[style*="background: rgba(17, 24, 39, 0.7)"] label:first-child span:last-child,
body.light-theme #posCheckoutModal .pos-checkout-hdm-sidebar div[style*="background:rgba(17, 24, 39, 0.7)"] label:first-child span:last-child {
    color: #64748b !important;
}

/* Payment option containers */
body.light-theme #paymentCardContainer_cash,
body.light-theme #paymentCardContainer_card,
body.light-theme #paymentCardContainer_transfer,
body.light-theme #paymentCardContainer_mixed,
body.light-theme #editTxPayContainer_cash,
body.light-theme #editTxPayContainer_card,
body.light-theme #editTxPayContainer_transfer,
body.light-theme #editTxPayContainer_credit,
body.light-theme #editTxPayContainer_mixed {
    border-color: #e2e8f0;
}

/* Option titles */
body.light-theme #paymentCardContainer_cash span[style*="color: #e5e7eb"],
body.light-theme #paymentCardContainer_card span[style*="color: #e5e7eb"],
body.light-theme #paymentCardContainer_transfer span[style*="color: #e5e7eb"],
body.light-theme #paymentCardContainer_mixed span[style*="color: #e5e7eb"],
body.light-theme #editTxPayContainer_cash span[style*="color: #e5e7eb"],
body.light-theme #editTxPayContainer_card span[style*="color: #e5e7eb"],
body.light-theme #editTxPayContainer_transfer span[style*="color: #e5e7eb"],
body.light-theme #editTxPayContainer_credit span[style*="color: #e5e7eb"],
body.light-theme #editTxPayContainer_mixed span[style*="color: #e5e7eb"] {
    color: #0f172a !important;
}

body.light-theme #paymentCardContainer_card span[style*="color: #9ca3af"] {
    color: #475569 !important;
}

/* Active Payment Card Badges in Light Theme */
body.light-theme #paymentCardContainer_cash span[style*="color: #10b981"] {
    color: #047857 !important;
    background: #d1fae5 !important;
}

body.light-theme #paymentCardContainer_transfer span[style*="color: #38bdf8"] {
    color: #0369a1 !important;
    background: #e0f2fe !important;
}

body.light-theme #paymentCardContainer_mixed span[style*="color: #a78bfa"] {
    color: #6d28d9 !important;
    background: #ede9fe !important;
}

/* Split inputs container */
body.light-theme #checkoutHdmSplitBox,
body.light-theme #editTxSplitBox {
    border-top: 1px solid #e2e8f0 !important;
}

body.light-theme #checkoutHdmAmountCash {
    background: #ffffff !important;
    color: #059669 !important;
    border: 1px solid #a7f3d0 !important;
}

body.light-theme #checkoutHdmAmountCard {
    background: #ffffff !important;
    color: #2563eb !important;
    border: 1px solid #bfdbfe !important;
}

body.light-theme #checkoutHdmAmountTransfer {
    background: #ffffff !important;
    color: #0284c7 !important;
    border: 1px solid #bae6fd !important;
}

body.light-theme #checkoutHdmSplitStatus {
    background: #f1f5f9 !important;
    border: 1px solid #e2e8f0 !important;
    color: #334155 !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
}

body.light-theme #checkoutHdmSplitBox span[style*="color: #cbd5e1"] {
    color: #475569 !important;
}

/* Auto-print label & Preview receipt button */
body.light-theme #posCheckoutModal .pos-checkout-hdm-sidebar label[style*="background: rgba(59, 130, 246, 0.1)"],
body.light-theme #posCheckoutModal .pos-checkout-hdm-sidebar label[style*="background:rgba(59, 130, 246, 0.1)"] {
    background: #eff6ff !important;
    border: 1px solid #bfdbfe !important;
}

body.light-theme #checkoutHdmAutoPrint+span,
body.light-theme #posCheckoutModal .pos-checkout-hdm-sidebar span[style*="color: #93c5fd"] {
    color: #1d4ed8 !important;
}

body.light-theme #posCheckoutModal .pos-checkout-hdm-sidebar button[onclick="previewCheckoutHdmReceipt()"] {
    background: #ffffff !important;
    border: 1.5px solid #6366f1 !important;
    color: #4f46e5 !important;
    font-weight: 600 !important;
}

body.light-theme #posCheckoutModal .pos-checkout-hdm-sidebar button[onclick="previewCheckoutHdmReceipt()"]:hover {
    background: #eef2ff !important;
}

/* B2B Buyer Fields in Checkout Modal */
body.light-theme #buyerInfoFields input {
    background: #ffffff !important;
    color: #1e293b !important;
    border: 1px solid #cbd5e1 !important;
}

body.light-theme #buyerInfoFields label {
    color: #475569 !important;
}

/* POS Checkout Modal Styling */
.pos-checkout-modal {
    transition: all 0.3s ease;
}

.pos-checkout-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

.pos-checkout-left-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pos-checkout-footer {
    padding: 12px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    z-index: 10;
}

.pos-checkout-footer-secondary-btns {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.pos-checkout-footer-primary-wrapper {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.pos-checkout-footer-total {
    text-align: right;
    white-space: nowrap;
}

.pos-checkout-total-label {
    font-size: 0.75rem;
    color: #9ca3af;
    font-weight: 500;
}

.pos-checkout-total-val {
    font-size: 1.5rem;
    font-weight: 700;
    color: #10b981;
    line-height: 1;
    letter-spacing: -0.5px;
}

.pos-checkout-footer-main-btns {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.pos-checkout-btn-draft {
    border-color: #f59e0b !important;
    color: #f59e0b !important;
    padding: 8px 12px !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
}

.pos-checkout-btn-pdf {
    border-color: #3b82f6 !important;
    color: #3b82f6 !important;
    padding: 8px 12px !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
}

.pos-checkout-btn-a4 {
    border-color: #8b5cf6 !important;
    color: #a78bfa !important;
    padding: 8px 12px !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
}

.pos-checkout-btn-excel {
    border-color: #10b981 !important;
    color: #10b981 !important;
    padding: 8px 12px !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
}

.pos-checkout-btn-release {
    padding: 10px 14px !important;
    border-color: #6366f1 !important;
    color: #818cf8 !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
}

.pos-checkout-btn-pay {
    padding: 10px 20px !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4) !important;
    white-space: nowrap !important;
}

body.light-theme .pos-checkout-footer {
    background: #f1f5f9 !important;
    border-top: 1px solid #cbd5e1 !important;
}

body.light-theme .pos-checkout-total-label {
    color: #64748b !important;
}

/* 2. ՎԱՃԱՌՔԻ ՄԱՆՐԱՄԱՍՆԵՐ (Sales History Details Modal) */
body.light-theme #salesHistoryDetailContent>div:first-child {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
}

body.light-theme #salesHistoryDetailContent div[style*="border-bottom:1px solid #0f172a"],
body.light-theme #salesHistoryDetailContent div[style*="border-bottom: 1px solid #0f172a"] {
    border-bottom: 1px solid #e2e8f0 !important;
}

body.light-theme #salesHistoryDetailContent span[style*="background:#1e3a5f"],
body.light-theme #salesHistoryDetailContent span[style*="background: #1e3a5f"] {
    background: #eff6ff !important;
    color: #1d4ed8 !important;
    border-color: #bfdbfe !important;
}

body.light-theme #salesHistoryDetailContent div[style*="color:white"],
body.light-theme #salesHistoryDetailContent div[style*="color: white"] {
    color: var(--text-main) !important;
}

body.light-theme #salesHistoryDetailContent div[style*="color:#9ca3af"],
body.light-theme #salesHistoryDetailContent div[style*="color: #9ca3af"] {
    color: var(--text-main) !important;
}

body.light-theme #salesHistoryDetailContent td[style*="color:white"],
body.light-theme #salesHistoryDetailContent td[style*="color: white"] {
    color: var(--text-main) !important;
}

body.light-theme #salesHistoryDetailContent td div[style*="color:#a78bfa"],
body.light-theme #salesHistoryDetailContent td div[style*="color: #a78bfa"] {
    color: var(--accent) !important;
}

/* 3. ԱՊՐԱՆՔՆԵՐԻ ՊԱՏՄՈՒԹՅՈՒՆ (Product History Enterprise Suite) */
body.light-theme #tab-product-history,
body.light-theme .ph-main-shell,
body.light-theme .ph-v2-container {
    background: #f1f5f9 !important;
}

/* Sidebar (Left) */
body.light-theme .ph-sidebar,
body.light-theme .ph-v2-left {
    background: #ffffff !important;
    border-right: 1px solid #e2e8f0 !important;
}

body.light-theme .ph-sidebar-header,
body.light-theme .ph-v2-left-header {
    background: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

body.light-theme .ph-sidebar-title,
body.light-theme .ph-v2-left-title {
    color: #0f172a !important;
}

body.light-theme .ph-sidebar-icon {
    background: #e0e7ff !important;
    color: #4f46e5 !important;
}

body.light-theme .ph-count-badge {
    background: #e0e7ff !important;
    color: #4338ca !important;
    border: 1px solid #c7d2fe !important;
}

body.light-theme .ph-search-input,
body.light-theme .ph-v2-search-inp {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}

body.light-theme .ph-search-input::placeholder,
body.light-theme .ph-v2-search-inp::placeholder {
    color: #94a3b8 !important;
}

body.light-theme .ph-search-input:focus,
body.light-theme .ph-v2-search-inp:focus {
    border-color: #4f46e5 !important;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.15) !important;
}

body.light-theme .ph-search-icon {
    color: #94a3b8 !important;
}

body.light-theme .ph-search-clear {
    color: #64748b !important;
}

body.light-theme .ph-category-select {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}

body.light-theme .ph-stock-pills {
    background: #f1f5f9 !important;
    border: 1px solid #e2e8f0 !important;
}

body.light-theme .ph-pill-btn {
    color: #64748b !important;
}

body.light-theme .ph-pill-btn:hover {
    color: #0f172a !important;
}

body.light-theme .ph-pill-btn.active {
    background: #4f46e5 !important;
    color: #ffffff !important;
    box-shadow: 0 1px 3px rgba(79, 70, 229, 0.3) !important;
}

body.light-theme .ph-product-list::-webkit-scrollbar-thumb,
body.light-theme .ph-v2-product-list::-webkit-scrollbar-thumb {
    background: #cbd5e1 !important;
}

/* Product list items */
body.light-theme .ph-product-item,
body.light-theme .ph-v2-product-item {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02) !important;
}

body.light-theme .ph-product-item:hover,
body.light-theme .ph-v2-product-item:hover {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    transform: translateY(-1px);
}

body.light-theme .ph-product-item.active,
body.light-theme .ph-v2-product-item.active {
    background: #eef2ff !important;
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 1px #6366f1 inset, 0 2px 8px rgba(99, 102, 241, 0.15) !important;
}

body.light-theme .ph-item-name,
body.light-theme .ph-v2-product-item-name,
body.light-theme .ph-v2-product-name {
    color: #0f172a !important;
}

body.light-theme .ph-product-item.active .ph-item-name,
body.light-theme .ph-v2-product-item.active .ph-v2-product-item-name,
body.light-theme .ph-v2-product-item.active .ph-v2-product-name {
    color: #312e81 !important;
    font-weight: 800 !important;
}

body.light-theme .ph-stock-pill.in-stock,
body.light-theme .ph-item-stock-badge.in-stock {
    background: #dcfce7 !important;
    color: #15803d !important;
    border: 1px solid #86efac !important;
}

body.light-theme .ph-stock-pill.low-stock,
body.light-theme .ph-item-stock-badge.low-stock {
    background: #fef3c7 !important;
    color: #b45309 !important;
    border: 1px solid #fde68a !important;
}

body.light-theme .ph-stock-pill.zero-stock,
body.light-theme .ph-item-stock-badge.zero-stock {
    background: #f1f5f9 !important;
    color: #64748b !important;
    border: 1px solid #cbd5e1 !important;
}

body.light-theme .ph-item-sub,
body.light-theme .ph-item-bottom {
    color: #64748b !important;
}

body.light-theme .ph-item-sku,
body.light-theme .ph-v2-product-sku {
    color: #4f46e5 !important;
    font-weight: 600 !important;
}

body.light-theme .ph-item-price {
    color: #0284c7 !important;
    font-weight: 700 !important;
}

body.light-theme .ph-item-sn,
body.light-theme .ph-item-sn-preview {
    background: #f1f5f9 !important;
    color: #475569 !important;
    border: 1px solid #e2e8f0 !important;
}

/* Canvas (Right) */
body.light-theme .ph-canvas,
body.light-theme .ph-v2-right {
    background: #f8fafc !important;
}

body.light-theme .ph-canvas-header,
body.light-theme .ph-v2-right-header {
    background: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

body.light-theme .ph-header-title,
body.light-theme .ph-v2-selected-name {
    color: #0f172a !important;
}

body.light-theme .ph-sku-badge,
body.light-theme .ph-v2-selected-sku {
    background: #eef2ff !important;
    color: #4338ca !important;
    border: 1px solid #c7d2fe !important;
}

body.light-theme .ph-cat-badge,
body.light-theme .ph-brand-badge {
    background: #f1f5f9 !important;
    color: #475569 !important;
    border: 1px solid #e2e8f0 !important;
}

body.light-theme .ph-stock-badge {
    background: #dcfce7 !important;
    color: #15803d !important;
    border: 1px solid #86efac !important;
}

/* Metrics Ribbon (5 Stat cards) */
body.light-theme .ph-metrics-ribbon {
    background: #f1f5f9 !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

body.light-theme .ph-metric-card,
body.light-theme .ph-stat-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
}

body.light-theme .ph-metric-card.action-tile {
    border-color: #c7d2fe !important;
}

body.light-theme .ph-metric-card.action-tile:hover {
    background: #eef2ff !important;
    border-color: #6366f1 !important;
}

body.light-theme .ph-metric-label,
body.light-theme .ph-stat-card .ph-stat-label {
    color: #64748b !important;
}

body.light-theme .ph-metric-val,
body.light-theme .ph-stat-card .ph-stat-num {
    color: #0f172a !important;
}

body.light-theme .ph-metric-sub {
    color: #64748b !important;
}

body.light-theme .ph-metric-icon.stock {
    background: #eff6ff !important;
    color: #2563eb !important;
}

body.light-theme .ph-metric-icon.price {
    background: #f0fdf4 !important;
    color: #16a34a !important;
}

body.light-theme .ph-metric-icon.arrival {
    background: #ecfdf5 !important;
    color: #059669 !important;
}

body.light-theme .ph-metric-icon.sale {
    background: #fffbeb !important;
    color: #d97706 !important;
}

body.light-theme .ph-metric-icon.sn {
    background: #faf5ff !important;
    color: #7c3aed !important;
}

/* SN Drawer */
body.light-theme .ph-sn-drawer {
    background: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05) !important;
}

body.light-theme .ph-sn-drawer-header span[style*="color: #f1f5f9"],
body.light-theme .ph-sn-drawer-header span[style*="color:#f1f5f9"] {
    color: #0f172a !important;
}

body.light-theme .ph-sn-filter-input {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}

/* Toolbar & Filter Presets */
body.light-theme .ph-toolbar {
    background: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

body.light-theme .ph-date-pill,
body.light-theme .ph-action-pill {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    color: #475569 !important;
}

body.light-theme .ph-date-pill:hover,
body.light-theme .ph-action-pill:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
}

body.light-theme .ph-date-pill.active,
body.light-theme .ph-action-pill.active {
    background: #4f46e5 !important;
    border-color: #4f46e5 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.25) !important;
}

body.light-theme .ph-filter-divider {
    background: #e2e8f0 !important;
}

body.light-theme .ph-table-search-input {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}

body.light-theme .ph-table-search-input:focus {
    border-color: #4f46e5 !important;
    background: #ffffff !important;
}

body.light-theme .ph-view-toggle {
    background: #f1f5f9 !important;
    border: 1px solid #e2e8f0 !important;
}

body.light-theme .ph-view-toggle button {
    color: #64748b !important;
}

body.light-theme .ph-view-toggle button.active {
    background: #ffffff !important;
    color: #4f46e5 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
}

body.light-theme .ph-records-tag {
    color: #64748b !important;
}

/* Table View & Date Groups */
body.light-theme .ph-table-view-scroll::-webkit-scrollbar-thumb,
body.light-theme .ph-timeline-view-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e1 !important;
}

body.light-theme .ph-date-group-header {
    background: #f1f5f9 !important;
    border: 1px solid #e2e8f0 !important;
}

body.light-theme .ph-date-label {
    color: #0f172a !important;
}

body.light-theme .ph-date-count {
    background: #e2e8f0 !important;
    color: #475569 !important;
}

body.light-theme .ph-history-table thead th {
    background: #f8fafc !important;
    color: #334155 !important;
    border-bottom: 2px solid #e2e8f0 !important;
}

body.light-theme .ph-history-table tbody tr {
    background: #ffffff !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02) !important;
}

body.light-theme .ph-history-table tbody tr:hover {
    background: #f8fafc !important;
}

body.light-theme .ph-history-table tbody td {
    color: #0f172a !important;
    border-bottom: 1px solid #f1f5f9 !important;
}

body.light-theme .ph-doc-link {
    background: #eff6ff !important;
    color: #2563eb !important;
    border: 1px solid #bfdbfe !important;
}

body.light-theme .ph-doc-link:hover {
    background: #2563eb !important;
    color: #ffffff !important;
}

body.light-theme .ph-sn-chip {
    background: #f8fafc !important;
    color: #4338ca !important;
    border: 1px solid #c7d2fe !important;
}

body.light-theme .ph-sn-chip:hover {
    background: #4f46e5 !important;
    color: #ffffff !important;
    border-color: #4f46e5 !important;
}

body.light-theme .ph-sn-chip.highlight {
    background: #4f46e5 !important;
    color: #ffffff !important;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.3) !important;
}

/* Timeline View */
body.light-theme .ph-timeline-track,
body.light-theme .ph-v2-timeline-line {
    background: linear-gradient(180deg, #6366f1, #cbd5e1) !important;
}

body.light-theme .ph-v2-timeline-dot {
    background: #ffffff !important;
    box-shadow: 0 0 0 3px #f1f5f9 !important;
}

body.light-theme .ph-v2-timeline-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
}

body.light-theme .ph-v2-timeline-card:hover {
    background: #f8fafc !important;
}

body.light-theme .ph-v2-timeline-date {
    color: #64748b !important;
}

body.light-theme .ph-v2-timeline-title {
    color: #0f172a !important;
}

body.light-theme .ph-v2-timeline-user strong {
    color: #475569 !important;
}

/* Empty Hero */
body.light-theme .ph-empty-hero,
body.light-theme .ph-v2-placeholder {
    background: transparent !important;
}

body.light-theme .ph-hero-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05) !important;
}

body.light-theme .ph-hero-title {
    color: #0f172a !important;
}

body.light-theme .ph-hero-sub,
body.light-theme .ph-v2-placeholder-text {
    color: #64748b !important;
}

body.light-theme .ph-hero-stat {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
}

body.light-theme .ph-hero-stat-num {
    color: #0f172a !important;
}

body.light-theme .ph-hero-stat-lbl {
    color: #64748b !important;
}

/* Detail Modal */
body.light-theme #productHistoryDetailModal .modal {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
}

body.light-theme #productHistoryDetailModal .modal>div:first-child {
    background: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

body.light-theme #productHistoryDetailModal #phModalProductName {
    color: #0f172a !important;
}

body.light-theme #productHistoryDetailModal #phModalProductStrip {
    border-top: 1px solid #e2e8f0 !important;
}

body.light-theme #productHistoryDetailModal #phModalContent {
    color: #1e293b !important;
}

body.light-theme #productHistoryDetailModal #phModalContent strong[style*="color:white"],
body.light-theme #productHistoryDetailModal #phModalContent strong[style*="color: white"] {
    color: #0f172a !important;
}

body.light-theme #productHistoryDetailModal .modal>div:last-child {
    background: #f8fafc !important;
    border-top: 1px solid #e2e8f0 !important;
}

/* Pagination */
body.light-theme .ph-pagination button {
    background: #ffffff !important;
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
}

body.light-theme .ph-pagination button:hover:not(:disabled) {
    background: #eef2ff !important;
    color: #4f46e5 !important;
}

/* 4. ՀԱՇՎԵՏՎՈՒԹՅՈՒՆ (Report / Accounting) */
body.light-theme #tab-report div[style*="background:linear-gradient(135deg, #0f172a, #0a0f1e)"],
body.light-theme #tab-report div[style*="background: linear-gradient(135deg, #0f172a, #0a0f1e)"] {
    background: var(--bg-card) !important;
    border-color: var(--border-main) !important;
}

body.light-theme .pricelist-export-card {
    background: var(--bg-card, #ffffff) !important;
    border-color: var(--border-main, #e2e8f0) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06) !important;
}

body.light-theme .pricelist-export-card div[style*="color: #ffffff"],
body.light-theme .pricelist-export-card div[style*="color: white"] {
    color: var(--text-main, #0f172a) !important;
}

body.light-theme #tab-report div[style*="background:linear-gradient(135deg,#111827,#0f172a)"],
body.light-theme #tab-report div[style*="background: linear-gradient(135deg,#111827,#0f172a)"],
body.light-theme #tab-report div[style*="background:linear-gradient(135deg, #111827, #0f172a)"],
body.light-theme #tab-report div[style*="background: linear-gradient(135deg, #111827, #0f172a)"] {
    background: var(--bg-card) !important;
    border-color: var(--border-main) !important;
}

body.light-theme #tab-report div[style*="background: #0f172a"],
body.light-theme #tab-report div[style*="background:#0f172a"] {
    background: var(--bg-card) !important;
    border-color: var(--border-main) !important;
}

body.light-theme #tab-report div[style*="background: #1e293b"],
body.light-theme #tab-report div[style*="background:#1e293b"] {
    background: var(--bg-surface) !important;
    border-color: var(--border-main) !important;
}

body.light-theme #tab-report div[style*="background:linear-gradient(135deg,#1f2937,#111827)"],
body.light-theme #tab-report div[style*="background: linear-gradient(135deg,#1f2937,#111827)"],
body.light-theme #tab-report div[style*="background:linear-gradient(135deg, #1f2937, #111827)"],
body.light-theme #tab-report div[style*="background: linear-gradient(135deg, #1f2937, #111827)"] {
    background: var(--bg-card) !important;
    border-color: var(--border-main) !important;
}

body.light-theme #tab-report div[style*="color:white"],
body.light-theme #tab-report div[style*="color: white"] {
    color: var(--text-main) !important;
}

body.light-theme #tab-report div[style*="color: #9ca3af"],
body.light-theme #tab-report div[style*="color:#9ca3af"] {
    color: var(--text-muted) !important;
}

body.light-theme #tab-report tr[style*="background:#111827"],
body.light-theme #tab-report tr[style*="background: #111827"] {
    background: #f1f5f9 !important;
}

body.light-theme #tab-report tr th[style*="color:#94a3b8"],
body.light-theme #tab-report tr th[style*="color: #94a3b8"] {
    color: #475569 !important;
}

body.light-theme #tab-report tr th[style*="color:#6366f1"],
body.light-theme #tab-report tr th[style*="color: #6366f1"],
body.light-theme #tab-report tr th[style*="color:#10b981"],
body.light-theme #tab-report tr th[style*="color: #10b981"],
body.light-theme #tab-report tr th[style*="color:#f59e0b"],
body.light-theme #tab-report tr th[style*="color: #f59e0b"],
body.light-theme #tab-report tr th[style*="color:#8b5cf6"],
body.light-theme #tab-report tr th[style*="color: #8b5cf6"] {
    color: var(--accent) !important;
}

body.light-theme #rIncome {
    color: #16a34a !important;
    text-shadow: none !important;
}

body.light-theme #rExpenses {
    color: #dc2626 !important;
    text-shadow: none !important;
}

body.light-theme #rNetProfit {
    background: none !important;
    color: #b45309 !important;
    -webkit-text-fill-color: initial !important;
}

body.light-theme #rTxCount {
    color: #4f46e5 !important;
    text-shadow: none !important;
}

body.light-theme #rCash {
    color: #16a34a !important;
}

body.light-theme #rTransfer {
    color: #4f46e5 !important;
}

body.light-theme #rCredit {
    color: #b45309 !important;
}

body.light-theme #flowTotalIncome {
    color: #16a34a !important;
}

body.light-theme #flowTotalOutcome {
    color: #dc2626 !important;
}

body.light-theme #flowNetBalance {
    background: none !important;
    color: #4f46e5 !important;
    -webkit-text-fill-color: initial !important;
}

body.light-theme #cashRegisterModal div[style*="background:#0f1720"],
body.light-theme #cashRegisterModal div[style*="background: #0f1720"] {
    background: var(--bg-surface) !important;
    border-color: var(--border-main) !important;
}

body.light-theme #dailyBreakdownModal .modal>div:first-child {
    background: rgba(0, 0, 0, 0.04) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
}

body.light-theme #dailyBreakdownModal .modal>div:first-child div[style*="color:white"],
body.light-theme #dailyBreakdownModal .modal>div:first-child div[style*="color: white"] {
    color: var(--text-main) !important;
}

body.light-theme #dailyBreakdownModal .modal>div:first-child div[style*="color:#9ca3af"],
body.light-theme #dailyBreakdownModal .modal>div:first-child div[style*="color: #9ca3af"] {
    color: var(--text-muted) !important;
}

body.light-theme #dailyBreakdownModal div[style*="background:#111827"],
body.light-theme #dailyBreakdownModal div[style*="background: #111827"] {
    background: var(--bg-surface) !important;
    border: 1px solid var(--border-main) !important;
    color: var(--text-main) !important;
}

body.light-theme #dailyBreakdownModal tr[style*="background:#111827"],
body.light-theme #dailyBreakdownModal tr[style*="background: #111827"] {
    background: #f1f5f9 !important;
}

body.light-theme #dailyBreakdownModal div[style*="color:white"],
body.light-theme #dailyBreakdownModal div[style*="color: white"] {
    color: var(--text-main) !important;
}

body.light-theme #modalUsdIncome,
body.light-theme #modalAmdIncome,
body.light-theme #modalTotalIncome {
    color: #16a34a !important;
}

body.light-theme #modalUsdOutcome,
body.light-theme #modalAmdOutcome {
    color: #dc2626 !important;
}

body.light-theme #modalNetBalance {
    color: #4f46e5 !important;
}

/* 5. ԱՈՒԴԻՏ ԵՎ ԼՈԳԵՐ (Audit / Logs) */
body.light-theme .audit-v2-subtabs {
    background: var(--bg-surface) !important;
    border-color: var(--border-main) !important;
}

body.light-theme .audit-v2-subtab {
    color: var(--text-muted) !important;
}

body.light-theme .audit-v2-subtab:hover {
    color: var(--accent) !important;
    background: rgba(79, 70, 229, 0.06) !important;
}

body.light-theme .audit-v2-subtab.active {
    background: rgba(79, 70, 229, 0.12) !important;
    color: var(--accent) !important;
    border-color: rgba(79, 70, 229, 0.2) !important;
}

body.light-theme .audit-v2-summary-card {
    background: var(--bg-card) !important;
    border-color: var(--border-main) !important;
}

body.light-theme .audit-v2-summary-val {
    color: var(--text-main) !important;
}

body.light-theme .audit-v2-filter-bar {
    background: var(--bg-card) !important;
    border-color: var(--border-main) !important;
}

body.light-theme .audit-v2-filter-inp {
    background: var(--bg-card) !important;
    border-color: var(--border-main) !important;
    color: var(--text-main) !important;
}

body.light-theme .audit-v2-table-wrap {
    background: var(--bg-card) !important;
    border-color: var(--border-main) !important;
}

body.light-theme .audit-v2-table thead {
    background: #f1f5f9 !important;
}

body.light-theme .audit-v2-table th {
    color: #475569 !important;
    border-color: var(--border-main) !important;
}

body.light-theme .audit-v2-table tbody tr {
    border-bottom-color: #f1f5f9 !important;
}

body.light-theme .audit-v2-table td {
    color: var(--text-main) !important;
}

/* Sidebar Collapse Styles */
.sidebar-aside {
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-brand-wrapper {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.sidebar-brand-text {
    transition: opacity 0.2s ease, max-width 0.3s ease;
    opacity: 1;
    max-width: 150px;
    overflow: hidden;
}

/* Sidebar Collapsed State */
.sidebar-aside.collapsed {
    width: 70px !important;
}

.sidebar-aside.collapsed .sidebar-brand-text {
    opacity: 0;
    max-width: 0;
    pointer-events: none;
}

.sidebar-aside.collapsed .sidebar-header {
    justify-content: center !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.sidebar-aside.collapsed .sidebar-brand-wrapper {
    display: none !important;
}

/* Nav Links Styling in Collapsed State */
.sidebar-aside.collapsed .nav-link {
    justify-content: center !important;
    padding: 10px 0 !important;
    gap: 0 !important;
}

.sidebar-aside.collapsed .nav-text {
    display: none !important;
}

.sidebar-aside.collapsed .nav-link svg {
    width: 18px !important;
    height: 18px !important;
}

/* Hide Section Titles in Collapsed State and show custom line divider */
.sidebar-aside.collapsed .nav-section-title {
    opacity: 0;
    height: 0;
    padding: 0 !important;
    margin: 8px 0 !important;
    border-top: 1px solid #1a2035;
    overflow: hidden;
}

/* Hide CSV Import Section in Collapsed State */
.sidebar-aside.collapsed .csv-import-section,
.sidebar-aside.collapsed .sidebar-footer-text {
    display: none !important;
}

.sidebar-aside.collapsed .sidebar-footer {
    padding-left: 0 !important;
    padding-right: 0 !important;
    align-items: center !important;
}

/* Sidebar Toggle Button styling */
.sidebar-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.sidebar-toggle-btn:hover {
    background: rgba(148, 163, 184, 0.1);
}

.sidebar-toggle-btn svg {
    transition: transform 0.3s ease;
}

body.light-theme .sidebar-toggle-btn svg {
    color: #475569 !important;
}

body.light-theme .sidebar-toggle-btn:hover {
    background: rgba(71, 85, 105, 0.08);
}

/* === LIGHT THEME OVERRIDES FOR CASHBOX MODAL === */
body.light-theme .cb-card {
    background: var(--bg-card) !important;
    border-color: var(--border-main) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15) !important;
}

body.light-theme .cb-header {
    background: var(--bg-surface) !important;
    color: var(--text-main) !important;
    border-bottom: 1px solid var(--border-main) !important;
}

body.light-theme .cb-header-title h2 {
    color: var(--text-main) !important;
}

body.light-theme .cb-close-btn {
    color: var(--text-muted) !important;
}

body.light-theme .cb-close-btn:hover {
    color: var(--text-main) !important;
}

body.light-theme .cb-field-label {
    color: var(--text-muted) !important;
}

body.light-theme .cb-transaction-toggle {
    background: var(--bg-surface) !important;
    border: 1px solid var(--border-main) !important;
}

body.light-theme .cb-toggle-button {
    color: var(--text-muted) !important;
}

body.light-theme .cb-select,
body.light-theme .cb-input-num,
body.light-theme .cb-textarea {
    color: var(--text-main) !important;
    background-color: var(--bg-card) !important;
    border-color: var(--border-main) !important;
}

body.light-theme .cb-select:focus,
body.light-theme .cb-input-num:focus,
body.light-theme .cb-textarea:focus {
    border-color: var(--accent) !important;
}

body.light-theme .cb-input-currency-group span {
    background: var(--bg-surface) !important;
    border-color: var(--border-main) !important;
    color: var(--text-main) !important;
}

body.light-theme .cb-btn-secondary {
    background-color: var(--bg-surface) !important;
    color: var(--text-muted) !important;
    border: 1px solid var(--border-main) !important;
}

body.light-theme .cb-btn-secondary:hover {
    background-color: var(--border-main) !important;
    color: var(--text-main) !important;
}

/* === LIGHT THEME OVERRIDES FOR AUDIT DETAILS MODAL === */
body.light-theme .audit-details-modal {
    background: var(--bg-card) !important;
    border-color: var(--border-main) !important;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.15) !important;
}

body.light-theme .audit-details-header {
    background: var(--bg-surface) !important;
    border-bottom: 1px solid var(--border-main) !important;
}

body.light-theme .audit-details-title {
    color: var(--text-main) !important;
}

body.light-theme .audit-details-subtitle {
    color: var(--text-muted) !important;
}

body.light-theme .audit-details-close {
    background: rgba(0, 0, 0, 0.03) !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
    color: var(--text-muted) !important;
}

body.light-theme .audit-details-close:hover {
    background: rgba(239, 68, 68, 0.1) !important;
    border-color: rgba(239, 68, 68, 0.2) !important;
    color: #ef4444 !important;
}

body.light-theme .audit-details-meta-bar {
    background: rgba(0, 0, 0, 0.02) !important;
    border-bottom: 1px solid var(--border-main) !important;
}

body.light-theme .audit-details-meta-label {
    color: var(--text-muted) !important;
}

body.light-theme .audit-details-meta-value {
    color: var(--text-main) !important;
}

body.light-theme .audit-details-meta-value[style*="color:#a5b4fc"],
body.light-theme .audit-details-meta-value[style*="color: #a5b4fc"] {
    color: var(--accent) !important;
}

body.light-theme .audit-kv-card {
    background: var(--bg-surface) !important;
    border-color: var(--border-main) !important;
}

body.light-theme .audit-kv-label {
    color: var(--text-muted) !important;
}

body.light-theme .audit-kv-val {
    color: var(--text-main) !important;
}

body.light-theme .audit-diff-title {
    color: var(--text-muted) !important;
}

body.light-theme .audit-diff-table {
    background: var(--bg-surface) !important;
    border-color: var(--border-main) !important;
}

body.light-theme .audit-diff-table th {
    background: rgba(0, 0, 0, 0.03) !important;
    color: var(--text-muted) !important;
    border-bottom: 1px solid var(--border-main) !important;
}

body.light-theme .audit-diff-table td {
    border-bottom: 1px solid var(--border-main) !important;
}

body.light-theme .audit-diff-field {
    color: var(--text-main) !important;
}

body.light-theme .audit-diff-val-old {
    background: rgba(239, 68, 68, 0.08) !important;
    color: #dc2626 !important;
    border-color: rgba(239, 68, 68, 0.15) !important;
}

body.light-theme .audit-diff-val-new {
    background: rgba(16, 185, 129, 0.08) !important;
    color: #16a34a !important;
    border-color: rgba(16, 185, 129, 0.15) !important;
}

body.light-theme .audit-diff-arrow {
    color: var(--text-muted) !important;
}

body.light-theme .audit-details-accordion {
    border-color: var(--border-main) !important;
}

body.light-theme .audit-details-accordion summary {
    color: var(--accent) !important;
    background: rgba(99, 102, 241, 0.05) !important;
}

body.light-theme .audit-details-accordion summary:hover {
    background: rgba(99, 102, 241, 0.1) !important;
}

body.light-theme .audit-details-accordion-content {
    background: var(--bg-surface) !important;
    border-top: 1px solid var(--border-main) !important;
}

body.light-theme .audit-json-viewer {
    background: var(--bg-card) !important;
    border-color: var(--border-main) !important;
}

body.light-theme .audit-json-key {
    color: #2563eb !important;
}

body.light-theme .audit-json-string {
    color: #16a34a !important;
}

body.light-theme .audit-json-number {
    color: #ea580c !important;
}

body.light-theme .audit-json-boolean {
    color: #7c3aed !important;
}

body.light-theme .audit-json-null {
    color: #64748b !important;
}

body.light-theme .audit-details-footer {
    border-top: 1px solid var(--border-main) !important;
    background: var(--bg-surface) !important;
}

body.light-theme .audit-details-copy-btn {
    background: rgba(99, 102, 241, 0.06) !important;
    border-color: rgba(99, 102, 241, 0.2) !important;
    color: var(--accent) !important;
}

body.light-theme .audit-details-copy-btn:hover {
    background: rgba(99, 102, 241, 0.12) !important;
}

/* === LIGHT THEME OVERRIDES FOR REPORT FLOW SUMMARIES === */
body.light-theme .report-flow-container {
    background: var(--bg-card) !important;
    border-color: var(--border-main) !important;
}

body.light-theme .report-flow-card {
    background: var(--bg-surface) !important;
    border-color: var(--border-main) !important;
}

body.light-theme .report-flow-card:hover {
    background: var(--bg-surface) !important;
    border-color: rgba(99, 102, 241, 0.3) !important;
}

/* SweetAlert2 container z-index override to always stay above modals */
.swal2-container {
    z-index: 999999 !important;
}

/* SweetAlert2 radio input styles overrides */
.swal2-popup .swal2-radio {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 24px !important;
    padding: 12px 16px !important;
    margin: 15px auto !important;
}

.swal2-popup .swal2-radio label {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    font-size: 1rem !important;
    color: #ffffff !important;
    cursor: pointer !important;
    margin: 0 !important;
    background: transparent !important;
}

.swal2-popup .swal2-radio input[type="radio"] {
    margin: 0 !important;
    width: 18px !important;
    height: 18px !important;
    cursor: pointer !important;
    accent-color: #10b981 !important;
}

/* === PRODUCT RESERVATION MODALS === */
.modal-v2-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.modal-v2-dialog {
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    width: 95%;
    max-height: 90vh;
    animation: modalFadeIn 0.25s ease-out;
    display: flex;
    flex-direction: column;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-v2-header {
    padding: 16px 20px;
    border-bottom: 1px solid #1e293b;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent;
}

.modal-v2-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #f8fafc;
}

.modal-v2-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
}

.modal-v2-close:hover {
    color: #f1f5f9;
}

.modal-v2-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.modal-v2-footer {
    padding: 14px 20px;
    border-top: 1px solid #1e293b;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: #0b0f19;
    border-radius: 0 0 12px 12px;
}

.modal-v2-filters {
    padding: 14px 20px;
    border-bottom: 1px solid #1e293b;
    display: flex;
    gap: 12px;
    align-items: center;
    background: #0b0f19;
}

.res-notes-block {
    margin-top: 6px;
    font-size: 0.75rem;
    line-height: 1.3;
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.08);
    border-left: 3px solid #f59e0b;
    padding: 6px 10px;
    border-radius: 4px;
    display: inline-flex;
    align-items: flex-start;
    gap: 6px;
    max-width: 100%;
    word-break: break-word;
    font-weight: 500;
}

/* Light Theme overrides for modal-v2 */
.light-theme .modal-v2-dialog {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.light-theme .modal-v2-header {
    background: transparent;
    border-bottom-color: #e2e8f0;
}

.light-theme .modal-v2-title {
    color: #0f172a;
}

.light-theme .modal-v2-close {
    color: #64748b;
}

.light-theme .modal-v2-close:hover {
    color: #0f172a;
}

.light-theme .modal-v2-footer {
    background: #f8fafc;
    border-top-color: #e2e8f0;
    border-radius: 0 0 12px 12px;
}

.light-theme .modal-v2-filters {
    background: #f8fafc;
    border-bottom-color: #e2e8f0;
}

body.light-theme .res-notes-block {
    color: #b45309;
    background: rgba(245, 158, 11, 0.06);
    border-left-color: #b45309;
}


/* Reserved Badge styles */
.reserved-badge {
    display: inline-block;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #f59e0b;
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 0.68rem;
    font-weight: 700;
    margin-left: 6px;
    vertical-align: middle;
    cursor: help;
}

.light-theme .reserved-badge {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.5);
    color: #d97706;
}

/* Reservations Dropdown */
.res-customer-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 6px;
    max-height: 180px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: 2px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

.res-dropdown-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #cbd5e1;
    transition: background 0.15s, color 0.15s;
    text-align: left;
}

.res-dropdown-item:hover {
    background: #3b82f6;
    color: #ffffff;
}

/* Light Theme overrides */
body.light-theme .res-customer-dropdown {
    background: #ffffff;
    border-color: #cbd5e1;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body.light-theme .res-dropdown-item {
    color: #334155;
}

body.light-theme .res-dropdown-item:hover {
    background: #3b82f6;
    color: #ffffff;
}

/* Card Reserved Badge style (with pulse animation) */
.pos-card-reserved-badge {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.5);
    color: #f59e0b;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.68rem;
    font-weight: 700;
    margin-left: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: help;
    animation: pulseReserved 2s infinite ease-in-out;
}

@keyframes pulseReserved {
    0% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4);
    }

    70% {
        box-shadow: 0 0 0 4px rgba(245, 158, 11, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
    }
}

body.light-theme .pos-card-reserved-badge {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.6);
    color: #d97706;
}

/* Action button styling */
.pos-item-reserve-btn {
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pos-item-reserve-btn:hover {
    color: #ffffff !important;
    background: #f59e0b !important;
    transform: scale(1.05);
}

body.light-theme .pos-item-reserve-btn:hover {
    color: #ffffff !important;
    background: #d97706 !important;
}

/* Online Users System (Light Theme) */
body.light-theme .online-users-trigger-badge,
body.light-theme .audit-v2-live-badge {
    background: #ecfdf5 !important;
    border: 1px solid #a7f3d0 !important;
    color: #059669 !important;
    box-shadow: 0 1px 3px rgba(16, 185, 129, 0.12) !important;
}

body.light-theme .online-users-trigger-badge:hover,
body.light-theme .audit-v2-live-badge:hover {
    background: #d1fae5 !important;
    border-color: #6ee7b7 !important;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2) !important;
}

body.light-theme .online-users-dropdown {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.12), 0 8px 12px -6px rgba(0, 0, 0, 0.08) !important;
}

body.light-theme .online-users-header {
    background: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

body.light-theme .online-users-header-title {
    color: #0f172a !important;
}

body.light-theme .online-users-header-badge {
    background: #dcfce7 !important;
    color: #15803d !important;
    border: 1px solid #86efac !important;
}

body.light-theme .online-users-header button {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #475569 !important;
}

body.light-theme .online-users-header button:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
}

body.light-theme .online-users-list::-webkit-scrollbar-thumb {
    background: #cbd5e1 !important;
}

body.light-theme .online-user-item {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02) !important;
}

body.light-theme .online-user-item:hover {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
}

body.light-theme .online-user-item.is-self {
    background: #f0fdf4 !important;
    border-color: #a7f3d0 !important;
}

body.light-theme .online-user-name {
    color: #0f172a !important;
    font-weight: 700 !important;
}

body.light-theme .online-user-avatar .avatar-dot {
    border-color: #ffffff !important;
}

/* Modal and Sub-container Custom Scrollbars */
#txDetailsContent::-webkit-scrollbar,
#txDetailsHdmPanel::-webkit-scrollbar,
.modal div::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

#txDetailsContent::-webkit-scrollbar-track,
#txDetailsHdmPanel::-webkit-scrollbar-track,
.modal div::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5);
    border-radius: 4px;
}

#txDetailsContent::-webkit-scrollbar-thumb,
#txDetailsHdmPanel::-webkit-scrollbar-thumb,
.modal div::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.4);
    border-radius: 4px;
}

#txDetailsContent::-webkit-scrollbar-thumb:hover,
#txDetailsHdmPanel::-webkit-scrollbar-thumb:hover,
.modal div::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.7);
}

/* ==========================================================================
   TRANSACTION DETAILS MODAL (#txDetailsModal) DARK & LIGHT THEME SYSTEM
   ========================================================================== */

#txDetailsModal .modal {
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #f8fafc;
    box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.7);
}

body.light-theme #txDetailsModal .modal {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    color: #0f172a !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15) !important;
}

#txDetailsModal .tx-modal-header {
    background: linear-gradient(135deg, #111827, #0d1526);
    border-bottom: 1px solid #1f2937;
    color: #ffffff;
}

body.light-theme #txDetailsModal .tx-modal-header {
    background: linear-gradient(135deg, #ffffff, #f8fafc) !important;
    border-bottom: 1px solid #e2e8f0 !important;
    color: #0f172a !important;
}

body.light-theme #txDetailsModal .tx-modal-header span,
body.light-theme #txDetailsModal .tx-modal-header h3 {
    color: #0f172a !important;
}

#txDetailsModal .tx-left-col {
    border-right: 1px solid #1f2937;
}

body.light-theme #txDetailsModal .tx-left-col {
    border-right: 1px solid #e2e8f0 !important;
}

#txDetailsModal .tx-actions-footer {
    background: rgba(10, 15, 30, 0.95);
    border-top: 1px solid #1f2937;
}

body.light-theme #txDetailsModal .tx-actions-footer {
    background: #f8fafc !important;
    border-top: 1px solid #e2e8f0 !important;
}

#txDetailsModal .tx-hdm-panel {
    background: rgba(11, 18, 32, 0.7);
}

body.light-theme #txDetailsModal .tx-hdm-panel {
    background: #f8fafc !important;
    border-left: 1px solid #e2e8f0 !important;
}

/* Meta Card Grid */
#txDetailsModal .tx-meta-card {
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 8px;
}

body.light-theme #txDetailsModal .tx-meta-card {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03) !important;
}

#txDetailsModal .tx-meta-label {
    color: #94a3b8;
    font-size: 0.7rem;
    margin-bottom: 2px;
}

body.light-theme #txDetailsModal .tx-meta-label {
    color: #64748b !important;
}

#txDetailsModal .tx-meta-val {
    color: #ffffff;
    font-weight: 600;
}

body.light-theme #txDetailsModal .tx-meta-val {
    color: #0f172a !important;
}

/* Comment Box */
#txDetailsModal .tx-comment-card {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid #334155;
    border-radius: 8px;
}

body.light-theme #txDetailsModal .tx-comment-card {
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
}

#txDetailsModal .tx-comment-title {
    color: #94a3b8;
}

body.light-theme #txDetailsModal .tx-comment-title {
    color: #475569 !important;
}

#txDetailsModal .tx-comment-text {
    color: #ffffff;
}

body.light-theme #txDetailsModal .tx-comment-text {
    color: #1e293b !important;
}

/* Products Section Header */
#txDetailsModal .tx-section-header {
    color: #cbd5e1;
    border-bottom: 1px solid #1f2937;
}

body.light-theme #txDetailsModal .tx-section-header {
    color: #0f172a !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

#txDetailsModal .tx-count-badge {
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.06);
}

body.light-theme #txDetailsModal .tx-count-badge {
    color: #475569 !important;
    background: #e2e8f0 !important;
}

/* Product Item Cards */
#txDetailsModal .tx-item-card {
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 8px;
}

body.light-theme #txDetailsModal .tx-item-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
}

#txDetailsModal .tx-item-title {
    color: #ffffff;
    font-weight: 600;
}

body.light-theme #txDetailsModal .tx-item-title {
    color: #0f172a !important;
}

#txDetailsModal .tx-item-sku {
    color: #6b7280;
}

body.light-theme #txDetailsModal .tx-item-sku {
    color: #64748b !important;
}

#txDetailsModal .tx-item-qtyprice {
    color: #94a3b8;
    font-size: 0.8rem;
}

body.light-theme #txDetailsModal .tx-item-qtyprice {
    color: #64748b !important;
}

#txDetailsModal .tx-item-subtotal {
    color: #ffffff;
    font-weight: 700;
}

body.light-theme #txDetailsModal .tx-item-subtotal {
    color: #0f172a !important;
}

#txDetailsModal .tx-item-sn {
    background: #1f2937;
    color: #10b981;
    border: 1px solid #374151;
}

body.light-theme #txDetailsModal .tx-item-sn {
    background: #ecfdf5 !important;
    color: #059669 !important;
    border: 1px solid #a7f3d0 !important;
}

/* Total Summary Bar */
#txDetailsModal .tx-total-card {
    background: rgba(17, 24, 39, 0.95);
    border: 1px solid #1f2937;
    box-shadow: 0 -3px 10px rgba(0, 0, 0, 0.15);
}

body.light-theme #txDetailsModal .tx-total-card {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

#txDetailsModal .tx-total-label {
    color: #94a3b8;
}

body.light-theme #txDetailsModal .tx-total-label {
    color: #64748b !important;
}

/* HDM Panel Elements */
#txDetailsModal .tx-hdm-title {
    color: #a5b4fc;
}

body.light-theme #txDetailsModal .tx-hdm-title {
    color: #4f46e5 !important;
}

#txDetailsModal .tx-hdm-overview-card {
    background: #111827;
    border: 1px solid #1f2937;
}

body.light-theme #txDetailsModal .tx-hdm-overview-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
}

body.light-theme #txDetailsModal .tx-hdm-overview-card span {
    color: #64748b !important;
}

body.light-theme #txDetailsModal .tx-hdm-overview-card strong {
    color: #0f172a !important;
}

body.light-theme #txDetailsModal .tx-hdm-overview-card strong#hdmModalTotal {
    color: #10b981 !important;
}

body.light-theme #txDetailsModal .tx-hdm-field-label {
    color: #4338ca !important;
}

/* Light Theme Scrollbars */
body.light-theme #txDetailsContent::-webkit-scrollbar-track,
body.light-theme #txDetailsHdmPanel::-webkit-scrollbar-track,
body.light-theme #txDetailsModal div::-webkit-scrollbar-track {
    background: #f1f5f9 !important;
}

body.light-theme #txDetailsContent::-webkit-scrollbar-thumb,
body.light-theme #txDetailsHdmPanel::-webkit-scrollbar-thumb,
body.light-theme #txDetailsModal div::-webkit-scrollbar-thumb {
    background: #cbd5e1 !important;
}

body.light-theme #txDetailsContent::-webkit-scrollbar-thumb:hover,
body.light-theme #txDetailsHdmPanel::-webkit-scrollbar-thumb:hover,
body.light-theme #txDetailsModal div::-webkit-scrollbar-thumb:hover {
    background: #94a3b8 !important;
}

/* ==================== Sales History & Payment Details Enhancement ==================== */
.sh-summary-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
    padding: 0;
}

.sh-summary-card {
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.sh-summary-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.sh-summary-icon {
    font-size: 1.4rem;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sh-summary-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sh-summary-title {
    font-size: 0.72rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sh-summary-val {
    font-size: 1.15rem;
    font-weight: 800;
    font-family: monospace;
    color: #ffffff;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sh-summary-sub {
    font-size: 0.7rem;
    color: #6b7280;
    margin-top: 1px;
}

body.light-theme .sh-summary-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04) !important;
}

body.light-theme .sh-summary-title {
    color: #64748b !important;
}

body.light-theme .sh-summary-val {
    color: #0f172a !important;
}

body.light-theme .sh-summary-sub {
    color: #94a3b8 !important;
}

/* Modal Financial Hub */
#txDetailsModal .tx-fin-hub {
    background: #0b1324;
    border: 1px solid #1e293b;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 12px;
}

body.light-theme #txDetailsModal .tx-fin-hub {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
}

#txDetailsModal .tx-tab-nav {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
    border-bottom: 1px solid #1f2937;
    padding-bottom: 6px;
}

body.light-theme #txDetailsModal .tx-tab-nav {
    border-bottom: 1px solid #e2e8f0 !important;
}

#txDetailsModal .tx-tab-btn {
    background: transparent;
    border: 1px solid transparent;
    color: #94a3b8;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

#txDetailsModal .tx-tab-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

#txDetailsModal .tx-tab-btn.active {
    color: #60a5fa;
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.35);
}

body.light-theme #txDetailsModal .tx-tab-btn {
    color: #64748b !important;
}

body.light-theme #txDetailsModal .tx-tab-btn:hover {
    color: #0f172a !important;
    background: #f1f5f9 !important;
}

body.light-theme #txDetailsModal .tx-tab-btn.active {
    color: #2563eb !important;
    background: #eff6ff !important;
    border-color: #bfdbfe !important;
}

#txDetailsModal .tx-pay-item {
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

body.light-theme #txDetailsModal .tx-pay-item {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03) !important;
}

#txDetailsModal .tx-cancelled-pay-item {
    background: rgba(239, 68, 68, 0.05);
    border: 1px dashed rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

body.light-theme #txDetailsModal .tx-cancelled-pay-item {
    background: #fef2f2 !important;
    border: 1px dashed #fca5a5 !important;
}

/* ==========================================================================
   PC CONFIGURATOR MODAL (#pcConfiguratorModal) THEME SYSTEM
   ========================================================================== */

#pcConfiguratorModal .modal {
    background: rgba(17, 24, 39, 0.98);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    color: #f8fafc;
}

#pcConfiguratorModal .pc-config-modal-header {
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

#pcConfiguratorModal .pc-config-modal-footer {
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
}

#pcConfiguratorIframeContainer {
    background: #0a0f1e;
}

/* PC Configurator Light Theme */
body.light-theme #pcConfiguratorModal .modal {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    color: #0f172a !important;
    box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.15) !important;
}

body.light-theme #pcConfiguratorModal .pc-config-modal-header {
    background: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
    color: #0f172a !important;
}

body.light-theme #pcConfiguratorModal #modalCompanyTitle {
    color: #0f172a !important;
}

body.light-theme #pcConfiguratorModal .pc-config-modal-footer {
    background: #f8fafc !important;
    border-top: 1px solid #e2e8f0 !important;
    color: #0f172a !important;
}

body.light-theme #pcConfiguratorModal .pc-config-modal-summary {
    color: #475569 !important;
}

body.light-theme #pcConfiguratorIframeContainer {
    background: #f8fafc !important;
}

/* ==========================================================
   MODERN CUSTOM BRANCH SELECTOR COMPONENT
   ========================================================== */

.custom-branch-wrapper {
    position: relative;
    display: inline-block;
    font-family: inherit;
    z-index: 20;
}

.custom-branch-wrapper.is-open {
    z-index: 100;
}

.custom-branch-trigger {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 5px 12px;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.75), rgba(15, 23, 42, 0.9));
    border: 1px solid rgba(99, 102, 241, 0.32);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    outline: none;
    min-height: 40px;
}

.custom-branch-trigger:hover {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 1));
    border-color: rgba(129, 140, 248, 0.65);
    box-shadow: 0 4px 18px rgba(99, 102, 241, 0.28);
    transform: translateY(-1px);
}

.custom-branch-trigger:focus-visible,
.custom-branch-trigger.is-open {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25), 0 8px 24px rgba(0, 0, 0, 0.45);
}

.branch-trigger-icon-wrap {
    position: relative;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(79, 70, 229, 0.35));
    border: 1px solid rgba(99, 102, 241, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.branch-trigger-pulse {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    border: 1.5px solid #0f172a;
    box-shadow: 0 0 8px #10b981;
    animation: branchPulseGlow 2s infinite ease-in-out;
}

@keyframes branchPulseGlow {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 6px #10b981;
    }

    50% {
        transform: scale(1.15);
        box-shadow: 0 0 10px #34d399, 0 0 16px rgba(52, 211, 153, 0.4);
    }
}

.branch-trigger-text {
    display: flex;
    flex-direction: column;
    text-align: left;
    min-width: 90px;
    max-width: 170px;
}

.branch-trigger-label {
    font-size: 0.6rem;
    font-weight: 700;
    color: #818cf8;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    line-height: 1;
    margin-bottom: 2px;
}

.branch-trigger-value {
    font-size: 0.82rem;
    font-weight: 600;
    color: #f8fafc;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.branch-trigger-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 2px;
}

.branch-type-pill {
    font-size: 0.67rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 6px;
    white-space: nowrap;
    line-height: 1.2;
    transition: all 0.15s ease;
}

.branch-type-pill.store {
    background: rgba(59, 130, 246, 0.16);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.32);
}

.branch-type-pill.warehouse {
    background: rgba(168, 85, 247, 0.16);
    color: #d8b4fe;
    border: 1px solid rgba(168, 85, 247, 0.32);
}

.branch-type-pill.defect {
    background: rgba(245, 158, 11, 0.16);
    color: #fde68a;
    border: 1px solid rgba(245, 158, 11, 0.32);
}

.branch-chevron {
    width: 16px;
    height: 16px;
    color: #94a3b8;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s ease;
    flex-shrink: 0;
}

.custom-branch-trigger.is-open .branch-chevron {
    transform: rotate(180deg);
    color: #818cf8;
}

/* Dropdown Popup Card */
.custom-branch-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 320px;
    width: 340px;
    background: rgba(15, 23, 42, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: 14px;
    box-shadow: 0 20px 45px -8px rgba(0, 0, 0, 0.8), 0 0 25px rgba(99, 102, 241, 0.15);
    z-index: 1050;
    padding: 10px;
    display: none;
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
    transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.custom-branch-dropdown.show {
    display: block;
    opacity: 1;
    transform: translateY(0) scale(1);
    animation: branchDropdownSlide 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes branchDropdownSlide {
    0% {
        opacity: 0;
        transform: translateY(-8px) scale(0.98);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.branch-dropdown-header {
    margin-bottom: 8px;
}

.branch-dropdown-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    padding: 2px 4px;
}

.branch-dropdown-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.branch-dropdown-title-icon {
    font-size: 0.95rem;
}

.branch-count-badge {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.28);
}

.branch-dropdown-search-wrap {
    position: relative;
    margin-bottom: 8px;
}

.branch-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: #64748b;
    pointer-events: none;
}

.branch-search-input {
    width: 100%;
    background: #090e1a;
    border: 1px solid #1e293b;
    border-radius: 8px;
    padding: 7px 28px 7px 28px;
    font-size: 0.78rem;
    color: #e2e8f0;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
}

.branch-search-input::placeholder {
    color: #475569;
}

.branch-search-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.22);
}

.branch-search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    transition: color 0.15s;
}

.branch-search-clear:hover {
    color: #cbd5e1;
}

.branch-items-list {
    max-height: 280px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-right: 2px;
}

.branch-items-list::-webkit-scrollbar {
    width: 4px;
}

.branch-items-list::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5);
    border-radius: 2px;
}

.branch-items-list::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 2px;
}

.branch-items-list::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

.branch-item-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    cursor: pointer;
    border: 1px solid transparent;
    background: rgba(30, 41, 59, 0.35);
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.branch-item-card:hover {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.35);
    transform: translateX(3px);
}

.branch-item-card.is-selected {
    background: rgba(99, 102, 241, 0.22);
    border-color: #6366f1;
    box-shadow: 0 0 14px rgba(99, 102, 241, 0.2);
}

.branch-item-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.branch-item-avatar.store {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
}

.branch-item-avatar.warehouse {
    background: rgba(168, 85, 247, 0.15);
    border-color: rgba(168, 85, 247, 0.3);
}

.branch-item-avatar.defect {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.3);
}

.branch-item-body {
    flex: 1;
    min-width: 0;
}

.branch-item-name {
    font-size: 0.84rem;
    font-weight: 600;
    color: #f1f5f9;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.branch-item-meta {
    font-size: 0.7rem;
    color: #94a3b8;
    margin-top: 2px;
    line-height: 1.2;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.branch-item-meta-icon {
    font-size: 0.65rem;
    color: #64748b;
}

.branch-item-badge-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.branch-item-active-badge {
    background: rgba(16, 185, 129, 0.16);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.38);
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    gap: 3px;
}

.branch-item-default-badge {
    background: rgba(99, 102, 241, 0.12);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.25);
    font-size: 0.64rem;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 4px;
}

.branch-items-empty {
    padding: 20px 10px;
    text-align: center;
    color: #64748b;
    font-size: 0.78rem;
}

.branch-dropdown-footer {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.68rem;
    color: #64748b;
    line-height: 1.35;
    text-align: center;
}

/* Light theme support */
body.light-theme .custom-branch-trigger {
    background: linear-gradient(135deg, #ffffff, #f1f5f9);
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

body.light-theme .custom-branch-trigger:hover {
    background: #ffffff;
    border-color: #94a3b8;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

body.light-theme .branch-trigger-value {
    color: #0f172a;
}

body.light-theme .custom-branch-dropdown {
    background: #ffffff;
    border-color: #cbd5e1;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

body.light-theme .branch-dropdown-title {
    color: #0f172a;
}

body.light-theme .branch-search-input {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #0f172a;
}

body.light-theme .branch-item-card {
    background: #f8fafc;
}

body.light-theme .branch-item-card:hover {
    background: #eef2ff;
}

body.light-theme .branch-item-card.is-selected {
    background: #e0e7ff;
}

body.light-theme .branch-item-name {
    color: #0f172a;
}

body.light-theme .branch-dropdown-footer {
    border-top-color: #e2e8f0;
}

/* ==========================================================
   MODERN TOPBAR CURRENCY BADGE & PRICE TIER TOGGLE
   ========================================================== */

.custom-currency-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.75), rgba(15, 23, 42, 0.9));
    border: 1px solid rgba(16, 185, 129, 0.32);
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    cursor: default;
    user-select: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 40px;
    box-sizing: border-box;
}

.custom-currency-badge:hover {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 1));
    border-color: rgba(52, 211, 153, 0.65);
    box-shadow: 0 4px 18px rgba(16, 185, 129, 0.25);
    transform: translateY(-1px);
}

.currency-badge-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.3));
    border: 1px solid rgba(16, 185, 129, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.currency-badge-content {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.currency-badge-label {
    font-size: 0.58rem;
    font-weight: 700;
    color: #34d399;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    line-height: 1;
    margin-bottom: 2px;
}

.currency-badge-val-row {
    display: flex;
    align-items: baseline;
    gap: 4px;
    line-height: 1.1;
}

.currency-badge-unit {
    font-size: 0.74rem;
    font-weight: 600;
    color: #94a3b8;
}

.currency-badge-num {
    font-size: 0.88rem;
    font-weight: 700;
    color: #f8fafc;
    font-family: 'Courier New', monospace, sans-serif;
    letter-spacing: 0.02em;
}

.currency-badge-sym {
    font-size: 0.74rem;
    font-weight: 600;
    color: #94a3b8;
}

.currency-badge-lock {
    font-size: 0.68rem;
    color: #64748b;
    margin-left: 2px;
    opacity: 0.75;
}

/* Modern Price Tier Toggle Override */
.price-tier-toggle {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.75), rgba(15, 23, 42, 0.9));
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 10px;
    padding: 3px;
    gap: 3px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    min-height: 40px;
    box-sizing: border-box;
}

.price-tier-toggle button {
    padding: 4px 12px;
    border-radius: 7px;
    border: none;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: #94a3b8;
    background: transparent;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 32px;
    user-select: none;
}

.price-tier-toggle button:hover:not(.active) {
    color: #f1f5f9;
    background: rgba(255, 255, 255, 0.06);
}

.price-tier-toggle button.active {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.45);
}

/* Light Theme Overrides for Currency & Toggle */
body.light-theme .custom-currency-badge {
    background: linear-gradient(135deg, #ffffff, #f1f5f9);
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

body.light-theme .currency-badge-num {
    color: #0f172a;
}

body.light-theme .price-tier-toggle {
    background: linear-gradient(135deg, #ffffff, #f1f5f9);
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

body.light-theme .price-tier-toggle button {
    color: #64748b;
}

body.light-theme .price-tier-toggle button.active {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #ffffff;
}

/* ============================================================
   ENTERPRISE USER MANAGEMENT (V3)
   ============================================================ */

#tab-users.tab-panel.active,
.um-main-shell.active {
    display: flex !important;
    flex-direction: column;
    padding: 20px 24px;
    gap: 16px;
    height: 100%;
    box-sizing: border-box;
    overflow-y: auto;
    background: radial-gradient(circle at 10% 10%, rgba(30, 41, 59, 0.45) 0%, transparent 60%);
}

/* Header */
.um-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.um-title-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
}

.um-icon-badge {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25) 0%, rgba(139, 92, 246, 0.2) 100%);
    border: 1px solid rgba(129, 140, 248, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.2);
    flex-shrink: 0;
}

.um-title {
    font-size: 1.28rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.um-subtitle {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: 3px;
}

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

.um-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 16px;
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #e2e8f0;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(8px);
}

.um-btn-secondary:hover {
    background: rgba(51, 65, 85, 0.85);
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.um-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    border: 1px solid rgba(167, 139, 250, 0.4);
    border-radius: 10px;
    color: #ffffff;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 18px rgba(99, 102, 241, 0.4);
    letter-spacing: 0.01em;
}

.um-btn-primary:hover {
    background: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%);
    border-color: rgba(196, 181, 253, 0.7);
    transform: translateY(-1px);
    box-shadow: 0 6px 22px rgba(99, 102, 241, 0.55);
}

.um-btn-primary:active,
.um-btn-secondary:active {
    transform: scale(0.97);
}

/* KPI Ribbon */
.um-kpi-ribbon {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

@media (max-width: 1100px) {
    .um-kpi-ribbon {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .um-kpi-ribbon {
        grid-template-columns: 1fr;
    }
}

.um-kpi-card {
    background: rgba(17, 24, 39, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 16px 18px;
    backdrop-filter: blur(14px);
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    overflow: hidden;
    transition: all 0.22s ease;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.um-kpi-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.16);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.um-kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.um-kpi-total .um-kpi-icon {
    background: rgba(99, 102, 241, 0.16);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.um-kpi-active .um-kpi-icon {
    background: rgba(16, 185, 129, 0.16);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.um-kpi-admins .um-kpi-icon {
    background: rgba(139, 92, 246, 0.16);
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.um-kpi-warehouses .um-kpi-icon {
    background: rgba(6, 182, 212, 0.16);
    border: 1px solid rgba(6, 182, 212, 0.3);
}

.um-kpi-content {
    flex: 1;
}

.um-kpi-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.um-kpi-value {
    font-size: 1.55rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.15;
    margin-top: 2px;
}

/* Toolbar */
.um-toolbar {
    background: rgba(17, 24, 39, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.um-search-wrap {
    position: relative;
    flex: 1;
    min-width: 260px;
    display: flex;
    align-items: center;
}

.um-search-icon {
    position: absolute;
    left: 12px;
    font-size: 0.85rem;
    color: #64748b;
    pointer-events: none;
}

.um-search-input {
    width: 100%;
    padding: 9px 34px 9px 36px;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 9px;
    color: #ffffff;
    font-size: 0.85rem;
    font-family: inherit;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.um-search-input:focus {
    outline: none;
    border-color: #6366f1;
    background: rgba(15, 23, 42, 0.95);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.um-search-input::placeholder {
    color: #64748b;
}

.um-search-clear {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: #64748b;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    display: none;
    border-radius: 50%;
}

.um-search-clear:hover {
    color: #f1f5f9;
}

.um-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.um-select-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.um-select-icon {
    position: absolute;
    left: 10px;
    font-size: 0.82rem;
    pointer-events: none;
    opacity: 0.8;
}

.um-select {
    padding: 9px 28px 9px 32px;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 9px;
    color: #e2e8f0;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 14px;
}

.um-select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.um-count-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 9px;
    font-size: 0.78rem;
    color: #94a3b8;
    white-space: nowrap;
}

.um-count-pill strong {
    color: #6ee7b7;
}

/* Table Card */
.um-table-card {
    background: rgba(17, 24, 39, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    overflow: hidden;
    backdrop-filter: blur(14px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.um-table-scroll {
    overflow: auto;
    flex: 1;
}

.um-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.um-table thead th {
    background: rgba(15, 23, 42, 0.85);
    color: #94a3b8;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 13px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: sticky;
    top: 0;
    z-index: 2;
    backdrop-filter: blur(8px);
}

.um-table tbody td {
    padding: 13px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 0.86rem;
    color: #cbd5e1;
    vertical-align: middle;
    transition: background 0.15s ease;
}

.um-table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.028);
}

.um-table tbody tr.um-row-me td {
    background: rgba(99, 102, 241, 0.07);
}

.um-table tbody tr.um-row-me:hover td {
    background: rgba(99, 102, 241, 0.12);
}

/* User cell */
.um-user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.um-avatar {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 800;
    color: #ffffff;
    flex-shrink: 0;
    text-transform: uppercase;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.um-user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.um-username-line {
    display: flex;
    align-items: center;
    gap: 6px;
}

.um-username {
    font-weight: 700;
    color: #ffffff;
    font-size: 0.9rem;
}

.um-me-badge {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 5px;
    background: rgba(99, 102, 241, 0.25);
    border: 1px solid rgba(129, 140, 248, 0.4);
    color: #c7d2fe;
    letter-spacing: 0.02em;
}

.um-user-id {
    font-size: 0.72rem;
    color: #64748b;
}

.um-fullname {
    font-size: 0.86rem;
    color: #e2e8f0;
    font-weight: 500;
}

/* Role Badges */
.um-role-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 7px;
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.um-role-admin {
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.35);
    color: #c4b5fd;
}

.um-role-manager {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.35);
    color: #93c5fd;
}

.um-role-seller {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #6ee7b7;
}

.um-role-accountant {
    background: rgba(6, 182, 212, 0.15);
    border: 1px solid rgba(6, 182, 212, 0.35);
    color: #67e8f9;
}

.um-role-warehouse {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #fcd34d;
}

/* Branch Access */
.um-access-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    color: #cbd5e1;
}

.um-access-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(6, 182, 212, 0.12);
    border: 1px solid rgba(6, 182, 212, 0.25);
    color: #67e8f9;
    font-size: 0.76rem;
    font-weight: 500;
}

.um-access-none {
    color: #64748b;
    font-size: 0.8rem;
    font-style: italic;
}

.um-access-all {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.25);
    color: #a5b4fc;
    font-size: 0.76rem;
    font-weight: 600;
}

/* Status Pill */
.um-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.76rem;
    font-weight: 600;
}

.um-status-pill.active {
    background: rgba(16, 185, 129, 0.14);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.um-status-pill.inactive {
    background: rgba(239, 68, 68, 0.14);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.um-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

.um-status-pill.active .um-status-dot {
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
}

.um-status-pill.inactive .um-status-dot {
    background: #ef4444;
}

/* Action Buttons */
.um-actions-cell {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.um-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 6px 10px;
    border-radius: 7px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    user-select: none;
}

.um-action-btn:active {
    transform: scale(0.95);
}

.um-action-btn.edit {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.28);
    color: #a5b4fc;
}

.um-action-btn.edit:hover {
    background: rgba(99, 102, 241, 0.25);
    border-color: rgba(129, 140, 248, 0.6);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.um-action-btn.delete {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.28);
    color: #fca5a5;
}

.um-action-btn.delete:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.6);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.um-action-me-badge {
    font-size: 0.74rem;
    font-weight: 600;
    color: #64748b;
    padding: 5px 10px;
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

/* Empty State */
.um-empty-state {
    padding: 60px 20px;
    text-align: center;
    color: #94a3b8;
}

.um-empty-icon {
    font-size: 2.8rem;
    margin-bottom: 12px;
    opacity: 0.8;
}

.um-empty-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #e2e8f0;
    margin-bottom: 6px;
}

.um-empty-desc {
    font-size: 0.82rem;
    color: #64748b;
}

/* ==================== LIGHT THEME OVERRIDES (UM V3) ==================== */
body.light-theme #tab-users.tab-panel.active,
body.light-theme .um-main-shell.active {
    background: radial-gradient(circle at 10% 10%, rgba(241, 245, 249, 0.6) 0%, transparent 60%);
}

body.light-theme .um-title {
    color: #0f172a;
}

body.light-theme .um-subtitle {
    color: #64748b;
}

body.light-theme .um-icon-badge {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.1) 100%);
    border-color: rgba(99, 102, 241, 0.25);
}

body.light-theme .um-btn-secondary {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #334155;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

body.light-theme .um-btn-secondary:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a;
}

body.light-theme .um-kpi-card {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

body.light-theme .um-kpi-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

body.light-theme .um-kpi-value {
    color: #0f172a;
}

body.light-theme .um-kpi-label {
    color: #64748b;
}

body.light-theme .um-toolbar {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

body.light-theme .um-search-input {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
}

body.light-theme .um-search-input:focus {
    background: #ffffff;
}

body.light-theme .um-select {
    background-color: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
}

body.light-theme .um-count-pill {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #64748b;
}

body.light-theme .um-count-pill strong {
    color: #059669;
}

body.light-theme .um-table-card {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
}

body.light-theme .um-table thead th {
    background: #f8fafc;
    color: #475569;
    border-bottom-color: #e2e8f0;
}

body.light-theme .um-table tbody td {
    color: #334155;
    border-bottom-color: #f1f5f9;
}

body.light-theme .um-table tbody tr:hover td {
    background: #f8fafc;
}

body.light-theme .um-table tbody tr.um-row-me td {
    background: rgba(99, 102, 241, 0.05);
}

body.light-theme .um-username {
    color: #0f172a;
}

body.light-theme .um-fullname {
    color: #1e293b;
}

body.light-theme .um-action-me-badge {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #64748b;
}

/* ==========================================================================
   Arrivals Management Toolbar, Date Presets & Live KPIs
   ========================================================================== */
.arrival-filter-container {
    background: rgba(17, 24, 39, 0.4);
    border: 1px solid rgba(55, 65, 81, 0.4);
    border-radius: 10px;
    padding: 10px 12px;
}

.arrival-preset-pill {
    background: rgba(31, 41, 55, 0.65);
    border: 1px solid rgba(75, 85, 99, 0.4);
    color: #9ca3af;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
    user-select: none;
}

.arrival-preset-pill:hover {
    background: rgba(55, 65, 81, 0.85);
    color: #f3f4f6;
    border-color: rgba(107, 114, 128, 0.6);
}

.arrival-preset-pill.active {
    background: #4f46e5 !important;
    border-color: #6366f1 !important;
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: 0 1px 6px rgba(99, 102, 241, 0.35);
}

.arrival-kpi-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(17, 24, 39, 0.7);
    border: 1px solid rgba(75, 85, 99, 0.4);
    border-radius: 6px;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.arrival-kpi-chip-cost {
    border-color: rgba(16, 185, 129, 0.45);
    background: rgba(6, 78, 59, 0.2);
}

.arrival-kpi-lbl {
    color: #9ca3af;
    font-size: 0.74rem;
    font-weight: 500;
}

.arrival-kpi-val {
    color: #f3f4f6;
    font-weight: 700;
    font-size: 0.82rem;
}

.arrival-actions-wrap {
    background: rgba(31, 41, 55, 0.7);
    border: 1px solid rgba(55, 65, 81, 0.6);
}

/* Light Theme Overrides for Arrivals */
body.light-theme .arrival-filter-container {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

body.light-theme .arrival-preset-pill {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #475569;
}

body.light-theme .arrival-preset-pill:hover {
    background: #e2e8f0;
    color: #0f172a;
    border-color: #94a3b8;
}

body.light-theme .arrival-preset-pill.active {
    background: #4f46e5 !important;
    border-color: #4338ca !important;
    color: #ffffff !important;
    box-shadow: 0 1px 4px rgba(79, 70, 229, 0.25);
}

body.light-theme .arrival-kpi-chip {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

body.light-theme .arrival-kpi-chip-cost {
    border-color: rgba(16, 185, 129, 0.45);
    background: #ecfdf5;
}

body.light-theme .arrival-kpi-lbl {
    color: #64748b;
}

body.light-theme .arrival-kpi-val {
    color: #0f172a;
}

body.light-theme a.arrival-view-trigger {
    color: #4f46e5 !important;
}

body.light-theme a.arrival-view-trigger:hover {
    color: #4338ca !important;
}

body.light-theme .arrival-actions-wrap {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
}

body.light-theme .arrival-actions-wrap button.arrival-view-trigger {
    background: rgba(99, 102, 241, 0.12) !important;
    color: #4f46e5 !important;
    border-color: rgba(99, 102, 241, 0.28) !important;
}

body.light-theme .arrival-actions-wrap button[onclick*="editArrivalFromGrid"] {
    background: rgba(245, 158, 11, 0.12) !important;
    color: #b45309 !important;
    border-color: rgba(245, 158, 11, 0.28) !important;
}

body.light-theme .arrival-actions-wrap button[onclick*="deleteArrivalFromGrid"] {
    background: rgba(239, 68, 68, 0.12) !important;
    color: #dc2626 !important;
    border-color: rgba(239, 68, 68, 0.28) !important;
}

/* ==========================================================================
   Transfers Management Toolbar, Date Presets & Live KPIs
   ========================================================================== */
.transfer-filter-container {
    background: rgba(17, 24, 39, 0.4);
    border: 1px solid rgba(55, 65, 81, 0.4);
    border-radius: 10px;
    padding: 10px 12px;
}

.transfer-preset-pill {
    background: rgba(31, 41, 55, 0.65);
    border: 1px solid rgba(75, 85, 99, 0.4);
    color: #9ca3af;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
    user-select: none;
}

.transfer-preset-pill:hover {
    background: rgba(55, 65, 81, 0.85);
    color: #f3f4f6;
    border-color: rgba(107, 114, 128, 0.6);
}

.transfer-preset-pill.active {
    background: #4f46e5 !important;
    border-color: #6366f1 !important;
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: 0 1px 6px rgba(99, 102, 241, 0.35);
}

.transfer-kpi-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(17, 24, 39, 0.7);
    border: 1px solid rgba(75, 85, 99, 0.4);
    border-radius: 6px;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.transfer-kpi-lbl {
    color: #9ca3af;
    font-size: 0.74rem;
    font-weight: 500;
}

.transfer-kpi-val {
    color: #f3f4f6;
    font-weight: 700;
    font-size: 0.82rem;
}

.transfer-doc-num {
    color: #a5b4fc;
}

.transfer-date-cell {
    color: #fde000;
}

/* Light Theme Overrides for Transfers */
body.light-theme .transfer-filter-container {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

body.light-theme .transfer-preset-pill {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #475569;
}

body.light-theme .transfer-preset-pill:hover {
    background: #e2e8f0;
    color: #0f172a;
    border-color: #94a3b8;
}

body.light-theme .transfer-preset-pill.active {
    background: #4f46e5 !important;
    border-color: #4338ca !important;
    color: #ffffff !important;
    box-shadow: 0 1px 4px rgba(79, 70, 229, 0.25);
}

body.light-theme .transfer-kpi-chip {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

body.light-theme .transfer-kpi-lbl {
    color: #64748b;
}

body.light-theme .transfer-kpi-val {
    color: #0f172a;
}

body.light-theme .transfer-doc-num {
    color: #4338ca;
}

body.light-theme .transfer-date-cell {
    color: #334155;
}

/* ==========================================================================
   User Management Modal Redesign (Dark & Light theme)
   ========================================================================== */
.user-modal-dialog {
    width: 860px !important;
    max-width: 95vw !important;
    max-height: 92vh !important;
    background: rgba(15, 23, 42, 0.97) !important;
    backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 16px !important;
    box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.7), 0 0 35px rgba(99, 102, 241, 0.15) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    padding: 0 !important;
}

.user-modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.8));
    flex-shrink: 0;
}

.user-modal-icon-badge {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(99, 102, 241, 0.18);
    border: 1px solid rgba(99, 102, 241, 0.35);
    color: #818cf8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.user-modal-title {
    font-weight: 800;
    color: #ffffff;
    font-size: 1.15rem;
    letter-spacing: -0.01em;
}

.user-modal-subtitle {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 2px;
}

.user-modal-close-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.2rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.user-modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.user-modal-form {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex: 1;
}

.user-modal-body-grid {
    display: grid;
    grid-template-columns: 310px 1fr;
    gap: 20px;
    padding: 20px 24px;
    overflow-y: auto;
    max-height: calc(92vh - 145px);
}

@media (max-width: 768px) {
    .user-modal-body-grid {
        grid-template-columns: 1fr;
    }
}

.user-modal-col {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.user-preview-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    padding: 12px 14px;
}

.user-preview-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    font-weight: 800;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
    flex-shrink: 0;
}

.user-preview-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #f8fafc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-preview-username {
    font-size: 0.78rem;
    color: #94a3b8;
    font-family: monospace;
}

.user-role-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    border: 1px solid transparent;
}

.role-admin {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.35);
}

.role-manager {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.35);
}

.role-seller {
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
    border-color: rgba(99, 102, 241, 0.35);
}

.role-accountant {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.35);
}

.role-warehouse {
    background: rgba(236, 72, 153, 0.15);
    color: #f472b6;
    border-color: rgba(236, 72, 153, 0.35);
}

.user-field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.user-field-label {
    margin: 0;
    font-weight: 600;
    color: #94a3b8;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.user-field-input {
    width: 100% !important;
    background: rgba(15, 23, 42, 0.7) !important;
    border: 1px solid rgba(75, 85, 99, 0.45) !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    font-size: 0.85rem !important;
    color: #f8fafc !important;
    transition: all 0.2s !important;
}

.user-field-input:focus {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25) !important;
    outline: none !important;
}

.user-pwd-toggle-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-pwd-toggle-btn:hover {
    color: #f8fafc;
}

.user-active-toggle-card {
    background: rgba(30, 41, 59, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 12px 14px;
}

.user-modern-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.user-modern-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.user-switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #475569;
    transition: .22s ease;
    border-radius: 24px;
}

.user-switch-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .22s ease;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}

.user-modern-switch input:checked+.user-switch-slider {
    background-color: #10b981;
}

.user-modern-switch input:checked+.user-switch-slider:before {
    transform: translateX(20px);
}

.user-section-card {
    background: rgba(30, 41, 59, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 14px 16px;
}

.user-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 10px;
    margin-bottom: 12px;
}

.user-section-title {
    font-size: 0.86rem;
    font-weight: 700;
    color: #f1f5f9;
}

.user-section-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.user-sec-btn {
    background: transparent;
    border: none;
    color: #818cf8;
    font-size: 0.74rem;
    font-weight: 600;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.15s;
}

.user-sec-btn:hover {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
}

.user-wh-access-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
    max-height: 145px;
    overflow-y: auto;
    padding-right: 4px;
}

.user-wh-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(75, 85, 99, 0.35);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.18s;
    user-select: none;
}

.user-wh-item:hover {
    border-color: rgba(99, 102, 241, 0.5);
    background: rgba(30, 41, 59, 0.6);
}

.user-wh-item.is-checked {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.12);
}

.user-wh-item input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: #6366f1;
    cursor: pointer;
}

.user-wh-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: #e2e8f0;
}

.user-perms-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: 240px;
    overflow-y: auto;
    padding-right: 4px;
}

.user-admin-perms-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 14px 18px;
    border-radius: 8px;
}

.user-perm-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.user-perm-group-header {
    font-size: 0.74rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-bottom: 2px;
}

.user-perm-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 7px;
}

.user-perm-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(75, 85, 99, 0.3);
    border-radius: 7px;
    cursor: pointer;
    font-size: 0.8rem;
    color: #cbd5e1;
    transition: all 0.18s;
    user-select: none;
}

.user-perm-item:hover {
    border-color: #6366f1;
    background: rgba(30, 41, 59, 0.6);
}

.user-perm-item.is-checked {
    border-color: rgba(99, 102, 241, 0.6);
    background: rgba(99, 102, 241, 0.14);
    color: #ffffff;
    font-weight: 500;
}

.user-perm-item input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: #6366f1;
    cursor: pointer;
}

.user-modal-footer {
    padding: 14px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: rgba(0, 0, 0, 0.25);
    flex-shrink: 0;
}

/* Light Theme Overrides for User Modal */
body.light-theme .user-modal-dialog {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
}

body.light-theme .user-modal-header {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

body.light-theme .user-modal-title {
    color: #0f172a;
}

body.light-theme .user-modal-subtitle {
    color: #64748b;
}

body.light-theme .user-modal-close-btn {
    color: #64748b;
}

body.light-theme .user-modal-close-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

body.light-theme .user-preview-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

body.light-theme .user-preview-name {
    color: #0f172a;
}

body.light-theme .user-preview-username {
    color: #64748b;
}

body.light-theme .user-field-label {
    color: #334155;
}

body.light-theme .user-field-input {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}

body.light-theme .user-active-toggle-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

body.light-theme #userActiveStatusText {
    color: #0f172a;
}

body.light-theme #userActiveStatusDesc {
    color: #64748b;
}

body.light-theme .user-section-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

body.light-theme .user-section-header {
    border-bottom: 1px solid #e2e8f0;
}

body.light-theme .user-section-title {
    color: #0f172a;
}

body.light-theme .user-sec-btn {
    color: #4f46e5;
}

body.light-theme .user-sec-btn:hover {
    background: rgba(99, 102, 241, 0.1);
}

body.light-theme .user-wh-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
}

body.light-theme .user-wh-item:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

body.light-theme .user-wh-item.is-checked {
    background: #eff6ff;
    border-color: #6366f1;
}

body.light-theme .user-wh-name {
    color: #0f172a;
}

body.light-theme .user-perm-group-header {
    color: #64748b;
}

body.light-theme .user-perm-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #334155;
}

body.light-theme .user-perm-item:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

body.light-theme .user-perm-item.is-checked {
    background: #eff6ff;
    border-color: #6366f1;
    color: #1e1b4b;
}

body.light-theme .user-modal-footer {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

/* ============================================================
   ENTERPRISE CATEGORIES MANAGEMENT (V2)
   ============================================================ */

#tab-categories.tab-panel.active,
.cat-main-shell.active {
    display: flex !important;
    flex-direction: column;
    padding: 20px 24px;
    gap: 16px;
    height: 100%;
    box-sizing: border-box;
    overflow-y: auto;
    background: radial-gradient(circle at 10% 10%, rgba(30, 41, 59, 0.45) 0%, transparent 60%);
}

/* Header */
.cat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.cat-title-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
}

.cat-icon-badge {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25) 0%, rgba(139, 92, 246, 0.2) 100%);
    border: 1px solid rgba(129, 140, 248, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.2);
    flex-shrink: 0;
}

.cat-title {
    font-size: 1.28rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.cat-subtitle {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: 3px;
}

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

.cat-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    color: #ffffff;
    border: 1px solid rgba(165, 180, 252, 0.3);
    border-radius: 9px;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
    transition: all 0.2s ease;
}

.cat-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.5);
    background: linear-gradient(135deg, #4338ca 0%, #4f46e5 100%);
}

.cat-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    background: rgba(30, 41, 59, 0.6);
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 9px;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cat-btn-secondary:hover {
    background: rgba(51, 65, 85, 0.8);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
}

/* KPI Cards Grid */
.cat-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

@media (max-width: 900px) {
    .cat-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.cat-kpi-card {
    background: rgba(17, 24, 39, 0.7);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.25s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.cat-kpi-card:hover {
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.cat-kpi-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cat-kpi-label {
    font-size: 0.74rem;
    color: #94a3b8;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.cat-kpi-val {
    font-size: 1.55rem;
    font-weight: 800;
    color: #f8fafc;
    line-height: 1.2;
}

.cat-kpi-sub {
    font-size: 0.7rem;
    color: #64748b;
    font-weight: 500;
}

.cat-kpi-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.cat-kpi-icon.indigo {
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.cat-kpi-icon.emerald {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.cat-kpi-icon.amber {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.cat-kpi-icon.cyan {
    background: rgba(6, 182, 212, 0.15);
    color: #22d3ee;
    border: 1px solid rgba(6, 182, 212, 0.3);
}

/* Toolbar */
.cat-toolbar {
    background: rgba(17, 24, 39, 0.7);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.cat-search-box {
    position: relative;
    max-width: 340px;
    width: 100%;
}

.cat-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.85rem;
    color: #64748b;
    pointer-events: none;
}

.cat-search-inp {
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px 32px 8px 36px;
    color: #f1f5f9;
    font-size: 0.84rem;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
}

.cat-search-inp:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    background: rgba(15, 23, 42, 0.9);
}

.cat-search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    cursor: pointer;
    font-size: 0.85rem;
    display: none;
    padding: 2px;
}

.cat-search-clear:hover {
    color: #e2e8f0;
}

.cat-filter-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cat-filter-btn {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    transition: all 0.15s ease;
}

.cat-filter-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
}

.cat-filter-btn.active {
    background: rgba(99, 102, 241, 0.2);
    border-color: #6366f1;
    color: #a5b4fc;
    font-weight: 700;
}

.cat-sort-select {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 6px 10px;
    color: #cbd5e1;
    font-size: 0.78rem;
    outline: none;
    cursor: pointer;
}

.cat-sort-select:focus {
    border-color: #6366f1;
}

.cat-count-badge {
    font-size: 0.76rem;
    color: #94a3b8;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    font-weight: 600;
}

/* Categories Table Card */
.cat-table-card {
    background: rgba(17, 24, 39, 0.7);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    overflow: auto;
    flex: 1;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    position: relative;
}

.cat-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
    text-align: left;
}

.cat-table thead {
    background: rgba(15, 23, 42, 0.95);
    position: sticky;
    top: 0;
    z-index: 10;
}

.cat-table th {
    padding: 12px 16px;
    color: #94a3b8;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cat-table td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    vertical-align: middle;
}

.cat-table tbody tr {
    transition: background 0.15s ease;
}

.cat-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.06);
}

/* Cell Elements */
.cat-cell-name {
    font-weight: 700;
    color: #f1f5f9;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.cat-cell-name-icon {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    background: rgba(99, 102, 241, 0.15);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.cat-badge-code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(99, 102, 241, 0.12);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.25);
    display: inline-block;
}

.cat-badge-margin-rm {
    font-weight: 700;
    font-size: 0.78rem;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.25);
    display: inline-block;
}

.cat-badge-margin-dm {
    font-weight: 700;
    font-size: 0.78rem;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.25);
    display: inline-block;
}

.cat-badge-warranty {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 700;
    font-size: 0.78rem;
    padding: 4px 10px;
    border-radius: 7px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(5, 150, 105, 0.18) 100%);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.28);
}

.cat-badge-warranty.none {
    background: rgba(148, 163, 184, 0.1);
    color: #94a3b8;
    border-color: rgba(148, 163, 184, 0.2);
}

.cat-badge-products {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 7px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.cat-badge-products.has-items {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
}

.cat-badge-products.empty {
    background: rgba(100, 116, 139, 0.3);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.cat-badge-products:hover {
    transform: scale(1.06);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.cat-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 7px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(30, 41, 59, 0.6);
    color: #cbd5e1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.15s ease;
}

.cat-action-btn:hover {
    background: rgba(99, 102, 241, 0.25);
    border-color: #818cf8;
    color: #ffffff;
    transform: scale(1.06);
}

.cat-action-btn.delete:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: #f87171;
    color: #fca5a5;
}

/* Modal Enhancements */
.cat-modal-box {
    background: #111827;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    width: 100%;
    max-width: 520px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    animation: catModalFadeIn 0.2s ease-out;
}

@keyframes catModalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(-10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.cat-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    background: rgba(15, 23, 42, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cat-modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.05rem;
    font-weight: 700;
    color: #f8fafc;
}

.cat-modal-close {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.15s;
}

.cat-modal-close:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #f87171;
    color: #ffffff;
}

.cat-modal-body {
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cat-field-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #cbd5e1;
    margin-bottom: 6px;
}

.cat-field-label span.req {
    color: #f87171;
}

.cat-modal-input {
    width: 100%;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 9px 12px;
    color: #ffffff;
    font-size: 0.88rem;
    outline: none;
    box-sizing: border-box;
    transition: all 0.2s;
}

.cat-modal-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    background: rgba(15, 23, 42, 0.95);
}

.cat-preset-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.cat-preset-chip {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.74rem;
    font-weight: 600;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    transition: all 0.15s ease;
    user-select: none;
}

.cat-preset-chip:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: #818cf8;
    color: #ffffff;
}

.cat-preset-chip.active {
    background: #4f46e5;
    border-color: #6366f1;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.4);
}

.cat-apply-box {
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 9px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cat-apply-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cat-apply-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #4f46e5;
    cursor: pointer;
}

.cat-apply-label {
    font-size: 0.84rem;
    font-weight: 600;
    color: #e2e8f0;
    cursor: pointer;
    user-select: none;
}

.cat-apply-hint {
    font-size: 0.73rem;
    color: #94a3b8;
    margin-left: 28px;
    line-height: 1.35;
}

.cat-modal-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    padding: 16px 22px;
    background: rgba(15, 23, 42, 0.6);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ==================== LIGHT THEME OVERRIDES (CATEGORIES V2) ==================== */
body.light-theme #tab-categories.tab-panel.active,
body.light-theme .cat-main-shell.active {
    background: radial-gradient(circle at 10% 10%, rgba(241, 245, 249, 0.6) 0%, transparent 60%);
}

body.light-theme .cat-title {
    color: #0f172a;
}

body.light-theme .cat-subtitle {
    color: #64748b;
}

body.light-theme .cat-icon-badge {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.1) 100%);
    border-color: rgba(99, 102, 241, 0.25);
}

body.light-theme .cat-btn-secondary {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #334155;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

body.light-theme .cat-btn-secondary:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a;
}

body.light-theme .cat-kpi-card {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

body.light-theme .cat-kpi-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

body.light-theme .cat-kpi-val {
    color: #0f172a;
}

body.light-theme .cat-kpi-label {
    color: #64748b;
}

body.light-theme .cat-kpi-sub {
    color: #94a3b8;
}

body.light-theme .cat-toolbar {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

body.light-theme .cat-search-inp {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
}

body.light-theme .cat-search-inp:focus {
    background: #ffffff;
    border-color: #6366f1;
}

body.light-theme .cat-filter-btn {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #64748b;
}

body.light-theme .cat-filter-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
}

body.light-theme .cat-filter-btn.active {
    background: rgba(99, 102, 241, 0.12);
    border-color: #6366f1;
    color: #4f46e5;
}

body.light-theme .cat-sort-select {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #334155;
}

body.light-theme .cat-count-badge {
    background: #f1f5f9;
    color: #64748b;
}

body.light-theme .cat-table-card {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

body.light-theme .cat-table thead {
    background: #f8fafc;
}

body.light-theme .cat-table th {
    color: #64748b;
    border-bottom-color: #e2e8f0;
}

body.light-theme .cat-table td {
    border-bottom-color: #f1f5f9;
}

body.light-theme .cat-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.04);
}

body.light-theme .cat-cell-name {
    color: #0f172a;
}

body.light-theme .cat-action-btn {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #475569;
}

body.light-theme .cat-action-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: #6366f1;
    color: #4f46e5;
}

body.light-theme .cat-modal-box {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

body.light-theme .cat-modal-header {
    background: #f8fafc;
    border-bottom-color: #e2e8f0;
}

body.light-theme .cat-modal-title {
    color: #0f172a;
}

body.light-theme .cat-modal-close {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #64748b;
}

body.light-theme .cat-field-label {
    color: #334155;
}

body.light-theme .cat-modal-input {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
}

body.light-theme .cat-modal-input:focus {
    background: #ffffff;
    border-color: #6366f1;
}

body.light-theme .cat-preset-chip {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #475569;
}

body.light-theme .cat-preset-chip:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: #6366f1;
    color: #4f46e5;
}

body.light-theme .cat-preset-chip.active {
    background: #4f46e5;
    border-color: #4f46e5;
    color: #ffffff;
}

body.light-theme .cat-apply-box {
    background: rgba(99, 102, 241, 0.05);
    border-color: rgba(99, 102, 241, 0.2);
}

body.light-theme .cat-apply-label {
    color: #1e293b;
}

body.light-theme .cat-apply-hint {
    color: #64748b;
}

body.light-theme .cat-modal-footer {
    background: #f8fafc;
    border-top-color: #e2e8f0;
}

/* ==========================================================================
   WARRANTY RULES & CATEGORY SUBVIEW SWITCHER
   ========================================================================== */
.cat-subview-switcher {
    display: inline-flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.cat-subview-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    font-size: 0.86rem;
    font-weight: 600;
    color: #94a3b8;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 9px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.cat-subview-btn:hover {
    color: #f1f5f9;
    background: rgba(255, 255, 255, 0.05);
}

.cat-subview-btn.active {
    color: #ffffff;
    background: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%);
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}

.cat-count-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 7px;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.15);
    color: inherit;
    line-height: 1;
}

.cat-subview-btn.active .cat-count-pill {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

.cat-subview-pane {
    animation: catPaneFadeIn 0.25s ease-out;
}

@keyframes catPaneFadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Warranty Rule Preset Chips */
.wr-preset-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.wr-preset-chip {
    padding: 5px 12px;
    border-radius: 7px;
    font-size: 0.78rem;
    font-weight: 600;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    cursor: pointer;
    transition: all 0.15s ease;
}

.wr-preset-chip:hover {
    background: rgba(16, 185, 129, 0.15);
    border-color: #34d399;
    color: #34d399;
}

.wr-preset-chip.active {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-color: rgba(52, 211, 153, 0.4);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}

/* Warranty Badges */
.wr-badge-scope {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.76rem;
    font-weight: 600;
}

.wr-badge-scope.brand-only {
    background: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.25);
}

.wr-badge-scope.brand-cat {
    background: rgba(168, 85, 247, 0.12);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.25);
}

.wr-source-hint {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 5px;
    font-size: 0.72rem;
    font-weight: 600;
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.25);
    letter-spacing: 0.2px;
}

.wr-source-hint.source-category {
    background: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.25);
}

.wr-source-hint.source-default {
    background: rgba(148, 163, 184, 0.12);
    color: #94a3b8;
    border-color: rgba(148, 163, 184, 0.25);
}

/* Light Theme Adaptations */
body.light-theme .cat-subview-switcher {
    background: #f1f5f9;
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

body.light-theme .cat-subview-btn {
    color: #64748b;
}

body.light-theme .cat-subview-btn:hover {
    color: #0f172a;
    background: rgba(0, 0, 0, 0.04);
}

body.light-theme .cat-subview-btn.active {
    color: #ffffff;
    background: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%);
}

body.light-theme .wr-preset-chip {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #334155;
}

body.light-theme .wr-preset-chip:hover {
    background: rgba(16, 185, 129, 0.1);
    border-color: #10b981;
    color: #059669;
}

body.light-theme .wr-badge-scope.brand-only {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
    border-color: rgba(59, 130, 246, 0.2);
}

body.light-theme .wr-badge-scope.brand-cat {
    background: rgba(168, 85, 247, 0.1);
    color: #9333ea;
    border-color: rgba(168, 85, 247, 0.2);
}

body.light-theme .wr-source-hint {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border-color: rgba(16, 185, 129, 0.2);
}

body.light-theme .wr-source-hint.source-category {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
    border-color: rgba(59, 130, 246, 0.2);
}

body.light-theme .wr-source-hint.source-default {
    background: #f1f5f9;
    color: #64748b;
    border-color: #cbd5e1;
}

/* ==========================================================================
   👥 COUNTERPARTIES (ԿՈՆՏՐԱԳԵՆՏՆԵՐ) MODERN SHELL & THEME STYLES
   ========================================================================== */

#tab-counterparties.tab-panel.active,
.cp-main-shell.active {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px 20px;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    overflow-y: auto;
}

/* Header */
.cp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.cp-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cp-icon-badge {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(99, 102, 241, 0.15) 100%);
    border: 1px solid rgba(59, 130, 246, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.cp-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #f8fafc;
    letter-spacing: -0.01em;
}

.cp-subtitle {
    font-size: 0.8rem;
    color: #94a3b8;
    font-weight: 500;
    margin-top: 2px;
}

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

.cp-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.cp-btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

.cp-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(30, 41, 59, 0.6);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 0.84rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cp-btn-secondary:hover {
    background: rgba(51, 65, 85, 0.8);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.22);
}

/* KPI Cards Grid */
.cp-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
    gap: 12px;
}

.cp-kpi-card {
    background: rgba(17, 24, 39, 0.7);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.25s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.cp-kpi-card:hover {
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.cp-kpi-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cp-kpi-label {
    font-size: 0.72rem;
    color: #94a3b8;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.cp-kpi-val {
    font-size: 1.45rem;
    font-weight: 800;
    color: #f8fafc;
    line-height: 1.2;
}

.cp-kpi-sub {
    font-size: 0.68rem;
    color: #64748b;
    font-weight: 500;
}

.cp-kpi-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.cp-kpi-icon.indigo {
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.cp-kpi-icon.cyan {
    background: rgba(6, 182, 212, 0.15);
    color: #22d3ee;
    border: 1px solid rgba(6, 182, 212, 0.3);
}

.cp-kpi-icon.emerald {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.cp-kpi-icon.purple {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.cp-kpi-icon.amber {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Toolbar & Filters */
.cp-toolbar {
    background: rgba(17, 24, 39, 0.7);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.cp-search-box {
    position: relative;
    max-width: 320px;
    width: 100%;
    min-width: 220px;
}

.cp-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.85rem;
    color: #64748b;
    pointer-events: none;
}

.cp-search-inp {
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 7px 32px 7px 34px;
    font-size: 0.84rem;
    color: #f8fafc;
    box-sizing: border-box;
    outline: none;
    transition: all 0.2s ease;
}

.cp-search-inp:focus {
    border-color: #3b82f6;
    background: rgba(15, 23, 42, 0.85);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

.cp-search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #64748b;
    font-size: 0.8rem;
    padding: 2px 4px;
    transition: color 0.15s ease;
    display: none;
}

.cp-search-clear:hover {
    color: #f8fafc;
}

.cp-filter-group {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(15, 23, 42, 0.5);
    padding: 3px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    flex-wrap: wrap;
}

.cp-filter-btn {
    background: transparent;
    border: none;
    border-radius: 7px;
    padding: 5px 11px;
    font-size: 0.77rem;
    font-weight: 600;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.cp-filter-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #f1f5f9;
}

.cp-filter-btn.active {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.35);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.cp-select {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.78rem;
    color: #e2e8f0;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.cp-select:focus {
    border-color: #3b82f6;
}

.cp-count-badge {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 0.74rem;
    font-weight: 600;
    color: #94a3b8;
    white-space: nowrap;
}

/* Table Card */
.cp-table-card {
    background: rgba(17, 24, 39, 0.7);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    flex: 1;
}

.cp-table-wrap {
    overflow-x: auto;
    overflow-y: auto;
    flex: 1;
    max-height: calc(100vh - 355px);
}

.cp-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.cp-table thead {
    background: rgba(15, 23, 42, 0.95);
    position: sticky;
    top: 0;
    z-index: 2;
}

.cp-table th {
    padding: 12px 14px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    white-space: nowrap;
}

.cp-table td {
    padding: 10px 14px;
    font-size: 0.83rem;
    color: #e2e8f0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    vertical-align: middle;
}

.cp-table tbody tr {
    transition: background 0.15s ease;
}

.cp-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.06);
}

/* Table Cells & Badges */
.cp-name-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cp-avatar {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(99, 102, 241, 0.2) 100%);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #93c5fd;
    font-weight: 700;
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cp-name-wrap {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cp-name-text {
    font-weight: 600;
    color: #f8fafc;
    font-size: 0.88rem;
}

.cp-tin-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.69rem;
    font-family: monospace;
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.25);
    padding: 1px 5px;
    border-radius: 4px;
    cursor: pointer;
    width: fit-content;
}

.cp-tin-badge:hover {
    background: rgba(245, 158, 11, 0.22);
}

.cp-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.74rem;
    font-weight: 600;
    white-space: nowrap;
}

.cp-type-badge.wholesale {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.cp-type-badge.retail {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.cp-type-badge.cooperative {
    background: rgba(168, 85, 247, 0.15);
    color: #d8b4fe;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.cp-type-badge.state {
    background: rgba(245, 158, 11, 0.15);
    color: #fde68a;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.cp-type-badge.supplier {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.cp-type-badge.dealer {
    background: rgba(6, 182, 212, 0.15);
    color: #67e8f9;
    border: 1px solid rgba(6, 182, 212, 0.3);
}

.cp-phone-link {
    color: #38bdf8;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: monospace;
    font-size: 0.8rem;
    transition: color 0.15s ease;
}

.cp-phone-link:hover {
    color: #7dd3fc;
    text-decoration: underline;
}

.cp-email-link {
    color: #94a3b8;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.74rem;
}

.cp-email-link:hover {
    color: #cbd5e1;
    text-decoration: underline;
}

.cp-credit-pill {
    background: rgba(99, 102, 241, 0.12);
    color: #c7d2fe;
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 5px;
    padding: 2px 7px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.cp-credit-pill:hover {
    background: rgba(99, 102, 241, 0.28);
    border-color: rgba(99, 102, 241, 0.5);
    transform: translateY(-1px);
}

.cp-credit-pill-add {
    font-size: 0.72rem;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.04);
    padding: 2px 8px;
    border-radius: 5px;
    border: 1px dashed rgba(255, 255, 255, 0.18);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    transition: all 0.15s ease;
}

.cp-credit-pill-add:hover {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.4);
    transform: translateY(-1px);
}

.cp-balance-pill {
    padding: 2px 7px;
    border-radius: 5px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.cp-balance-pill.positive {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.cp-balance-pill.negative {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.cp-balance-pill.zero {
    background: rgba(148, 163, 184, 0.1);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.15);
}

.cp-actions-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.cp-action-btn {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(30, 41, 59, 0.6);
    color: #94a3b8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
}

.cp-action-btn.view:hover {
    border-color: #3b82f6;
    color: #60a5fa;
    background: rgba(59, 130, 246, 0.15);
    transform: translateY(-1px);
}

.cp-action-btn.edit:hover {
    border-color: #f59e0b;
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.15);
    transform: translateY(-1px);
}

.cp-action-btn.delete:hover {
    border-color: #ef4444;
    color: #f87171;
    background: rgba(239, 68, 68, 0.15);
    transform: translateY(-1px);
}

.cp-empty-state {
    padding: 48px 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.cp-empty-icon {
    font-size: 2.5rem;
    opacity: 0.6;
}

.cp-empty-title {
    font-size: 1rem;
    font-weight: 700;
    color: #f8fafc;
}

.cp-empty-desc {
    font-size: 0.82rem;
    color: #94a3b8;
    max-width: 320px;
}

/* ==========================================================================
   👥 COUNTERPARTIES LIGHT THEME OVERRIDES (body.light-theme)
   ========================================================================== */

body.light-theme #tab-counterparties.tab-panel.active,
body.light-theme .cp-main-shell.active {
    background: radial-gradient(circle at 10% 10%, rgba(241, 245, 249, 0.7) 0%, transparent 60%);
}

body.light-theme .cp-title {
    color: #0f172a;
}

body.light-theme .cp-subtitle {
    color: #64748b;
}

body.light-theme .cp-icon-badge {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(99, 102, 241, 0.1) 100%);
    border-color: rgba(59, 130, 246, 0.25);
}

body.light-theme .cp-btn-secondary {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #334155;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

body.light-theme .cp-btn-secondary:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a;
}

body.light-theme .cp-kpi-card {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

body.light-theme .cp-kpi-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

body.light-theme .cp-kpi-val {
    color: #0f172a;
}

body.light-theme .cp-kpi-label {
    color: #64748b;
}

body.light-theme .cp-kpi-sub {
    color: #94a3b8;
}

body.light-theme .cp-toolbar {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

body.light-theme .cp-search-inp {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
}

body.light-theme .cp-search-inp:focus {
    background: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

body.light-theme .cp-search-clear {
    color: #94a3b8;
}

body.light-theme .cp-search-clear:hover {
    color: #0f172a;
}

body.light-theme .cp-filter-group {
    background: #f1f5f9;
    border-color: #e2e8f0;
}

body.light-theme .cp-filter-btn {
    color: #64748b;
}

body.light-theme .cp-filter-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
}

body.light-theme .cp-filter-btn.active {
    background: rgba(59, 130, 246, 0.12);
    border-color: #3b82f6;
    color: #2563eb;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

body.light-theme .cp-select {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #334155;
}

body.light-theme .cp-count-badge {
    background: #f1f5f9;
    color: #64748b;
    border-color: #e2e8f0;
}

body.light-theme .cp-table-card {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

body.light-theme .cp-table thead {
    background: #f8fafc;
}

body.light-theme .cp-table th {
    color: #64748b;
    border-bottom-color: #e2e8f0;
}

body.light-theme .cp-table td {
    color: #334155;
    border-bottom-color: #f1f5f9;
}

body.light-theme .cp-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.04);
}

body.light-theme .cp-name-text {
    color: #0f172a;
}

body.light-theme .cp-avatar {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(99, 102, 241, 0.15) 100%);
    border-color: rgba(59, 130, 246, 0.25);
    color: #2563eb;
}

body.light-theme .cp-tin-badge {
    background: rgba(217, 119, 6, 0.12);
    color: #b45309;
    border-color: rgba(217, 119, 6, 0.3);
}

body.light-theme .cp-tin-badge:hover {
    background: rgba(217, 119, 6, 0.2);
}

body.light-theme .cp-phone-link {
    color: #0284c7;
}

body.light-theme .cp-action-btn {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #475569;
}

body.light-theme .cp-action-btn.view:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: #3b82f6;
    color: #2563eb;
}

body.light-theme .cp-action-btn.edit:hover {
    background: rgba(245, 158, 11, 0.1);
    border-color: #d97706;
    color: #d97706;
}

body.light-theme .cp-action-btn.delete:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #dc2626;
    color: #dc2626;
}

body.light-theme .cp-empty-title {
    color: #0f172a;
}

body.light-theme .cp-empty-desc {
    color: #64748b;
}

/* Modal theme polish for counterparties */
body.light-theme #cpModal .modal,
body.light-theme #cpDetailsModal .modal {
    background: #ffffff;
    color: #0f172a;
    border-color: #cbd5e1;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

body.light-theme #cpModalTitle,
body.light-theme #cpDetailsName {
    color: #0f172a !important;
}

body.light-theme #cpInfoSection {
    background: #f8fafc !important;
    border-bottom-color: #e2e8f0 !important;
}

body.light-theme #cpInfoSection>div>div {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
}

body.light-theme #cpDetailsType,
body.light-theme #cpDetailsPhone,
body.light-theme #cpDetailsAddress,
body.light-theme #cpDetailsBankInfo {
    color: #0f172a !important;
}

body.light-theme .cp-credit-pill {
    background: #eef2ff !important;
    color: #4f46e5 !important;
    border-color: #c7d2fe !important;
}

body.light-theme .cp-credit-pill:hover {
    background: #e0e7ff !important;
}

body.light-theme .cp-credit-pill-add {
    background: #f1f5f9 !important;
    color: #64748b !important;
    border-color: #cbd5e1 !important;
}

body.light-theme .cp-credit-pill-add:hover {
    background: #e0f2fe !important;
    color: #0284c7 !important;
    border-color: #7dd3fc !important;
}

/* ================================================================ */
/* CASH REGISTER REPORT MODAL (CASHBOX MODAL) - STUNNING THEME STYLES */
/* ================================================================ */

/* Common / Dark Mode Base Enhancements */
#cashRegisterModal .cash-kpi-card {
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.22s, border-color 0.22s;
}

#cashRegisterModal .cash-kpi-card:hover {
    transform: translateY(-2px);
}

#cashRegisterModal .cash-kpi-card .cash-kpi-title {
    letter-spacing: 0.5px;
}

#cashRegisterModal #cashReportCounted {
    transition: border-color 0.2s, box-shadow 0.2s;
}

/* LIGHT THEME: Ultra-Clean, High-Contrast, Premium Styling */
body.light-theme #cashRegisterModal .modal {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.04) !important;
}

body.light-theme #cashRegisterModal .cash-report-modal-header {
    background: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

body.light-theme #cashRegisterModal .cash-report-modal-title {
    color: #0f172a !important;
    font-weight: 800 !important;
}

body.light-theme #cashRegisterModal .cash-report-modal-sub {
    color: #64748b !important;
}

body.light-theme #cashRegisterModal .cash-report-close-btn {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #64748b !important;
}

body.light-theme #cashRegisterModal .cash-report-close-btn:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    border-color: #94a3b8 !important;
}

/* Filter Bar */
body.light-theme #cashRegisterModal .cash-report-filter-bar {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03) !important;
}

body.light-theme #cashRegisterModal .cash-report-filter-label {
    color: #334155 !important;
    font-weight: 700 !important;
}

body.light-theme #cashRegisterModal .cash-report-sep {
    color: #94a3b8 !important;
}

body.light-theme #cashRegisterModal .cash-report-filter-bar .btn.btn-secondary {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #334155 !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
}

body.light-theme #cashRegisterModal .cash-report-filter-bar .btn.btn-secondary:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    border-color: #94a3b8 !important;
}

body.light-theme #cashRegisterModal .cash-report-filter-bar input.inp,
body.light-theme #cashRegisterModal .cash-report-filter-bar select.inp {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03) !important;
}

body.light-theme #cashRegisterModal .cash-report-filter-bar input.inp:focus,
body.light-theme #cashRegisterModal .cash-report-filter-bar select.inp:focus {
    border-color: #4f46e5 !important;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12) !important;
}

/* ================================================================ */
/* 4 KPI Cards in Light Theme */
/* ================================================================ */

/* Card 1: Կանխիկի հաշվեկշիռ (Balance - Amber/Gold) */
body.light-theme #cashRegisterModal .cash-kpi-card.kpi-balance {
    background: linear-gradient(145deg, #ffffff 0%, #fffdfa 45%, #fef8eb 100%) !important;
    border: 1px solid #fed7aa !important;
    box-shadow: 0 4px 14px -2px rgba(217, 119, 6, 0.1), 0 2px 5px -1px rgba(0, 0, 0, 0.03) !important;
}

body.light-theme #cashRegisterModal .cash-kpi-card.kpi-balance:hover {
    border-color: #f59e0b !important;
    box-shadow: 0 8px 20px -3px rgba(217, 119, 6, 0.18) !important;
}

body.light-theme #cashRegisterModal .kpi-balance .cash-kpi-glow {
    background: radial-gradient(circle, rgba(245, 158, 11, 0.15) 0%, transparent 70%) !important;
}

body.light-theme #cashRegisterModal .kpi-balance .cash-kpi-title {
    color: #b45309 !important;
}

body.light-theme #cashRegisterModal .kpi-balance .cash-kpi-badge {
    background: #fef3c7 !important;
    color: #b45309 !important;
    border: 1px solid #fde68a !important;
}

body.light-theme #cashRegisterModal .kpi-balance .cash-kpi-label {
    color: #64748b !important;
}

body.light-theme #cashRegisterModal #cashReportExpected {
    color: #b45309 !important;
    text-shadow: 0 1px 1px rgba(180, 83, 9, 0.1);
}

body.light-theme #cashRegisterModal .kpi-balance .cash-kpi-divider-box {
    border-top: 1px solid #fed7aa !important;
}

body.light-theme #cashRegisterModal #cashReportCounted {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}

body.light-theme #cashRegisterModal #cashReportCounted:focus {
    border-color: #d97706 !important;
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.15) !important;
}

body.light-theme #cashRegisterModal #cashReportDiffBadge {
    background: #f1f5f9 !important;
    color: #475569 !important;
    border: 1px solid #e2e8f0 !important;
}

/* Card 2: Կանխիկ մուտքեր (Inflow - Emerald) */
body.light-theme #cashRegisterModal .cash-kpi-card.kpi-inflow {
    background: linear-gradient(145deg, #ffffff 0%, #fafdfb 45%, #f0fdf4 100%) !important;
    border: 1px solid #bbf7d0 !important;
    box-shadow: 0 4px 14px -2px rgba(16, 185, 129, 0.1), 0 2px 5px -1px rgba(0, 0, 0, 0.03) !important;
}

body.light-theme #cashRegisterModal .cash-kpi-card.kpi-inflow:hover {
    border-color: #10b981 !important;
    box-shadow: 0 8px 20px -3px rgba(16, 185, 129, 0.18) !important;
}

body.light-theme #cashRegisterModal .kpi-inflow .cash-kpi-title {
    color: #047857 !important;
}

body.light-theme #cashRegisterModal .kpi-inflow .cash-kpi-badge {
    background: #dcfce7 !important;
    color: #047857 !important;
    border: 1px solid #bbf7d0 !important;
}

body.light-theme #cashRegisterModal .kpi-inflow .cash-kpi-label {
    color: #64748b !important;
}

body.light-theme #cashRegisterModal #cashReportCash,
body.light-theme #cashRegisterModal #cashReportDebtClearanceCash,
body.light-theme #cashRegisterModal #cashReportCbInflow {
    color: #059669 !important;
    font-weight: 700 !important;
}

body.light-theme #cashRegisterModal .kpi-inflow .cash-kpi-divider-box {
    border-top: 1px solid #bbf7d0 !important;
}

body.light-theme #cashRegisterModal .kpi-inflow .cash-kpi-total-label {
    color: #334155 !important;
    font-weight: 700 !important;
}

body.light-theme #cashRegisterModal #cashReportTotalInflow {
    color: #047857 !important;
    font-weight: 800 !important;
}

/* Card 3: Կանխիկ ելքեր (Outflow - Red/Rose) */
body.light-theme #cashRegisterModal .cash-kpi-card.kpi-outflow {
    background: linear-gradient(145deg, #ffffff 0%, #fffbfb 45%, #fef2f2 100%) !important;
    border: 1px solid #fecaca !important;
    box-shadow: 0 4px 14px -2px rgba(239, 68, 68, 0.1), 0 2px 5px -1px rgba(0, 0, 0, 0.03) !important;
}

body.light-theme #cashRegisterModal .cash-kpi-card.kpi-outflow:hover {
    border-color: #ef4444 !important;
    box-shadow: 0 8px 20px -3px rgba(239, 68, 68, 0.18) !important;
}

body.light-theme #cashRegisterModal .kpi-outflow .cash-kpi-title {
    color: #b91c1c !important;
}

body.light-theme #cashRegisterModal .kpi-outflow .cash-kpi-badge {
    background: #fee2e2 !important;
    color: #b91c1c !important;
    border: 1px solid #fecaca !important;
}

body.light-theme #cashRegisterModal .kpi-outflow .cash-kpi-label {
    color: #64748b !important;
}

body.light-theme #cashRegisterModal #cashReportRefundCash,
body.light-theme #cashRegisterModal #cashReportCbOutflow,
body.light-theme #cashRegisterModal #cashReportRefunds {
    color: #dc2626 !important;
    font-weight: 700 !important;
}

body.light-theme #cashRegisterModal .kpi-outflow .cash-kpi-divider-box {
    border-top: 1px solid #fecaca !important;
}

body.light-theme #cashRegisterModal .kpi-outflow .cash-kpi-total-label {
    color: #334155 !important;
    font-weight: 700 !important;
}

body.light-theme #cashRegisterModal #cashReportTotalOutflow {
    color: #b91c1c !important;
    font-weight: 800 !important;
}

/* Card 4: Անկանխիկ և հասույթ (Turnover - Royal Blue) */
body.light-theme #cashRegisterModal .cash-kpi-card.kpi-turnover {
    background: linear-gradient(145deg, #ffffff 0%, #fafcff 45%, #eff6ff 100%) !important;
    border: 1px solid #bfdbfe !important;
    box-shadow: 0 4px 14px -2px rgba(59, 130, 246, 0.1), 0 2px 5px -1px rgba(0, 0, 0, 0.03) !important;
}

body.light-theme #cashRegisterModal .cash-kpi-card.kpi-turnover:hover {
    border-color: #3b82f6 !important;
    box-shadow: 0 8px 20px -3px rgba(59, 130, 246, 0.18) !important;
}

body.light-theme #cashRegisterModal .kpi-turnover .cash-kpi-title {
    color: #1d4ed8 !important;
}

body.light-theme #cashRegisterModal .kpi-turnover .cash-kpi-badge {
    background: #dbeafe !important;
    color: #1d4ed8 !important;
    border: 1px solid #bfdbfe !important;
}

body.light-theme #cashRegisterModal .kpi-turnover .cash-kpi-label {
    color: #64748b !important;
}

body.light-theme #cashRegisterModal #cashReportCard,
body.light-theme #cashRegisterModal #cashReportTransfer {
    color: #2563eb !important;
    font-weight: 700 !important;
}

body.light-theme #cashRegisterModal #cashReportCredit {
    color: #b45309 !important;
    font-weight: 700 !important;
}

body.light-theme #cashRegisterModal #cashReportDiscounts {
    color: #b45309 !important;
    font-weight: 700 !important;
}

body.light-theme #cashRegisterModal #cashReportCounts {
    color: #0f172a !important;
    font-weight: 700 !important;
}

body.light-theme #cashRegisterModal .kpi-turnover .cash-kpi-divider-box {
    border-top: 1px solid #bfdbfe !important;
}

body.light-theme #cashRegisterModal .kpi-turnover .cash-kpi-total-label {
    color: #334155 !important;
    font-weight: 700 !important;
}

body.light-theme #cashRegisterModal #cashReportTotalRevenue {
    color: #1d4ed8 !important;
    font-weight: 800 !important;
}

/* ================================================================ */
/* Lower Table Breakdown Container in Light Theme */
/* ================================================================ */
body.light-theme #cashRegisterModal .cash-report-table-box {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

body.light-theme #cashRegisterModal .cash-report-tabs-bar {
    background: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

body.light-theme #cashRegisterModal .cash-report-tabs .btn.btn-secondary {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #475569 !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03) !important;
}

body.light-theme #cashRegisterModal .cash-report-tabs .btn.btn-secondary:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    border-color: #94a3b8 !important;
}

body.light-theme #cashRegisterModal .cash-report-tabs .btn.btn-primary.active {
    background: #4f46e5 !important;
    border-color: #4338ca !important;
    color: #ffffff !important;
    box-shadow: 0 3px 8px rgba(79, 70, 229, 0.25) !important;
}

body.light-theme #cashRegisterModal .cash-report-tabs .btn.btn-secondary span[id^="cashReportBadge"] {
    background: #e2e8f0 !important;
    color: #334155 !important;
}

body.light-theme #cashRegisterModal .cash-report-tabs .btn.btn-primary.active span[id^="cashReportBadge"] {
    background: rgba(255, 255, 255, 0.25) !important;
    color: #ffffff !important;
}

body.light-theme #cashRegisterModal #cashReportSearchInput {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}

body.light-theme #cashRegisterModal #cashReportSearchInput:focus {
    border-color: #4f46e5 !important;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15) !important;
}

/* Tables inside modal in Light Theme */
body.light-theme #cashRegisterModal table.tbl thead tr {
    background: #f1f5f9 !important;
}

body.light-theme #cashRegisterModal table.tbl thead th {
    color: #334155 !important;
    font-weight: 700 !important;
    border-bottom: 2px solid #e2e8f0 !important;
}

body.light-theme #cashRegisterModal table.tbl tbody tr {
    border-bottom: 1px solid #f1f5f9 !important;
}

body.light-theme #cashRegisterModal table.tbl tbody tr:hover {
    background: #f8fafc !important;
}

body.light-theme #cashRegisterModal table.tbl tbody td {
    color: #1e293b !important;
}

body.light-theme #cashRegisterModal table.tbl tbody td[style*="color:var(--text-muted"],
body.light-theme #cashRegisterModal table.tbl tbody td[style*="color: var(--text-muted"] {
    color: #64748b !important;
}

/* Modal Footer */
body.light-theme #cashRegisterModal .cash-report-modal-footer {
    background: #f8fafc !important;
    border-top: 1px solid #e2e8f0 !important;
}

body.light-theme #cashRegisterModal .cash-report-modal-footer .btn-secondary {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #334155 !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
}

body.light-theme #cashRegisterModal .cash-report-modal-footer .btn-secondary:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    border-color: #94a3b8 !important;
}

body.light-theme #cashRegisterModal .cash-report-modal-footer .btn-outline {
    background: transparent !important;
    border: 1px solid #cbd5e1 !important;
    color: #475569 !important;
}

body.light-theme #cashRegisterModal .cash-report-modal-footer .btn-outline:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
}

/* ================================================================ */
/* Cash Logs History Modal Light Theme Overrides */
/* ================================================================ */
body.light-theme #cashLogsModal .modal {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.18) !important;
}

body.light-theme #cashLogsModal .cash-logs-modal-header {
    border-bottom: 1px solid #e2e8f0 !important;
}

body.light-theme #cashLogsModal .cash-logs-modal-header div {
    color: #0f172a !important;
}

body.light-theme #cashLogsModal table.tbl thead tr {
    background: #f1f5f9 !important;
    border-bottom: 2px solid #e2e8f0 !important;
}

body.light-theme #cashLogsModal table.tbl thead th {
    color: #334155 !important;
}

body.light-theme #cashLogsModal table.tbl tbody tr:hover {
    background: #f8fafc !important;
}

body.light-theme #cashLogsModal table.tbl tbody td {
    color: #1e293b !important;
}

/* Inventory audit picker and count-entry workspace */
.inventory-filter-grid {
    grid-template-columns: minmax(0, 1fr) minmax(200px, 260px) !important;
    align-items: start;
}

.inventory-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.inventory-filter-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.inventory-filter-heading .field-label {
    margin: 0;
}

.inventory-filter-shortcuts {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #64748b;
    font-size: .76rem;
}

.inventory-text-btn {
    padding: 2px 0;
    border: 0;
    background: transparent;
    color: #818cf8;
    font: inherit;
    cursor: pointer;
}

.inventory-text-btn:hover {
    color: #a5b4fc;
    text-decoration: underline;
}

.inventory-search-input {
    width: 100%;
    margin: 8px 0;
}

.inventory-category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    max-height: 112px;
    overflow: auto;
    padding: 9px;
    border: 1px solid #293449;
    border-radius: 10px;
    background: #0a0f1e;
}

.inventory-category-option {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 10px;
    border: 1px solid #2a3448;
    border-radius: 999px;
    background: #111827;
    color: #cbd5e1;
    cursor: pointer;
    font-size: .78rem;
    line-height: 1.2;
    transition: background .15s, border-color .15s, color .15s;
}

.inventory-category-option:hover {
    border-color: #6366f1;
}

.inventory-category-option.selected {
    border-color: #6366f1;
    background: rgba(99, 102, 241, .18);
    color: #e0e7ff;
}

.inventory-category-option input {
    accent-color: #6366f1;
    margin: 0;
}

.inventory-category-option[hidden] {
    display: none;
}

.inventory-results-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 0 2px;
}

.inventory-results-toolbar>input {
    flex: 1 1 280px;
    min-width: 190px;
}

.inventory-results-toolbar>select {
    flex: 0 1 190px;
}

.inventory-summary-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-left: auto;
}

.inventory-summary-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 9px;
    border: 1px solid #293449;
    border-radius: 999px;
    background: #111827;
    color: #cbd5e1;
    font-size: .72rem;
    white-space: nowrap;
}

.inventory-summary-chip b {
    color: #f8fafc;
}

.inventory-summary-alert b {
    color: #fbbf24;
}

.inventory-empty-row {
    padding: 28px 16px;
    text-align: center;
    color: #94a3b8;
}

.inventory-product-row[hidden] {
    display: none;
}

.inventory-product-row:hover {
    background: rgba(99, 102, 241, .07);
}

.inventory-actual-input {
    width: 112px;
    text-align: center;
    font-weight: 700;
}

.inventory-audit-table {
    min-width: 1350px;
    table-layout: fixed;
}

.inventory-audit-table thead th {
    white-space: normal;
    vertical-align: middle;
}

.inventory-audit-table tbody td {
    white-space: normal;
    vertical-align: middle;
    overflow-wrap: anywhere;
}

.inventory-audit-table tbody td:nth-child(1) {
    width: 170px;
}

.inventory-audit-table tbody td:nth-child(2) {
    width: 130px;
    font-family: monospace;
    color: #a5b4fc;
}

.inventory-audit-table tbody td:nth-child(3) {
    width: 320px;
    min-width: 320px;
    color: #f1f5f9;
    font-weight: 600;
    line-height: 1.45;
}

.inventory-audit-table tbody td:nth-child(4) {
    width: 90px;
    text-align: center;
}

.inventory-audit-table tbody td:nth-child(5) {
    width: 150px;
    text-align: center;
}

.inventory-audit-table tbody td:nth-child(6) {
    width: 130px;
    text-align: center;
}

.inventory-audit-table tbody td:nth-child(7) {
    width: 230px;
    min-width: 200px;
}

.inventory-audit-table tbody td:nth-child(8) {
    width: 110px;
    text-align: center;
}

.inventory-comment-input {
    width: 100%;
    min-width: 180px;
}

.inventory-match-control {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    cursor: pointer;
    white-space: nowrap;
    color: #94a3b8;
    font-size: .75rem;
}

.inventory-match-checkbox {
    width: 17px;
    height: 17px;
    accent-color: #10b981;
    cursor: pointer;
}

.inventory-match-checkbox:checked+span {
    color: #10b981;
    font-weight: 700;
}

.inventory-history-modal {
    width: min(1400px, 95vw);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.inventory-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid #293449;
}

.inventory-history-title {
    color: #f8fafc;
    font-size: 1.05rem;
    font-weight: 700;
}

.inventory-history-subtitle {
    margin-top: 4px;
    color: #94a3b8;
    font-size: .78rem;
}

.inventory-history-body {
    flex: 1;
    overflow: auto;
    padding: 16px 20px;
}

.inventory-history-loading,
.inventory-history-empty {
    padding: 30px 12px;
    color: #94a3b8;
    text-align: center;
}

.inventory-history-list {
    display: grid;
    gap: 9px;
}

.inventory-history-card {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto auto;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border: 1px solid #293449;
    border-radius: 10px;
    background: #111827;
}

.inventory-history-card-main {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.inventory-history-card-main strong {
    color: #e2e8f0;
}

.inventory-history-card-main span,
.inventory-history-detail-head span {
    color: #94a3b8;
    font-size: .76rem;
}

.inventory-history-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: #94a3b8;
    font-size: .72rem;
}

.inventory-history-metrics b {
    color: #e2e8f0;
}

.inventory-history-detail-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.inventory-history-detail-head>div {
    display: grid;
    gap: 4px;
}

.inventory-history-table-wrap {
    overflow: auto;
    border: 1px solid #293449;
    border-radius: 8px;
}

body.light-theme .inventory-history-header {
    border-color: #d9e1ec;
}

body.light-theme .inventory-history-title {
    color: #1e293b;
}

body.light-theme .inventory-history-subtitle,
body.light-theme .inventory-history-loading,
body.light-theme .inventory-history-empty,
body.light-theme .inventory-history-card-main span,
body.light-theme .inventory-history-detail-head span {
    color: #64748b;
}

body.light-theme .inventory-history-card {
    background: #fff;
    border-color: #d9e1ec;
}

body.light-theme .inventory-history-card-main strong,
body.light-theme .inventory-history-metrics b {
    color: #1e293b;
}

body.light-theme .inventory-history-metrics {
    color: #64748b;
}

body.light-theme .inventory-history-table-wrap {
    border-color: #d9e1ec;
}

body.light-theme .inventory-category-list {
    background: #f8fafc;
    border-color: #d9e1ec;
}

body.light-theme .inventory-category-option {
    background: #fff;
    border-color: #d9e1ec;
    color: #334155;
}

body.light-theme .inventory-category-option.selected {
    background: #eef2ff;
    border-color: #6366f1;
    color: #3730a3;
}

body.light-theme .inventory-summary-chip {
    background: #fff;
    border-color: #d9e1ec;
    color: #475569;
}

body.light-theme .inventory-summary-chip b {
    color: #1e293b;
}

body.light-theme .inventory-empty-row {
    color: #64748b;
}

body.light-theme .inventory-product-row:hover {
    background: #f1f5ff;
}

body.light-theme .inventory-audit-table tbody td:nth-child(1) {
    color: #64748b !important;
}

body.light-theme .inventory-audit-table tbody td:nth-child(2) {
    color: #4338ca !important;
}

body.light-theme .inventory-audit-table tbody td:nth-child(3) {
    color: #1e293b !important;
}

body.light-theme .inventory-audit-table tbody td:nth-child(4) {
    color: #047857 !important;
}

body.light-theme .inventory-audit-table tbody td:nth-child(6) {
    color: #334155;
}

body.light-theme .inventory-match-control {
    color: #64748b;
}

@media (max-width: 900px) {
    .inventory-filter-grid {
        grid-template-columns: 1fr !important;
    }

    #auditInventorySection>.card:first-child {
        grid-template-columns: 1fr !important;
    }

    .inventory-actions {
        justify-content: flex-start;
    }

    .inventory-results-toolbar>select {
        flex: 1 1 180px;
    }

    .inventory-summary-chips {
        margin-left: 0;
    }

    .inventory-history-card {
        grid-template-columns: 1fr auto;
    }

    .inventory-history-metrics {
        grid-column: 1 / -1;
        grid-row: 2;
    }
}