:root {
            --brand: #0050a8; /* Moka Blue */
            --brand-2: #0061c9; /* Lighter Moka Blue */
        }

        html,
        body {
            font-family: 'Inter', system-ui, sans-serif;
            background: #f1f5f9; /* Slate 100 agar lebih kuat dan kontras dengan kartu */
            color: #0f172a;
            transition: font-size 0.15s ease-out;
        }

        /* Font Preset Cards in Appearance Settings */
        .font-preset-card {
            transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        }
        .font-preset-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(14, 165, 233, 0.12);
        }
        .font-preset-card.active {
            border-color: #0284c7 !important;
            background-color: #f0f9ff !important;
            color: #0369a1 !important;
            box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.18) !important;
        }

        .glass {
            background: #ffffff; /* Header putih solid */
            border-bottom: 1px solid rgba(0, 80, 168, 0.15); /* Border senada dengan sidebar */
            border-right: 1px solid rgba(0, 80, 168, 0.15);
        }
        
        /* SIDEBAR GELAP */
        #sidebar {
    position: relative;
            background: #0050a8; /* Moka Blue sedikit lebih gelap */
            border-right: none;
            color: #ffffff;
        }

        #sidebar h1, #sidebar p, #sidebar span, #sidebar button {
            color: #ffffff !important;
        }
        
        #sidebar svg:not([fill="currentColor"]) {
            stroke: #ffffff !important;
        }

        #sidebar .text-slate-500,
        #sidebar .text-slate-400 {
            color: rgba(255, 255, 255, 0.6) !important;
        }

        #sidebar .border-slate-200\/70,
        #sidebar .border-slate-200\/60 {
            border-color: rgba(255, 255, 255, 0.1) !important;
        }

        .brand-grad {
            background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%);
        }

        .brand-grad-soft {
            background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
        }

        .neon-glow:hover {
            box-shadow: 0 0 0 1px rgba(14, 165, 233, .12), 0 6px 14px -10px rgba(14, 165, 233, .22);
        }

        .btn-press {
            transition: all .25s ease
        }

        .btn-press:hover {
            transform: translateY(-1px)
        }

        .btn-press:active {
            transform: scale(.97)
        }

        .scroll-thin::-webkit-scrollbar {
            width: 6px;
            height: 6px
        }

        .scroll-thin::-webkit-scrollbar-thumb {
            background: #cbd5e1;
            border-radius: 999px
        }

        .scroll-thin::-webkit-scrollbar-track {
            background: transparent
        }

        .page {
            display: none;
        }

        .page.active {
            display: block;
            animation: pageSlideUpFade 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
        }

        @keyframes pageSlideUpFade {
            from {
                opacity: 0;
                transform: translateY(8px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        @supports (view-transition-name: none) {
            ::view-transition-old(root) {
                animation: 160ms cubic-bezier(0.4, 0, 1, 1) both vtFadeOut;
            }
            ::view-transition-new(root) {
                animation: 220ms cubic-bezier(0, 0, 0.2, 1) both vtFadeIn;
            }
        }

        @keyframes vtFadeOut {
            from { opacity: 1; transform: scale(1); }
            to { opacity: 0; transform: scale(0.995); }
        }

        @keyframes vtFadeIn {
            from { opacity: 0; transform: translateY(4px); }
            to { opacity: 1; transform: translateY(0); }
        }

        .pulse-dot {
            animation: pulse 1.6s infinite
        }

        @keyframes pulse {

            0%,
            100% {
                opacity: 1
            }

            50% {
                opacity: .4
            }
        }

        .nav-item {
            transition: all .2s ease
        }

        .nav-item:hover {
            background: rgba(14, 165, 233, .08);
            color: #0ea5e9;
        }

        .nav-item.active {
            background: linear-gradient(90deg, rgba(14, 165, 233, .15), rgba(14, 165, 233, .02));
            color: #0ea5e9;
            font-weight: 400 !important;
            text-shadow: none;
            box-shadow: none;
        }

        .nav-item.active .nav-icon {
            color: #0ea5e9;
        }

        /* Sidebar Nav Item Overrides */
        #sidebar .nav-item:hover {
            background: rgba(255, 255, 255, 0.1) !important;
            color: #ffffff !important;
        }

        #sidebar .nav-item.active {
            background: rgba(255, 255, 255, 0.15) !important;
            color: #ffffff !important;
            font-weight: 500 !important;
            text-shadow: none !important;
            box-shadow: none !important;
        }

        #sidebar .nav-item.active .nav-icon {
            color: #38bdf8 !important; /* Sky 400 */
        }

        .submenu {
            max-height: 0;
            overflow: hidden;
            transition: max-height .3s ease
        }

        .submenu.open {
            max-height: 400px
        }

        .tab-active {
            color: #0284c7;
            border-color: #0284c7
        }

        .product-card {
            transition: all .25s ease
        }

        .product-card:hover {
            transform: translateY(-3px);
            box-shadow: 0 12px 28px -12px rgba(14, 165, 233, .35)
        }

        .stat-card {
            transition: all .3s ease;
            box-shadow: 0 4px 24px -6px rgba(0, 80, 168, 0.08); /* Glow dark blue tipis (static) */
        }

        .stat-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 12px 32px -8px rgba(0, 80, 168, 0.25); /* Glow lebih kuat saat hover */
        }

        .badge {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 2px 10px;
            border-radius: 999px;
            font-size: 11px;
            font-weight: 600
        }

        input:focus,
        select:focus,
        textarea:focus {
            outline: none;
            box-shadow: 0 0 0 3px rgba(14, 165, 233, .18);
            border-color: #0ea5e9
        }

        .sync-online {
            background: #dcfce7;
            color: #15803d
        }

        .sync-offline {
            background: #fef3c7;
            color: #b45309
        }

        .sync-syncing {
            background: #dbeafe;
            color: #1d4ed8
        }

        .divider-dot {
            width: 3px;
            height: 3px;
            border-radius: 999px;
            background: #cbd5e1
        }

        .mobile-nav-btn.active {
            color: var(--brand);
        }

        .border-brand { border-color: var(--brand) !important; }
        .text-brand { color: var(--brand) !important; }

/* Fix table word wrap in transfer menu */
#transferTableBody td {
    white-space: nowrap;
}

/* Accounting reports */
.accounting-page {
    color: #1e293b;
}

.accounting-toolbar {
    display: flex;
    min-height: 54px;
    padding: 7px;
    align-items: center;
    gap: 10px;
    border: 1px solid #dbe3ec;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

.accounting-period-control {
    display: inline-grid;
    grid-template-columns: repeat(4, auto);
    padding: 3px;
    gap: 2px;
    border: 1px solid #dbe3ec;
    border-radius: 6px;
    background: #f8fafc;
}

.accounting-period-control button {
    min-width: 84px;
    height: 34px;
    padding: 0 12px;
    border: 0;
    border-radius: 4px;
    color: #64748b;
    background: transparent;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

.accounting-period-control button:hover {
    color: #075985;
    background: #e0f2fe;
}

.accounting-period-control button.active {
    color: #fff;
    background: #075985;
    box-shadow: 0 1px 2px rgba(7, 89, 133, .2);
}

.accounting-custom-range {
    display: none;
    align-items: center;
    gap: 7px;
    color: #64748b;
    font-size: 11px;
}

.accounting-custom-range.is-visible {
    display: flex;
}

.accounting-custom-range input,
.accounting-account-filter select {
    height: 40px;
    min-width: 138px;
    padding: 0 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    outline: none;
    color: #334155;
    background: #fff;
    font-size: 11px;
}

.accounting-custom-range input:focus,
.accounting-account-filter select:focus {
    border-color: #0284c7;
    box-shadow: 0 0 0 2px rgba(2, 132, 199, .1);
}

.accounting-account-filter {
    display: flex;
    margin-left: auto;
    align-items: center;
    gap: 8px;
    color: #64748b;
    font-size: 11px;
    font-weight: 600;
}

.accounting-account-filter select {
    min-width: 205px;
}

.accounting-print-btn {
    display: inline-flex;
    height: 40px;
    margin-left: auto;
    padding: 0 13px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    color: #334155;
    background: #fff;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.accounting-account-filter + .accounting-print-btn {
    margin-left: 0;
}

.accounting-print-btn:hover {
    border-color: #94a3b8;
    background: #f8fafc;
}

.accounting-print-btn svg {
    width: 16px;
    height: 16px;
}

#addManualJournalBtn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
}

.journal-month-filter {
    display: inline-flex;
    height: 40px;
    padding: 0 10px;
    align-items: center;
    gap: 8px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    color: #64748b;
    background: #fff;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.journal-month-filter:focus-within {
    border-color: #0284c7;
    box-shadow: 0 0 0 2px rgba(2, 132, 199, .1);
}

.journal-month-filter input {
    width: 128px;
    border: 0;
    outline: 0;
    color: #334155;
    background: transparent;
    font-size: 11px;
}

.journal-filter-toolbar {
    display: flex;
    min-height: 58px;
    padding: 9px 10px;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid #dbe3ec;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

.journal-filter-fields,
.journal-filter-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.journal-filter-fields {
    flex: 1 1 auto;
    min-width: 0;
}

.journal-search-field {
    display: flex;
    width: min(100%, 360px);
    min-width: 230px;
    height: 38px;
    padding: 0 11px;
    align-items: center;
    gap: 8px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    color: #64748b;
    background: #fff;
}

.journal-search-field:focus-within {
    border-color: #0284c7;
    box-shadow: 0 0 0 2px rgba(2, 132, 199, .1);
}

.journal-search-field svg,
.journal-reset-btn svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

.journal-search-field input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    color: #334155;
    background: transparent;
    font-size: 12px;
}

.journal-search-field input::placeholder {
    color: #94a3b8;
}

.journal-filter-toolbar select {
    height: 38px;
    min-width: 144px;
    padding: 0 30px 0 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    outline: 0;
    color: #334155;
    background: #fff;
    font-size: 12px;
}

.journal-filter-toolbar select:focus {
    border-color: #0284c7;
    box-shadow: 0 0 0 2px rgba(2, 132, 199, .1);
}

#journalPageSize {
    min-width: 106px;
}

.journal-reset-btn {
    display: inline-flex;
    height: 38px;
    padding: 0 12px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid #fecdd3;
    border-radius: 8px;
    color: #be123c;
    background: #fff1f2;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.journal-reset-btn:hover {
    border-color: #fda4af;
    background: #ffe4e6;
}

.accounting-pagination {
    min-height: 54px;
    border-top: 1px solid #e2e8f0;
    background: #fff;
}

.accounting-pagination .table-page-btn {
    min-width: 84px;
    height: 34px;
    border-radius: 6px;
}

.accounting-sheet {
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .05);
    overflow: hidden;
}

.accounting-report-header {
    display: flex;
    min-height: 104px;
    padding: 22px 24px;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    border-bottom: 2px solid #1e3a5f;
}

.accounting-report-kicker {
    color: #075985;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.accounting-report-header h3 {
    margin-top: 3px;
    color: #0f172a;
    font-size: 19px;
    font-weight: 700;
    line-height: 1.25;
}

.accounting-report-period {
    margin-top: 5px;
    color: #64748b;
    font-size: 11px;
}

.accounting-report-meta,
.accounting-ledger-account {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    color: #64748b;
    font-size: 10px;
    text-align: right;
    text-transform: uppercase;
}

.accounting-report-meta strong {
    color: #0f172a;
    font-size: 12px;
}

.accounting-ledger-account span {
    color: #64748b;
    font-size: 9px;
}

.accounting-ledger-account strong {
    max-width: 260px;
    color: #0f172a;
    font-size: 15px;
    line-height: 1.3;
    text-transform: none;
}

.accounting-reconciliation {
    display: grid;
    grid-template-columns: repeat(3, minmax(130px, 1fr)) auto;
    align-items: stretch;
    border-bottom: 1px solid #dbe3ec;
    background: #f8fafc;
}

.accounting-reconciliation > div {
    display: flex;
    min-height: 62px;
    padding: 10px 18px;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    border-right: 1px solid #dbe3ec;
}

.accounting-reconciliation span,
.accounting-summary-grid span,
.accounting-kpi-grid span {
    color: #64748b;
    font-size: 10px;
    font-weight: 600;
}

.accounting-reconciliation strong,
.accounting-summary-grid strong,
.accounting-kpi-grid strong {
    color: #0f172a;
    font-size: 13px;
    line-height: 1.45;
    font-weight: 700;
    white-space: nowrap;
}

.accounting-status {
    display: inline-flex;
    min-width: 112px;
    margin: 14px 18px;
    padding: 0 12px;
    align-items: center;
    justify-content: center;
    border: 1px solid;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
}

.accounting-status.is-balanced {
    border-color: #a7f3d0;
    color: #047857;
    background: #ecfdf5;
}

.accounting-status.is-unbalanced {
    border-color: #fecdd3;
    color: #be123c;
    background: #fff1f2;
}

.accounting-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.accounting-table {
    width: 100%;
    min-width: 840px;
    border-collapse: collapse;
    color: #334155;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.45;
}

.accounting-table th {
    height: 48px;
    padding: 0 24px;
    border-bottom: 1px solid #e0f2fe;
    color: #075985;
    background: rgba(240, 249, 255, .5);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.25;
    letter-spacing: .04em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.accounting-table td {
    min-height: 48px;
    padding: 14px 24px;
    border-bottom: 1px solid #f1f5f9;
    font-weight: 400;
    vertical-align: middle;
}

.accounting-table tbody tr:hover {
    background: rgba(240, 249, 255, .4);
}

.accounting-table tbody tr.is-entry-start td {
    border-top: 1px solid #e2e8f0;
}

.accounting-table tbody tr:first-child td {
    border-top: 0;
}

.accounting-table .numeric {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.accounting-table .date-cell {
    width: 118px;
    color: #64748b;
    font-size: 13px;
    white-space: nowrap;
}

.accounting-table .reference-cell {
    width: 160px;
    color: #334155;
    font-size: 12px;
    font-weight: 400;
    white-space: nowrap;
}

.accounting-table .description-cell {
    min-width: 210px;
    color: #64748b;
    font-size: 13px;
}

.accounting-table .account-cell {
    min-width: 190px;
    color: #0f172a;
    font-size: 13px;
    font-weight: 400;
}

.accounting-table .account-cell.is-credit {
    padding-left: 38px;
}

.accounting-table .balance-cell {
    color: #0f172a;
    font-weight: 400;
}

.accounting-table tfoot td {
    height: 50px;
    border-top: 2px solid #1e3a5f;
    border-bottom: 0;
    color: #0f172a;
    background: #f8fafc;
    font-size: 13px;
    font-weight: 500;
}

.accounting-table tfoot td:first-child {
    text-align: right;
}

.accounting-empty {
    height: 112px !important;
    color: #64748b;
    text-align: center;
    vertical-align: middle !important;
}

.accounting-summary-grid,
.accounting-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-bottom: 1px solid #dbe3ec;
    background: #f8fafc;
}

.accounting-summary-grid > div,
.accounting-kpi-grid > div {
    display: flex;
    min-height: 70px;
    padding: 12px 18px;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    border-right: 1px solid #dbe3ec;
}

.accounting-summary-grid > div:last-child,
.accounting-kpi-grid > div:last-child {
    border-right: 0;
}

.accounting-summary-grid > div.is-primary,
.accounting-kpi-grid > div.is-primary {
    background: #e8f3f7;
}

.accounting-summary-grid > div.is-primary strong,
.accounting-kpi-grid > div.is-primary strong {
    color: #075985;
}

.accounting-kpi-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .04);
    overflow: hidden;
}

.accounting-kpi-grid > div {
    min-height: 78px;
}

.accounting-kpi-grid strong {
    font-size: 15px;
}

.accounting-pnl-sheet .accounting-report-header {
    min-height: 116px;
}

.pnl-statement {
    padding: 12px 24px 22px;
}

.pnl-section-label {
    margin-top: 12px;
    padding: 8px 0 6px;
    border-bottom: 1px solid #cbd5e1;
    color: #475569;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
}

.pnl-line,
.pnl-margin {
    display: grid;
    min-height: 39px;
    grid-template-columns: minmax(0, 1fr) minmax(150px, auto);
    align-items: center;
    gap: 20px;
    color: #334155;
    font-size: 11px;
}

.pnl-line strong,
.pnl-margin strong {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.pnl-line.is-detail {
    padding-left: 18px;
    color: #64748b;
}

.pnl-line.is-subtotal {
    margin-top: 2px;
    border-top: 1px solid #94a3b8;
    border-bottom: 1px solid #cbd5e1;
    color: #0f172a;
    font-weight: 700;
}

.pnl-line.is-gross {
    color: #047857;
    background: #f0fdf4;
}

.pnl-line.is-net {
    min-height: 54px;
    margin-top: 18px;
    border-top: 2px solid #1e3a5f;
    border-bottom: 3px double #1e3a5f;
    color: #0f172a;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
}

.pnl-margin {
    min-height: 36px;
    color: #64748b;
    font-size: 10px;
}

.pnl-margin strong,
.is-profit {
    color: #047857 !important;
}

.is-loss {
    color: #be123c !important;
}

@media (max-width: 1100px) {
    .accounting-toolbar {
        flex-wrap: wrap;
    }

    .accounting-account-filter {
        margin-left: 0;
    }

    .journal-filter-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .journal-filter-fields {
        flex-wrap: wrap;
    }

    .journal-filter-actions {
        justify-content: flex-end;
    }

}

@media (max-width: 767px) {
    .accounting-toolbar {
        padding: 8px;
        align-items: stretch;
    }

    .accounting-period-control {
        width: 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .accounting-period-control button {
        width: 100%;
        min-width: 0;
    }

    .accounting-custom-range.is-visible {
        display: grid;
        width: 100%;
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    }

    .accounting-custom-range input {
        width: 100%;
        min-width: 0;
    }

    .accounting-account-filter {
        width: 100%;
        justify-content: space-between;
    }

    .accounting-account-filter select {
        width: min(72%, 260px);
        min-width: 0;
    }

    .accounting-print-btn,
    #addManualJournalBtn {
        width: 100%;
        margin-left: 0;
        justify-content: center !important;
        text-align: center !important;
    }

    .journal-month-filter {
        width: 100%;
        justify-content: space-between;
    }

    .journal-month-filter input {
        width: min(68%, 180px);
    }

    .journal-filter-toolbar {
        padding: 10px;
    }

    .journal-filter-fields {
        display: grid;
        width: 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .journal-search-field {
        width: 100%;
        min-width: 0;
        grid-column: 1 / -1;
    }

    .journal-filter-toolbar select {
        width: 100%;
        min-width: 0;
    }

    .journal-filter-actions {
        display: grid;
        width: 100%;
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .accounting-pagination > div {
        align-items: stretch;
        flex-direction: column;
    }

    .accounting-pagination > div > div {
        justify-content: space-between;
    }

    .accounting-report-header {
        min-height: 94px;
        padding: 18px 16px;
        gap: 14px;
    }

    .accounting-report-header h3 {
        font-size: 17px;
    }

    .accounting-report-meta,
    .accounting-ledger-account {
        max-width: 46%;
    }

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

    .accounting-reconciliation > div {
        min-height: 58px;
        padding: 9px 10px;
    }

    .accounting-reconciliation strong,
    .accounting-summary-grid strong {
        font-size: 12px;
    }

    .accounting-status {
        min-height: 34px;
        grid-column: 1 / -1;
        margin: 9px 10px;
    }

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

    .accounting-summary-grid > div,
    .accounting-kpi-grid > div {
        min-height: 66px;
        padding: 10px 12px;
        border-bottom: 1px solid #dbe3ec;
    }

    .accounting-kpi-grid > div.is-primary {
        grid-column: 1 / -1;
    }

    .pnl-statement {
        padding: 10px 16px 18px;
    }

    .pnl-line,
    .pnl-margin {
        grid-template-columns: minmax(0, 1fr) minmax(118px, auto);
        gap: 12px;
    }

}

@media print {
    @page {
        size: A4 landscape;
        margin: 12mm;
    }

    body {
        background: #fff !important;
    }

    #sidebar,
    .app-header,
    .mobile-bottom-nav,
    .mobile-more-overlay,
    .mobile-more-menu,
    .accounting-toolbar,
    .journal-filter-toolbar,
    .accounting-pagination,
    .accounting-kpi-grid,
    #appTopProgress,
    .page-loading-overlay,
    .app-boot-loader {
        display: none !important;
    }

    .app-content {
        padding: 0 !important;
        overflow: visible !important;
    }

    .page:not(.active) {
        display: none !important;
    }

    .accounting-page.active {
        display: block !important;
    }

    .accounting-sheet {
        border: 0;
        border-radius: 0;
        box-shadow: none;
        overflow: visible;
    }

    .accounting-table-wrap {
        overflow: visible;
    }

    .accounting-table {
        min-width: 0;
        font-size: 9px;
    }

    .accounting-table th,
    .accounting-table td {
        padding-right: 9px;
        padding-left: 9px;
    }

}
#transferTableBody td:nth-child(2) {
    white-space: normal;
}

/* Fix thead wrap for transfer menu */
#transferTableBody preceeding-sibling thead th {
    white-space: nowrap;
}
/* Consistent table typography for inventory menus and dashboard activity. */
#page-inv-products table,
#page-inv-in table,
#page-inv-transfer table,
#page-inv-out table,
#page-dashboard .recent-panel table {
    font-size: 13px;
    line-height: 1.45;
}

#page-inv-products thead th,
#page-inv-in thead th,
#page-inv-transfer thead th,
#page-inv-out thead th,
#page-dashboard .recent-panel thead th {
    font-size: 11px !important;
    line-height: 1.25;
    font-weight: 700;
    letter-spacing: .04em;
    white-space: nowrap;
}

#page-inv-products tbody td,
#page-inv-in tbody td,
#page-inv-transfer tbody td,
#page-inv-out tbody td,
#page-dashboard .recent-panel tbody td {
    font-size: 13px !important;
    line-height: 1.45;
    vertical-align: middle;
}

#page-inv-products tbody td > span,
#page-inv-in tbody td > span,
#page-inv-transfer tbody td > span,
#page-inv-out tbody td > span,
#page-dashboard .recent-panel tbody td > span {
    line-height: 1.25;
}

/* Dashboard and navigation polish */
:root {
    --surface: rgba(255, 255, 255, .88);
    --surface-strong: #ffffff;
    --ink-soft: #475569;
    --line-soft: rgba(15, 23, 42, .08);
    --menu-blue: #00448f;
    --menu-blue-2: #0066c9;
}

html,
body {
    background:
        radial-gradient(circle at top left, rgba(14, 165, 233, .16), transparent 28rem),
        linear-gradient(180deg, #f8fbff 0%, #eef4f9 46%, #f7fafc 100%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(15, 23, 42, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 23, 42, .03) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(180deg, rgba(0,0,0,.72), transparent 62%);
}

.glass {
    background: rgba(255, 255, 255, .86);
    backdrop-filter: blur(18px);
    box-shadow: 0 12px 34px rgba(15, 23, 42, .04);
}

#sidebar {
    position: relative;
    background: #0050a8 !important;
    box-shadow: none !important;
    width: 68px;
    min-width: 68px;
    transition: width 0.28s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s ease;
    overflow-x: hidden;
    display: flex !important;
    flex-direction: column;
    z-index: 35;
}

#sidebar::before,
#sidebar::after {
    content: none !important;
    display: none !important;
}

#sidebar > * {
    position: relative;
    z-index: 1;
}

#sidebar nav {
    overflow-x: hidden;
    overflow-y: auto;
    padding-left: 8px;
    padding-right: 8px;
    transition: padding 0.25s ease;
}

/* Brand header */
#sidebar .sidebar-brand {
    height: 76px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: padding 0.25s ease;
    overflow: hidden;
    white-space: nowrap;
    cursor: pointer;
}

#sidebar .sidebar-logo {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    flex-shrink: 0;
}

#sidebar .sidebar-brand-text {
    opacity: 0;
    max-width: 0;
    transform: translateX(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease, max-width 0.28s ease;
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
}

/* Section titles */
#sidebar .sidebar-section-title {
    opacity: 0;
    max-height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    transition: opacity 0.2s ease, max-height 0.25s ease, margin 0.25s ease, padding 0.25s ease;
    white-space: nowrap;
}

/* Nav items */
#sidebar .nav-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    min-height: 44px;
    padding-left: 0;
    padding-right: 0;
    border-radius: 12px;
    border: 1px solid transparent;
    color: rgba(255, 255, 255, .86) !important;
    overflow: hidden;
    white-space: nowrap;
    transition: all 0.2s ease;
    cursor: pointer;
    width: 100%;
}

#sidebar .nav-icon {
    width: 22px !important;
    height: 22px !important;
    flex-shrink: 0 !important;
    display: block !important;
    margin: 0 auto;
    transition: margin 0.2s ease, color 0.2s ease;
}

#sidebar .nav-label {
    display: none;
    opacity: 0;
    max-width: 0;
    transform: translateX(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, max-width 0.28s ease;
    white-space: nowrap;
    overflow: hidden;
    pointer-events: none;
}

#sidebar .submenu-arrow {
    display: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

#sidebar .nav-item:hover {
    background: rgba(255, 255, 255, .08) !important;
    border-color: rgba(255, 255, 255, .10);
    transform: none;
}

#sidebar .nav-item.active {
    background: rgba(255, 255, 255, .15) !important;
    border-color: rgba(255, 255, 255, .12);
    box-shadow: none !important;
    font-weight: 500 !important;
}

#sidebar .nav-item.active .nav-icon {
    color: #38bdf8 !important;
    stroke: #38bdf8 !important;
}

/* Submenu collapsed */
#sidebar .submenu {
    max-height: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    border-left: none !important;
    transition: all 0.25s ease;
}

#sidebar .submenu .nav-item {
    min-height: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 12px;
    color: rgba(255, 255, 255, .82) !important;
}

#sidebar .submenu-nested {
    margin-left: 6px;
    padding-left: 8px;
    border-left-color: rgba(255, 255, 255, .10);
}

#sidebar .submenu-nested .nav-item {
    min-height: 32px;
    height: 32px;
    font-size: 11px;
}

/* Sidebar footer toggle */
#sidebar .sidebar-footer {
    padding: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.08);
    transition: padding 0.25s ease;
}

#sidebar .sidebar-footer-btn {
    width: 100%;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
}

#sidebar .sidebar-footer-btn:hover {
    background: rgba(255, 255, 255, 0.18);
}

#sidebar .sidebar-footer-text {
    display: none;
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: opacity 0.2s ease, max-width 0.28s ease;
}

/* =========================================================
   WHEN SIDEBAR IS EXPANDED (.is-expanded)
   ========================================================= */
#sidebar.is-expanded {
    width: 256px !important;
    min-width: 256px !important;
}

#sidebar.is-expanded nav {
    padding-left: 12px;
    padding-right: 12px;
}

#sidebar.is-expanded .sidebar-brand {
    padding: 0 18px;
}

#sidebar.is-expanded .sidebar-brand-text {
    opacity: 1;
    max-width: 180px;
    transform: translateX(0);
    pointer-events: auto;
}

#sidebar.is-expanded .sidebar-section-title {
    opacity: 1;
    max-height: 36px;
    padding: 12px 12px 6px 12px;
}

#sidebar.is-expanded .nav-item {
    padding-left: 12px;
    padding-right: 12px;
    justify-content: flex-start;
    gap: 12px;
}

#sidebar.is-expanded .nav-icon {
    margin: 0 !important;
}

#sidebar.is-expanded .nav-label {
    display: block;
    opacity: 1;
    max-width: 200px;
    transform: translateX(0);
    pointer-events: auto;
}

#sidebar.is-expanded .submenu-arrow {
    display: block;
    opacity: 1;
    margin-left: auto;
}

#sidebar.is-expanded .submenu.open {
    max-height: 500px !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    border-left: 1px solid rgba(255, 255, 255, 0.16) !important;
    margin-left: 18px !important;
    padding-left: 10px !important;
    margin-top: 4px !important;
    margin-bottom: 4px !important;
}

#sidebar.is-expanded .submenu .nav-item {
    justify-content: flex-start;
    padding-left: 10px;
    padding-right: 10px;
}

#sidebar.is-expanded .sidebar-footer {
    padding: 12px 14px;
}

#sidebar.is-expanded .sidebar-footer-text {
    display: inline-block;
    opacity: 1;
    max-width: 140px;
}

header.glass {
    border-bottom-color: rgba(0, 80, 168, .12);
}

#pageTitle {
    letter-spacing: 0;
}

#syncBadge,
#manualSyncBtn,
header button {
    box-shadow: none;
}


.metric-card,
.dashboard-panel {
    background: rgba(255,255,255,.9) !important;
    border-color: rgba(255,255,255,.88) !important;
    box-shadow: 0 18px 44px rgba(15, 23, 42, .075) !important;
    backdrop-filter: blur(14px);
}

.metric-card {
    position: relative;
    overflow: hidden;
    min-height: 166px;
}

.metric-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, #0ea5e9, #22c55e);
}

.metric-card:nth-child(2)::before { background: linear-gradient(90deg, #6366f1, #0ea5e9); }
.metric-card:nth-child(3)::before { background: linear-gradient(90deg, #f59e0b, #22c55e); }
.metric-card:nth-child(4)::before { background: linear-gradient(90deg, #f43f5e, #f59e0b); }

.metric-card:hover,
.dashboard-panel:hover {
    transform: translateY(-2px);
    box-shadow: 0 24px 58px rgba(0, 80, 168, .14) !important;
}

.dashboard-metric-icon {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 10px 22px rgba(15, 23, 42, .14);
}

.metric-icon-sales { background: #0ea5e9; }
.metric-icon-transactions { background: #6366f1; }
.metric-icon-stock { background: #f59e0b; }
.metric-icon-expired { background: #f43f5e; }

.dashboard-metric-icon svg {
    width: 23px;
    height: 23px;
}


.inventory-toolbar {
    flex-wrap: nowrap;
}

.inventory-toolbar-filters {
    flex: 1 1 auto;
    min-width: 0;
}

.inventory-toolbar-filters input[type="text"] {
    width: clamp(150px, 18vw, 230px);
    min-width: 0;
}

.inventory-toolbar-filters select {
    min-width: 0;
    max-width: 155px;
}

.inventory-toolbar-actions {
    flex: 0 0 auto;
    flex-wrap: nowrap;
    gap: 6px;
}

.inventory-toolbar-actions button {
    min-height: 36px;
    padding: 7px 10px !important;
    border-radius: 10px;
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
}

.inventory-toolbar-actions button svg {
    width: 15px;
    height: 15px;
}

.report-toolbar {
    padding: 14px 18px;
    border-bottom: 1px solid #f1f5f9;
    background: #fff;
}

.report-toolbar-filters {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
}

.report-toolbar-filters input[type="text"],
.report-toolbar-filters > div {
    flex: 1 1 0% !important;
    min-width: 0 !important;
    width: 100% !important;
}

.report-toolbar-filters select {
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 120px !important;
    max-width: 155px !important;
    white-space: nowrap !important;
    height: 38px !important;
}

@media (min-width: 640px) {
    .report-toolbar-filters {
        width: auto !important;
        justify-content: flex-end !important;
    }
    .report-toolbar-filters > div,
    .report-toolbar-filters input[type="text"] {
        width: 16rem !important;
        flex: none !important;
    }
}
.metric-card .text-2xl {
    font-size: 1.68rem;
    letter-spacing: 0;
}

.dashboard-panel {
    border-radius: 24px !important;
}

.revenue-panel {
    min-height: 374px;
}

.revenue-panel .h-64 {
    height: 282px;
}

.alerts-panel #dashboardAlerts > div,
#dashboardAlerts > div {
    border-radius: 16px !important;
    box-shadow: 0 10px 22px rgba(15, 23, 42, .045);
}

.recent-panel thead {
    background: linear-gradient(180deg, rgba(248, 250, 252, .92), rgba(241, 245, 249, .86));
}

.recent-panel tbody tr {
    transition: background .18s ease, transform .18s ease;
}

.recent-panel tbody tr:hover {
    background: rgba(14, 165, 233, .055) !important;
}

.mobile-nav-btn {
    border-radius: 18px;
    min-width: 48px;
}

.mobile-nav-btn.active {
    background: rgba(0, 80, 168, .08);
    box-shadow: inset 0 0 0 1px rgba(0, 80, 168, .08);
}

@media (max-width: 768px) {
    .inventory-toolbar:not(.report-toolbar) {
        align-items: stretch;
        flex-wrap: wrap;
    }

    .inventory-toolbar:not(.report-toolbar) .inventory-toolbar-filters {
        width: 100%;
        flex-wrap: wrap;
    }

    .inventory-toolbar:not(.report-toolbar) .inventory-toolbar-filters input[type="text"] {
        width: 100%;
        flex: 1 0 100%;
    }

    .inventory-toolbar:not(.report-toolbar) .inventory-toolbar-filters select {
        flex: 1 1 130px;
        max-width: none;
    }

    .inventory-toolbar-actions {
        width: 100%;
    }

    .inventory-toolbar-actions button {
        flex: 1 1 0;
        justify-content: center;
    }


    .metric-card {
        min-height: 142px;
    }
}



/* Sidebar dibuat flat dan dirender tanpa compositing blur. */
#sidebar {
    background: #0050a8 !important;
    box-shadow: none !important;
    filter: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

#sidebar::before,
#sidebar::after {
    content: none !important;
    display: none !important;
}

#sidebar .nav-item,
#sidebar .nav-item:hover,
#sidebar .nav-item.active,
#sidebar .brand-grad {
    box-shadow: none !important;
    filter: none !important;
    text-shadow: none !important;
}

#sidebar .nav-item:hover {
    transform: none !important;
}

#sidebar .submenu .nav-item {
    color: rgba(255, 255, 255, .92) !important;
    font-weight: 400 !important;
}

@media (min-width: 1024px) {
    #sidebar {
        transform: none !important;
        transition: width 0.28s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }
}


/* Dashboard: informasi utama, aksi cepat, dan panel operasional. */
.dashboard-shell {
    max-width: 1440px;
    margin-inline: auto;
}

.dashboard-utility-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #dce7f1;
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .045);
}

.dashboard-today,
.dashboard-quick-actions,
.dashboard-action {
    display: flex;
    align-items: center;
}

.dashboard-today { gap: 11px; }
.dashboard-quick-actions { gap: 8px; }

.dashboard-live-dot {
    width: 10px;
    height: 10px;
    flex: 0 0 10px;
    border-radius: 50%;
    background: #16a34a;
    box-shadow: 0 0 0 4px #dcfce7;
}

.dashboard-date-label {
    color: #0f172a;
    font-size: 13px;
    line-height: 1.25;
    font-weight: 700;
}

.dashboard-data-note {
    margin-top: 2px;
    color: #64748b;
    font-size: 11px;
}

.dashboard-action {
    justify-content: center;
    gap: 7px;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 11px;
    border: 1px solid transparent;
    font-size: 12px;
    font-weight: 650;
    transition: background .18s ease, border-color .18s ease, color .18s ease;
}

.dashboard-action svg { width: 16px; height: 16px; }

.dashboard-action-secondary {
    color: #334155;
    background: #f8fafc;
    border-color: #e2e8f0;
}

.dashboard-action-secondary:hover {
    color: #0050a8;
    background: #eff6ff;
    border-color: #bfdbfe;
}

.dashboard-action-primary {
    color: #fff;
    background: #0050a8;
    border-color: #0050a8;
}

.dashboard-action-primary:hover { background: #003f86; }

.dashboard-metric-filter-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.dashboard-metric-filter-label {
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
}

#page-dashboard .metric-card,
#page-dashboard .dashboard-panel {
    background: #fff !important;
    border: 1px solid #dce7f1 !important;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .055) !important;
    backdrop-filter: none;
}

#page-dashboard .metric-card {
    min-height: 90px;
    padding: 16px 18px !important;
    border-radius: 14px !important;
    overflow: hidden;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

#page-dashboard .metric-card:nth-child(1) {
    background: linear-gradient(110deg, #f2fffd 0%, #ffffff 78%) !important;
    border-color: #99f6e4 !important;
}

#page-dashboard .metric-card:nth-child(2) {
    background: linear-gradient(110deg, #f5f8ff 0%, #ffffff 78%) !important;
    border-color: #bfdbfe !important;
}

#page-dashboard .metric-card:nth-child(3) {
    background: linear-gradient(110deg, #fff8eb 0%, #ffffff 78%) !important;
    border-color: #fed7aa !important;
}

#page-dashboard .metric-card:nth-child(4) {
    background: linear-gradient(110deg, #f8f6ff 0%, #ffffff 78%) !important;
    border-color: #ddd6fe !important;
}

#page-dashboard .metric-card:hover,
#page-dashboard .dashboard-panel:hover {
    transform: none;
    border-color: #c5d8e8 !important;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .07) !important;
}

#page-dashboard .metric-card::before {
    content: none;
}

.metric-card-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-width: 0;
}

.metric-card-copy {
    min-width: 0;
}

.metric-card-label {
    color: #334155;
    font-size: 11px;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.metric-card-value {
    margin-top: 6px;
    color: #001b44;
    font-size: 17px;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: 0;
}

.metric-card-note {
    margin-top: 4px;
    color: #64748b;
    font-size: 11px;
    line-height: 1.35;
    font-weight: 500;
}

.metric-inline-badge {
    margin-left: 6px;
    color: #0f766e;
    font-weight: 800;
    white-space: nowrap;
}

#page-dashboard .metric-card:nth-child(3) .metric-inline-badge { color: #b45309; }
#page-dashboard .metric-card:nth-child(4) .metric-inline-badge { color: #7c3aed; }

#page-dashboard .dashboard-metric-icon {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 10px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .12);
}

#page-dashboard .dashboard-metric-icon svg {
    width: 19px;
    height: 19px;
}

#page-dashboard .metric-icon-sales { background: #14b8a6; }
#page-dashboard .metric-icon-transactions { background: #3b82f6; }
#page-dashboard .metric-icon-stock { background: #f59e0b; }
#page-dashboard .metric-icon-expired { background: #8b5cf6; }
.dashboard-period-badge,
.dashboard-range-chip {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 0 9px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #f8fafc;
    color: #64748b;
    font-size: 10px;
    font-weight: 650;
}

.dashboard-section-kicker {
    margin-bottom: 3px;
    color: #0284c7;
    font-size: 9px;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: .12em;
}

.dashboard-range-control {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px;
    border: 1px solid #dbe7f3;
    border-radius: 10px;
    background: #f8fafc;
}

.dashboard-range-btn {
    min-width: 68px;
    height: 29px;
    padding: 0 12px;
    border-radius: 8px;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}

.dashboard-range-btn:hover {
    color: #075985;
    background: #e0f2fe;
}

.dashboard-range-btn.active {
    color: #075985;
    background: #ffffff;
    box-shadow: 0 1px 4px rgba(15, 23, 42, .08);
}

.dashboard-panel-value {
    margin-top: 5px;
    color: #0f172a;
    font-size: 22px;
    line-height: 1.2;
    font-weight: 750;
    letter-spacing: 0;
}

.revenue-heading-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.revenue-heading .dashboard-section-kicker {
    margin-bottom: 4px;
    color: #047857;
    font-size: 9px;
    letter-spacing: .1em;
}

#dashboardRevenueTitle {
    color: #0f172a;
    font-size: 14px;
    line-height: 1.25;
    font-weight: 750;
}

.revenue-heading .dashboard-panel-value {
    display: inline-flex;
    align-items: center;
    margin-top: 7px;
    padding: 3px 10px;
    border: 1px solid #bbf7d0;
    border-radius: 999px;
    background: #ecfdf5;
    color: #047857;
    font-size: 17px;
    line-height: 1.15;
    font-weight: 800;
}

.dashboard-text-action {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 11px;
    border: 1px solid #dbeafe;
    border-radius: 10px;
    background: #eff6ff;
    color: #0369a1;
    font-size: 11px;
    font-weight: 700;
}

.dashboard-text-action:hover { background: #dbeafe; }

#page-dashboard .alerts-panel #dashboardAlerts > div {
    box-shadow: none;
    border-radius: 13px !important;
}

#page-dashboard .recent-panel thead { background: #f8fafc; }
#page-dashboard .recent-panel tbody tr:hover { background: #f8fbff !important; }
#page-dashboard .recent-table-scroll {
    max-height: 292px;
    overflow: auto;
    overscroll-behavior: contain;
}

#page-dashboard .recent-table-scroll thead {
    position: sticky;
    top: 0;
    z-index: 1;
}

#page-dashboard .recent-table-scroll tbody tr {
    height: 48px;
}

@media (max-width: 767px) {
    html {
        font-size: 14px;
    }

    body {
        font-size: 13px;
        line-height: 1.45;
    }

    /* Headings on mobile */
    h1 { font-size: 1.3rem !important; }
    h2 { font-size: 1.15rem !important; }
    h3 { font-size: 1.02rem !important; }
    h4 { font-size: 0.92rem !important; }

    .dashboard-utility-bar {
        align-items: stretch;
        flex-direction: column;
        gap: 8px;
    }

    .dashboard-today {
        gap: 8px;
    }

    .dashboard-date-label {
        font-size: 13px !important;
        font-weight: 700;
    }

    .dashboard-quick-actions {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 6px !important;
        width: 100% !important;
    }

    .dashboard-action {
        height: 36px !important;
        padding-inline: 4px !important;
        font-size: 10.5px !important;
        font-weight: 600 !important;
        border-radius: 10px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 4px !important;
        white-space: nowrap !important;
    }

    .dashboard-action svg {
        width: 14px !important;
        height: 14px !important;
        flex-shrink: 0 !important;
    }

    .dashboard-panel-heading { flex-direction: column; }
    .dashboard-metric-filter-bar {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }
    .dashboard-metric-filter-label {
        font-size: 10.5px !important;
    }
    .dashboard-range-control {
        align-self: stretch;
        display: flex !important;
        gap: 2px !important;
    }
    .dashboard-range-btn {
        flex: 1 1 0 !important;
        min-width: 0 !important;
        height: 30px !important;
        padding-inline: 4px !important;
        font-size: 10.5px !important;
        border-radius: 6px !important;
    }
    .dashboard-data-note { display: none; }

    /* Compact metric cards on mobile */
    .metric-card {
        padding: 12px 14px !important;
        min-height: 96px !important;
        border-radius: 14px !important;
    }
    .metric-card-value { font-size: 18px !important; }
    .metric-card-label { font-size: 11px !important; }
    .metric-card-note { font-size: 9.5px !important; }

    /* Dashboard tables: horizontal scroll on mobile */
    .recent-table-scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .recent-table-scroll table { min-width: 480px; }
    .recent-table-scroll th,
    .recent-table-scroll td {
        white-space: nowrap;
        font-size: 10.5px !important;
        padding: 7px 9px !important;
    }

    /* Dashboard shell compact spacing */
    .dashboard-shell { gap: 10px !important; }
    .dashboard-shell > * + * { margin-top: 0 !important; }
}

@media (max-width: 420px) {
    html { font-size: 13.5px; }
    .dashboard-quick-actions { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
    .metric-card { min-height: 90px !important; }
}
/* POS layout: keep both panels on one baseline and scroll only their content. */
#page-pos.pos-page {
    min-height: 0;
}

.pos-workspace {
    grid-template-columns: minmax(0, 1fr) 380px;
    height: clamp(430px, calc(100dvh - 156px), 640px);
    min-height: 0;
    align-items: stretch;
}

.pos-products-panel,
.pos-cart-panel {
    width: 100%;
    height: 100%;
    min-height: 0;
}

.pos-products-scroll,
#cartItems {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    flex: 1 1 auto;
}

.pos-mobile-cart-toggle,
.pos-mobile-cart-close,
.pos-mobile-cart-backdrop {
    display: none;
}

.pos-mobile-cart-toggle,
.pos-mobile-cart-close {
    position: relative;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border: 1px solid #bae6fd;
    border-radius: 12px;
    background: #f0f9ff;
    color: #0284c7;
}

.pos-mobile-cart-toggle svg,
.pos-mobile-cart-close svg {
    width: 18px;
    height: 18px;
}

.pos-mobile-cart-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding-inline: 4px;
    border: 2px solid #fff;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 14px;
    text-align: center;
}

@media (min-width: 768px) and (max-width: 1023px) {
    .pos-workspace {
        grid-template-columns: minmax(0, 1fr) minmax(280px, 38%);
        height: calc(100dvh - 124px);
    }

    .pos-products-panel,
    .pos-cart-panel {
        height: 100%;
    }
}

@media (max-width: 767px) {
    .pos-workspace {
        grid-template-columns: minmax(0, 1fr);
        height: calc(100dvh - 122px);
        min-height: 300px;
    }

    .pos-products-panel {
        height: 100%;
        border-radius: 14px !important;
    }

    .pos-products-panel .p-5 {
        padding: 10px 12px !important;
    }

    #posSearch {
        height: 36px !important;
        font-size: 12px !important;
        padding-left: 32px !important;
        border-radius: 10px !important;
    }

    #toggleFilterBtn {
        width: 36px !important;
        height: 36px !important;
        border-radius: 10px !important;
        flex-shrink: 0 !important;
    }

    .pos-mobile-cart-toggle {
        display: flex;
        width: 36px !important;
        height: 36px !important;
        border-radius: 10px !important;
        flex-shrink: 0 !important;
    }

    .pos-mobile-cart-close {
        display: flex;
        width: 32px !important;
        height: 32px !important;
        border-radius: 8px !important;
    }

    .cat-btn {
        height: 28px !important;
        font-size: 11px !important;
        padding: 0 10px !important;
        border-radius: 8px !important;
    }

    .pos-mobile-cart-backdrop {
        display: block;
        position: fixed;
        inset: 56px 0 calc(56px + env(safe-area-inset-bottom, 0px)) 0;
        z-index: 44;
        border: 0;
        background: rgba(15, 23, 42, .42);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity .2s ease, visibility .2s ease;
    }

    .pos-mobile-cart-backdrop.is-open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .pos-cart-panel {
        position: fixed;
        inset: 56px 0 calc(56px + env(safe-area-inset-bottom, 0px)) 0;
        z-index: 45;
        width: 100%;
        height: auto;
        border-radius: 0;
        transform: translateX(100%);
        visibility: hidden;
        pointer-events: none;
        transition: transform .24s ease, visibility .24s ease;
    }

    .pos-cart-panel.is-open {
        transform: translateX(0);
        visibility: visible;
        pointer-events: auto;
    }

    .pos-cart-panel .p-5 {
        padding: 12px 14px !important;
    }

    .pos-cart-panel #cartItems {
        padding: 10px 12px 16px !important;
    }

    #checkoutBtn {
        height: 42px !important;
        font-size: 13px !important;
        font-weight: 700 !important;
        border-radius: 12px !important;
    }
}

/* Checkout modal: constrain the shell and keep long forms scrollable inside it. */
.checkout-modal { overscroll-behavior: contain; }
.checkout-modal-card { position: relative; max-height: min(720px, calc(100dvh - 32px)); min-height: 0; }
.checkout-modal-body { min-height: 0; max-height: min(520px, calc(100dvh - 176px)); scrollbar-width: thin; scrollbar-color: #bae6fd transparent; overscroll-behavior: contain; }
.checkout-modal-body::-webkit-scrollbar { width: 7px; }
.checkout-modal-body::-webkit-scrollbar-track { background: transparent; }
.checkout-modal-body::-webkit-scrollbar-thumb { background: #bae6fd; border-radius: 999px; }
.checkout-scroll-controls { position: absolute; right: 14px; bottom: 86px; z-index: 2; display: flex; flex-direction: column; gap: 6px; }
.checkout-scroll-btn { display: none; width: 30px; height: 30px; align-items: center; justify-content: center; border: 1px solid #dbeafe; border-radius: 999px; background: #fff; color: #0284c7; box-shadow: 0 4px 12px rgba(14, 116, 144, .12); }
.checkout-scroll-btn.is-visible { display: inline-flex; }
.checkout-scroll-btn:disabled { opacity: .35; cursor: default; }
.checkout-scroll-btn svg { width: 16px; height: 16px; }
@media (max-width: 640px) {
    .checkout-modal { align-items: flex-start; padding: 8px; }
    .checkout-modal-card {
        max-height: calc(100dvh - 16px);
        border-radius: 16px;
    }
    .checkout-modal-body {
        max-height: calc(100dvh - 156px);
        padding: 14px !important;
    }
    .checkout-modal-body .grid { gap: 8px !important; }
    .checkout-modal-body label { font-size: 11px; }
    .checkout-modal-body input,
    .checkout-modal-body select { font-size: 13px; padding: 8px 10px; }

    /* Receipt/pay modal on mobile */
    #payModal { padding: 8px; }
    #payModal > div {
        max-height: calc(100dvh - 16px);
        border-radius: 16px;
    }
    #payModal .p-6 { padding: 14px !important; }
    #payModal .p-4 { padding: 12px !important; }
}


/* Login: simple centered staff access. */
.login-page {
    min-width: 320px;
    background: #f1f5f9;
}

.login-shell {
    display: grid;
    place-items: center;
    padding: 24px 16px;
    background:
        linear-gradient(rgba(0, 80, 168, .025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 80, 168, .025) 1px, transparent 1px),
        linear-gradient(145deg, #eff6ff 0%, #f8fafc 55%, #e8f4fb 100%);
    background-size: 44px 44px, 44px 44px, 100% 100%;
}

.login-frame {
    width: min(100%, 350px);
    padding: 28px 22px 22px;
    border: 1px solid rgba(0, 80, 168, .12);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 20px 48px rgba(0, 80, 168, .14);
}

.login-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 24px;
    text-align: center;
}

.login-brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    margin-bottom: 12px;
    border-radius: 10px;
    color: #fff;
    background: linear-gradient(135deg, #0050a8 0%, #0ea5e9 100%);
    box-shadow: 0 8px 18px rgba(0, 80, 168, .2);
}

.login-brand-mark svg {
    width: 22px;
    height: 22px;
}

.login-brand h1 {
    color: #0050a8;
    font-size: 22px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: 0;
}

.login-form {
    display: grid;
    gap: 13px;
}

.login-field label {
    display: block;
    margin-bottom: 6px;
    color: #334155;
    font-size: 12px;
    line-height: 1.2;
    font-weight: 650;
}

.login-field input {
    width: 100%;
    height: 42px;
    padding: 0 13px;
    border: 2px solid #dbe4ec;
    border-radius: 7px;
    color: #1e293b;
    background: #f9fafb;
    font-size: 13px;
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.login-field input::placeholder {
    color: #8b929b;
}

.login-field input:focus {
    border-color: #0ea5e9;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, .14);
}

.login-show-password {
    display: inline-flex;
    align-items: center;
    justify-self: start;
    gap: 8px;
    min-height: 24px;
    color: #334155;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    user-select: none;
}

.login-show-password input {
    width: 14px;
    height: 14px;
    margin: 0;
    accent-color: #0050a8;
}

.login-error {
    padding: 9px 11px;
    border: 1px solid #fecdd3;
    border-radius: 7px;
    color: #be123c;
    background: #fff1f2;
    font-size: 11px;
    line-height: 1.4;
    font-weight: 600;
}

.login-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    min-height: 46px;
    margin-top: 1px;
    border-radius: 8px;
    color: #fff;
    background: linear-gradient(100deg, #0050a8 0%, #0ea5e9 100%);
    box-shadow: 0 6px 14px rgba(0, 80, 168, .12);
    font-size: 13px;
    line-height: 1;
    font-weight: 700;
}

.login-submit:hover {
    filter: brightness(1.04);
    box-shadow: 0 8px 16px rgba(0, 80, 168, .16);
}

.login-submit svg {
    width: 16px;
    height: 16px;
}

@media (max-width: 420px) {
    .login-shell {
        padding: 18px 14px;
    }

    .login-frame {
        padding: 25px 19px 20px;
        border-radius: 16px;
    }
}


/* Header account menu */
.header-account,
.header-account * {
    text-shadow: none !important;
}

.header-account .account-menu-btn,
.header-account .account-menu,
.header-account .account-menu button {
    box-shadow: none !important;
}

.header-account .account-menu-btn {
    font-size: 12px;
    line-height: 1;
}

.header-account .account-menu-btn[aria-expanded="true"] {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.header-account #accountUsername,
.header-account #accountMenuUsername,
.header-account #logoutBtn {
    font-size: 12px !important;
    line-height: 1.2;
}

@media (max-width: 420px) {
    .header-account .account-menu {
        right: -4px;
        width: min(16rem, calc(100vw - 24px));
    }
}
/* Report tables */
#page-report-transactions table,
#page-report-debts table {
    font-size: 13px;
    line-height: 1.45;
}

#page-report-transactions thead th,
#page-report-debts thead th {
    font-size: 11px !important;
    line-height: 1.25;
    font-weight: 400;
    letter-spacing: .04em;
    white-space: nowrap;
}

#page-report-transactions tbody td,
#page-report-debts tbody td {
    font-size: 13px !important;
    line-height: 1.45;
    vertical-align: middle;
}

.report-pagination,
.table-pagination {
    background: #fff;
}

.report-page-btn,
.table-page-btn,
.report-link-btn,
.report-pay-btn {
    border-radius: 8px;
    font-size: 12px;
    font-weight: 400;
    transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}

.report-page-btn,
.table-page-btn {
    padding: 7px 10px;
    border: 1px solid #e2e8f0;
    color: #475569;
    background: #fff;
}

.report-page-btn:hover:not(:disabled), .table-page-btn:hover:not(:disabled) { background: #f8fafc; }
.report-page-btn:disabled, .table-page-btn:disabled { opacity: .45; cursor: not-allowed; }
.report-link-btn { padding: 6px 9px; color: #0369a1; background: #f0f9ff; }
.report-link-btn:hover { background: #e0f2fe; }
.report-pay-btn { padding: 6px 9px; color: #047857; background: #ecfdf5; }
.report-pay-btn:hover { background: #d1fae5; }
.report-print-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    color: #0284c7;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color .18s ease, color .18s ease, border-color .18s ease, transform .12s ease;
}
.report-print-btn:hover {
    background: #e0f2fe;
    border-color: #7dd3fc;
    color: #0369a1;
}
.report-print-btn:active {
    transform: scale(0.97);
}
.report-delete-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    color: #e11d48;
    background: #fff1f2;
    border: 1px solid #fecdd3;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color .18s ease, color .18s ease, border-color .18s ease, transform .12s ease;
}
.report-delete-btn:hover {
    background: #ffe4e6;
    border-color: #fda4af;
    color: #be123c;
}
.report-delete-btn:active {
    transform: scale(0.97);
}









/* Responsive navigation: compact icon rail by default on tablet/desktop, expanded on click/toggle */
#sidebar {
    position: fixed !important;
    inset: 0 auto 0 0;
    width: 68px;
    height: 100dvh;
    display: flex !important;
}

#sidebar.is-expanded {
    width: min(82vw, 16rem) !important;
}

#sidebar nav {
    padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px));
}

#sidebarOverlay {
    backdrop-filter: blur(2px);
}

@media (max-width: 767px) {
    #sidebar,
    #sidebarOverlay {
        display: none !important;
    }

    header.glass {
        height: 56px;
        padding-left: 12px;
        padding-right: 12px;
    }

    /* Tighter header on mobile */
    .app-header-inner {
        gap: 8px !important;
    }

    .app-header-inner > div:last-child {
        gap: 6px !important;
    }

    #pageTitle {
        max-width: 44vw;
        font-size: 14px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    #pageSub {
        display: none;
    }

    /* Hide workspace badge, notification bell, and sync text on mobile */
    #workspaceModeBadge {
        display: none !important;
    }

    /* Smaller sync badge on mobile - icon only */
    #syncBadge {
        padding: 6px !important;
        border-radius: 12px !important;
    }
    #syncBadge #syncText {
        display: none;
    }

    /* Smaller buttons on mobile header */
    #manualSyncBtn {
        width: 34px;
        height: 34px;
    }

    /* Compact account button */
    .account-menu-btn {
        height: 34px !important;
        padding-left: 5px !important;
        padding-right: 5px !important;
        gap: 4px !important;
    }

    .account-menu-btn #accountAvatar {
        width: 26px;
        height: 26px;
        font-size: 10px;
    }

    .account-menu-btn > svg {
        display: none;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    #sidebar {
        position: sticky !important;
        transform: none !important;
        width: 68px !important;
        height: 100vh;
    }

    #sidebar.is-expanded {
        width: 16rem !important;
    }

    #sidebarOverlay {
        display: none !important;
    }
}

@media (min-width: 1024px) {
    #sidebar {
        position: sticky !important;
        transform: none !important;
        width: 68px !important;
        height: 100vh;
    }

    #sidebar.is-expanded {
        width: 16rem !important;
    }

    #sidebar nav {
        padding-bottom: 16px;
    }
}

/* Shared width rail: keep topbar content and page content aligned on tablet. */
.app-header {
    padding: 0 !important;
}

.app-header-inner,
.app-content {
    width: 100%;
    max-width: 1440px;
    margin-inline: auto;
}

.app-header-inner {
    padding-inline: 16px;
}

.app-content {
    padding-inline: 16px !important;
}

@media (min-width: 768px) {
    .app-header-inner {
        padding-inline: 24px;
    }

    .app-content {
        padding-inline: 24px !important;
    }
}

@media (max-width: 767px) {
    .app-header-inner {
        padding-inline: 14px;
    }

    .app-content {
        padding-inline: 14px !important;
    }
}

/* Tablet alignment: page panels use the same full-width rail as the header. */
@media (min-width: 768px) and (max-width: 1023px) {
    .app-content {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}

/* Hide header sidebar hamburger toggle on mobile & tablet since navigation is in bottom nav */
@media (max-width: 1023px) {
    #sidebarToggle {
        display: none !important;
    }
}

/* Mobile navigation: primary pages stay in the bottom bar; the rest use a bottom sheet. */
#mobileNav {
    min-height: calc(54px + env(safe-area-inset-bottom, 0px));
    height: calc(54px + env(safe-area-inset-bottom, 0px));
    padding: 3px 4px calc(3px + env(safe-area-inset-bottom, 0px));
}

#mobileNav .mobile-nav-btn {
    display: flex;
    flex: 1 1 20%;
    min-width: 0;
    height: 48px;
    padding: 3px 2px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border-radius: 8px;
    color: #64748b;
    font-size: 9.5px;
    font-weight: 600;
    line-height: 1.1;
}

#mobileNav .mobile-nav-btn svg {
    width: 19px;
    height: 19px;
    flex: 0 0 auto;
}

#mobileNav .mobile-nav-btn span {
    display: flex;
    width: 100%;
    min-height: 14px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    text-align: center;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.mobile-more-overlay,
.mobile-more-menu {
    display: none;
}

@media (max-width: 767px) {
    #sidebar,
    #sidebarOverlay {
        display: none !important;
    }

    .mobile-more-overlay {
        display: block;
        position: fixed;
        inset: 0 0 calc(54px + env(safe-area-inset-bottom, 0px)) 0;
        z-index: 47;
        border: 0;
        background: rgba(15, 23, 42, .42);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity .2s ease, visibility .2s ease;
    }

    .mobile-more-overlay.is-open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .mobile-more-menu {
        display: flex;
        position: fixed;
        right: 0;
        bottom: calc(54px + env(safe-area-inset-bottom, 0px));
        left: 0;
        z-index: 48;
        max-height: min(75dvh, 620px);
        flex-direction: column;
        overflow: hidden;
        border-top: 1px solid #e2e8f0;
        border-radius: 16px 16px 0 0;
        background: #fff;
        box-shadow: 0 -16px 40px rgba(15, 23, 42, .16);
        transform: translateY(100%);
        visibility: hidden;
        pointer-events: none;
        transition: transform .24s ease, visibility .24s ease;
    }

    .mobile-more-menu.is-open {
        transform: translateY(0);
        visibility: visible;
        pointer-events: auto;
    }

    .mobile-more-header {
        display: flex;
        min-height: 56px;
        padding: 12px 16px;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        border-bottom: 1px solid #e2e8f0;
        flex-shrink: 0;
        background: #fff;
    }

    .mobile-more-header h3 {
        color: #0f172a;
        font-size: 15px;
        font-weight: 600;
    }

    .mobile-more-header p {
        margin-top: 2px;
        color: #64748b;
        font-size: 11px;
    }

    .mobile-more-close {
        display: flex;
        width: 36px;
        height: 36px;
        flex: 0 0 auto;
        align-items: center;
        justify-content: center;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        color: #475569;
        background: #fff;
    }

    .mobile-more-close svg {
        width: 18px;
        height: 18px;
    }

    .mobile-more-scroll {
        flex: 1 1 auto;
        min-height: 0;
        display: block;
        padding: 8px 16px 28px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        touch-action: pan-y;
    }

    .mobile-more-scroll::-webkit-scrollbar {
        width: 4px;
    }

    .mobile-more-scroll::-webkit-scrollbar-track {
        background: transparent;
    }

    .mobile-more-scroll::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 9999px;
    }

    .mobile-more-group-title {
        padding: 12px 2px 7px;
        color: #64748b;
        font-size: 10px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }

    .mobile-more-list {
        border-top: 1px solid #e2e8f0;
    }

    .mobile-more-item {
        display: flex;
        width: 100%;
        min-height: 44px;
        padding: 10px 4px;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        border-bottom: 1px solid #e2e8f0;
        color: #334155;
        background: #fff;
        font-size: 13px;
        text-align: left;
        touch-action: pan-y;
    }

    .mobile-more-item > span:last-child {
        color: #94a3b8;
        font-size: 20px;
        line-height: 1;
    }

    .mobile-more-item.active {
        color: #0369a1;
        background: #f0f9ff;
    }
}
/* Inventory toolbars: one control language across desktop, tablet, and mobile. */
.inventory-toolbar:not(.report-toolbar) {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid #dbe5ee;
    border-radius: 8px;
    background: #fff;
}

.inventory-toolbar:not(.report-toolbar) .inventory-toolbar-filters {
    display: flex;
    min-width: 0;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.inventory-toolbar:not(.report-toolbar) .inventory-toolbar-filters input[type="text"],
.inventory-toolbar:not(.report-toolbar) .inventory-toolbar-filters select {
    height: 40px;
    min-width: 0;
    border-color: #cbd5e1;
    border-radius: 8px !important;
    background: #fff;
    font-size: 12px;
}

.inventory-toolbar:not(.report-toolbar) .inventory-toolbar-filters input[type="text"] {
    width: clamp(180px, 20vw, 260px);
}

.inventory-toolbar:not(.report-toolbar) .inventory-toolbar-filters select {
    max-width: 170px;
}

.inventory-toolbar:not(.report-toolbar) .inventory-toolbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.inventory-toolbar:not(.report-toolbar) .inventory-toolbar-actions .inventory-action-btn {
    display: inline-flex;
    min-width: 92px;
    height: 40px;
    padding: 0 13px !important;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid transparent;
    border-radius: 8px !important;
    box-shadow: none !important;
    font-size: 12px !important;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    transition: color .18s ease, background-color .18s ease, border-color .18s ease;
}

.inventory-toolbar:not(.report-toolbar) .inventory-toolbar-actions .inventory-action-btn svg {
    width: 16px !important;
    height: 16px !important;
    flex: 0 0 auto;
}

.inventory-action-import {
    border-color: #bae6fd !important;
    background: #f0f9ff !important;
    color: #0369a1 !important;
}

.inventory-action-import:hover {
    border-color: #7dd3fc !important;
    background: #e0f2fe !important;
}

.inventory-action-export {
    border-color: #a7f3d0 !important;
    background: #ecfdf5 !important;
    color: #047857 !important;
}

.inventory-action-export:hover {
    border-color: #6ee7b7 !important;
    background: #d1fae5 !important;
}

.inventory-action-primary {
    min-width: 132px;
    border-color: #0050a8 !important;
    background: #0050a8 !important;
    color: #fff !important;
}

.inventory-action-primary:hover {
    border-color: #003f86 !important;
    background: #003f86 !important;
}

.inventory-search-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1 1 240px;
    max-width: 320px;
    min-width: 200px;
}

.inventory-search-group input {
    flex: 1 1 auto;
    width: 100%;
}

.inventory-filter-reset {
    display: inline-flex;
    width: 38px;
    height: 38px;
    min-width: 38px;
    flex: 0 0 38px;
    padding: 0 !important;
    align-items: center;
    justify-content: center;
    border: 1px solid #fecdd3 !important;
    border-radius: 10px !important;
    background: #fff1f2 !important;
    color: #be123c !important;
    box-shadow: none !important;
    cursor: pointer;
    transition: color .18s ease, background-color .18s ease, border-color .18s ease, transform .15s ease;
}

.inventory-filter-reset:hover {
    border-color: #fda4af !important;
    background: #ffe4e6 !important;
    color: #9f1239 !important;
    transform: scale(1.04);
}

.inventory-filter-reset svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

@media (max-width: 1279px) {
    .inventory-toolbar:not(.report-toolbar) {
        grid-template-columns: minmax(0, 1fr);
    }

    .inventory-toolbar:not(.report-toolbar) .inventory-toolbar-filters {
        flex-wrap: wrap;
    }

    .inventory-search-group {
        flex: 1 1 240px;
        max-width: none;
    }

    .inventory-toolbar:not(.report-toolbar) .inventory-toolbar-filters select {
        flex: 1 1 140px;
        max-width: none;
    }

    .inventory-toolbar:not(.report-toolbar) .inventory-toolbar-actions {
        display: grid;
        width: 100%;
        grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    }

    .inventory-toolbar:not(.report-toolbar) .inventory-toolbar-actions .inventory-action-btn {
        width: 100%;
    }
}

@media (max-width: 767px) {
    .inventory-toolbar:not(.report-toolbar) {
        gap: 8px !important;
        padding: 10px !important;
        border-radius: 14px !important;
    }

    .inventory-toolbar:not(.report-toolbar) .inventory-toolbar-filters {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 6px !important;
        width: 100% !important;
    }

    .inventory-search-group {
        grid-column: 1 / -1 !important;
        width: 100% !important;
        max-width: none !important;
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
    }

    .inventory-search-group input[type="text"] {
        flex: 1 1 auto !important;
        width: 100% !important;
        height: 36px !important;
        font-size: 12px !important;
        padding: 0 10px !important;
        border-radius: 10px !important;
    }

    .inventory-filter-reset {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        flex: 0 0 36px !important;
        padding: 0 !important;
        border-radius: 10px !important;
        justify-content: center !important;
    }

    .inventory-toolbar:not(.report-toolbar) .inventory-toolbar-filters select {
        width: 100% !important;
        height: 34px !important;
        font-size: 11.5px !important;
        padding: 0 6px !important;
        border-radius: 8px !important;
    }

    .inventory-toolbar:not(.report-toolbar) .inventory-toolbar-actions {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 6px !important;
        width: 100% !important;
    }

    .inventory-toolbar:not(.report-toolbar) .inventory-toolbar-actions .inventory-action-btn {
        height: 36px !important;
        font-size: 11.5px !important;
        font-weight: 600 !important;
        border-radius: 10px !important;
        justify-content: center !important;
        text-align: center !important;
        padding: 0 8px !important;
        width: 100% !important;
    }

    .inventory-action-primary,
    .inventory-toolbar:not(.report-toolbar) .inventory-toolbar-actions .inventory-action-btn:only-child {
        grid-column: 1 / -1 !important;
        height: 38px !important;
        font-size: 12.5px !important;
        font-weight: 700 !important;
    }
}

/* Inventory polish: compact controls and calmer table density. */
#page-inv-products .inventory-toolbar:not(.report-toolbar),
#page-inv-in .inventory-toolbar:not(.report-toolbar),
#page-inv-transfer .inventory-toolbar:not(.report-toolbar),
#page-inv-out .inventory-toolbar:not(.report-toolbar),
#page-inv-batch .inventory-toolbar:not(.report-toolbar) {
    gap: 10px;
    padding: 12px;
    border-color: #dbe5ee;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
}

#page-inv-products .inventory-toolbar:not(.report-toolbar) .inventory-toolbar-filters,
#page-inv-in .inventory-toolbar:not(.report-toolbar) .inventory-toolbar-filters,
#page-inv-transfer .inventory-toolbar:not(.report-toolbar) .inventory-toolbar-filters,
#page-inv-out .inventory-toolbar:not(.report-toolbar) .inventory-toolbar-filters,
#page-inv-batch .inventory-toolbar:not(.report-toolbar) .inventory-toolbar-filters {
    gap: 8px;
}

#page-inv-products .inventory-toolbar:not(.report-toolbar) .inventory-toolbar-filters {
    flex-wrap: nowrap;
}

#page-inv-products .inventory-toolbar:not(.report-toolbar) .inventory-toolbar-filters input[type="text"],
#page-inv-in .inventory-toolbar:not(.report-toolbar) .inventory-toolbar-filters input[type="text"],
#page-inv-transfer .inventory-toolbar:not(.report-toolbar) .inventory-toolbar-filters input[type="text"],
#page-inv-out .inventory-toolbar:not(.report-toolbar) .inventory-toolbar-filters input[type="text"],
#page-inv-batch .inventory-toolbar:not(.report-toolbar) .inventory-toolbar-filters input[type="text"] {
    width: clamp(180px, 18vw, 220px);
    height: 38px;
    padding-inline: 12px !important;
    font-size: 12px;
}

#page-inv-products .inventory-toolbar:not(.report-toolbar) .inventory-toolbar-filters select,
#page-inv-in .inventory-toolbar:not(.report-toolbar) .inventory-toolbar-filters select,
#page-inv-transfer .inventory-toolbar:not(.report-toolbar) .inventory-toolbar-filters select,
#page-inv-out .inventory-toolbar:not(.report-toolbar) .inventory-toolbar-filters select,
#page-inv-batch .inventory-toolbar:not(.report-toolbar) .inventory-toolbar-filters select {
    width: 132px;
    height: 38px;
    padding-inline: 12px !important;
    font-size: 12px;
}

#page-inv-products .inventory-filter-reset,
#page-inv-in .inventory-filter-reset,
#page-inv-transfer .inventory-filter-reset,
#page-inv-out .inventory-filter-reset,
#page-inv-batch .inventory-filter-reset {
    width: 38px !important;
    min-width: 38px !important;
    height: 38px !important;
    padding: 0 !important;
    border-radius: 10px !important;
}

#page-inv-products .inventory-toolbar-actions .inventory-action-btn,
#page-inv-in .inventory-toolbar-actions .inventory-action-btn,
#page-inv-transfer .inventory-toolbar-actions .inventory-action-btn,
#page-inv-out .inventory-toolbar-actions .inventory-action-btn,
#page-inv-batch .inventory-toolbar-actions .inventory-action-btn {
    height: 38px;
    border-radius: 8px !important;
    font-size: 12px !important;
    font-weight: 500;
}

#page-inv-products .inventory-toolbar-actions .inventory-action-btn,
#page-inv-in .inventory-toolbar-actions .inventory-action-btn,
#page-inv-transfer .inventory-toolbar-actions .inventory-action-btn,
#page-inv-out .inventory-toolbar-actions .inventory-action-btn,
#page-inv-batch .inventory-toolbar-actions .inventory-action-btn {
    min-width: 86px;
    padding-inline: 11px !important;
}

#page-inv-products .inventory-action-primary,
#page-inv-in .inventory-action-primary,
#page-inv-transfer .inventory-action-primary,
#page-inv-out .inventory-action-primary {
    min-width: 124px;
}

#page-inv-products > .bg-white,
#page-inv-in > .bg-white,
#page-inv-transfer > .bg-white,
#page-inv-out > .bg-white,
#page-inv-batch > .bg-white:last-child {
    border-color: #dbe5ee !important;
    border-radius: 8px !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .03) !important;
}

#page-inv-products table,
#page-inv-in table,
#page-inv-transfer table,
#page-inv-out table,
#page-inv-batch table {
    border-collapse: collapse;
    color: #334155;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.45;
}

#page-inv-products table { min-width: 1040px; }
#page-inv-in table { min-width: 1180px; }
#page-inv-transfer table { min-width: 860px; }
#page-inv-out table { min-width: 1040px; }
#page-inv-batch table { min-width: 1180px; }

#page-inv-products thead th,
#page-inv-in thead th,
#page-inv-transfer thead th,
#page-inv-out thead th,
#page-inv-batch thead th {
    height: 44px;
    padding: 0 22px !important;
    border-bottom: 1px solid #dbeafe;
    background: rgba(240, 249, 255, .65);
    color: #075985;
    font-size: 11px !important;
    font-weight: 600 !important;
    line-height: 1.25;
    letter-spacing: .04em;
    vertical-align: middle;
    white-space: nowrap;
}

#page-inv-products tbody td,
#page-inv-in tbody td,
#page-inv-transfer tbody td,
#page-inv-out tbody td,
#page-inv-batch tbody td {
    padding: 12px 22px !important;
    border-bottom: 1px solid #eef2f7;
    color: #334155;
    font-size: 13px !important;
    font-weight: 400 !important;
    line-height: 1.45;
    vertical-align: middle;
}

#page-inv-products tbody tr:hover,
#page-inv-in tbody tr:hover,
#page-inv-transfer tbody tr:hover,
#page-inv-out tbody tr:hover,
#page-inv-batch tbody tr:hover {
    background: rgba(240, 249, 255, .38) !important;
}

#page-inv-products tbody td:nth-child(2),
#page-inv-in tbody td:nth-child(2),
#page-inv-transfer tbody td:nth-child(2),
#page-inv-out tbody td:nth-child(2),
#page-inv-batch tbody td:nth-child(2) {
    min-width: 220px;
    color: #0f172a;
}

#page-inv-products tbody td:nth-child(4),
#page-inv-in tbody td:nth-child(7),
#page-inv-batch tbody td:nth-child(7),
#page-inv-batch tbody td:nth-child(8) {
    font-weight: 500 !important;
}

#page-inv-products tbody td:last-child,
#page-inv-in tbody td:last-child,
#page-inv-transfer tbody td:last-child,
#page-inv-out tbody td:last-child {
    width: 116px;
    opacity: 1 !important;
}

#page-inv-products tbody td span,
#page-inv-in tbody td span,
#page-inv-transfer tbody td span,
#page-inv-out tbody td span,
#page-inv-batch tbody td span {
    line-height: 1.25;
}

#page-inv-products tbody td > span.font-mono,
#page-inv-in tbody td > span.font-mono,
#page-inv-transfer tbody td > span.font-mono,
#page-inv-out tbody td > span.font-mono,
#page-inv-batch tbody td > span.font-mono {
    font-size: 11px !important;
    font-weight: 400 !important;
}

#page-inv-products thead th,
#page-inv-products tbody td {
    padding-left: 18px !important;
    padding-right: 18px !important;
}

#page-inv-products thead th:nth-child(7),
#page-inv-products tbody td:nth-child(7) {
    width: 112px;
    min-width: 112px;
    text-align: center;
}

#page-inv-products tbody td:nth-child(7) > span {
    white-space: nowrap;
}

#page-inv-products thead th:nth-child(4),
#page-inv-products thead th:nth-child(5),
#page-inv-products tbody td:nth-child(4),
#page-inv-products tbody td:nth-child(5) {
    white-space: nowrap;
}

#page-inv-products tbody td:nth-child(8) {
    width: 108px;
    min-width: 108px;
}

#page-inv-products tbody td button,
#page-inv-in tbody td button,
#page-inv-transfer tbody td button,
#page-inv-out tbody td button {
    opacity: 1;
}

@media (max-width: 1180px) {
    #page-inv-products .inventory-toolbar:not(.report-toolbar) {
        grid-template-columns: minmax(0, 1fr);
    }

    #page-inv-products .inventory-toolbar:not(.report-toolbar) .inventory-toolbar-filters {
        flex-wrap: wrap;
    }
}

/* Penyesuaian stok toolbar & table layout */
@media (min-width: 1024px) {
    #page-inv-out .inventory-toolbar:not(.report-toolbar) .inventory-toolbar-filters {
        flex-wrap: nowrap;
    }
}

#page-inv-out .inventory-toolbar:not(.report-toolbar) .inventory-search-group {
    min-width: 140px;
    flex: 1 1 180px;
}

#page-inv-out .inventory-toolbar:not(.report-toolbar) .inventory-toolbar-filters select {
    width: clamp(105px, 10vw, 124px);
    padding-inline: 8px !important;
}

#page-inv-out .inventory-toolbar:not(.report-toolbar) .inventory-toolbar-filters input[type="text"] {
    width: 100%;
}

#page-inv-out table {
    min-width: 1100px;
    table-layout: fixed;
}

#page-inv-out thead th:nth-child(1),
#page-inv-out tbody td:nth-child(1) { width: 118px; }
#page-inv-out thead th:nth-child(2),
#page-inv-out tbody td:nth-child(2) { width: 250px; }
#page-inv-out thead th:nth-child(3),
#page-inv-out tbody td:nth-child(3) { width: 142px; }
#page-inv-out thead th:nth-child(4),
#page-inv-out tbody td:nth-child(4) { width: 122px; }
#page-inv-out thead th:nth-child(5),
#page-inv-out tbody td:nth-child(5) { width: 142px; }
#page-inv-out thead th:nth-child(6),
#page-inv-out tbody td:nth-child(6) { width: 88px; }
#page-inv-out thead th:nth-child(8),
#page-inv-out tbody td:nth-child(8) { width: 104px; }

#page-inv-out tbody td:nth-child(7) {
    min-width: 0;
    color: #64748b;
    white-space: normal;
    word-break: break-word;
}

#page-inv-out tbody td:nth-child(6) {
    color: #334155;
    font-variant-numeric: tabular-nums;
}

/* Riwayat Inventory summary cards & toolbar layout */
#page-inv-batch .grid > .bg-white {
    border-color: #dbe5ee !important;
    border-radius: 8px !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .03) !important;
}

#page-inv-batch .inventory-toolbar:not(.report-toolbar) {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

#page-inv-batch .inventory-toolbar-filters {
    display: flex !important;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
}

#page-inv-batch .inventory-toolbar-actions {
    display: flex !important;
    align-items: center;
    justify-content: flex-end;
    margin-left: auto;
    width: auto !important;
    flex: 0 0 auto;
}

#page-inv-batch .inventory-toolbar-actions .inventory-action-btn {
    width: auto !important;
    height: 38px !important;
    min-width: 90px;
}

@media (min-width: 1024px) {
    #page-inv-batch .inventory-toolbar-filters {
        flex-wrap: nowrap;
    }
}

@media (max-width: 767px) {
    #page-inv-batch .inventory-toolbar:not(.report-toolbar) {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    #page-inv-batch .inventory-toolbar-filters {
        display: contents !important;
    }

    #page-inv-batch .inventory-search-group {
        order: 1;
        width: 100% !important;
        flex: 1 1 100% !important;
    }

    #page-inv-batch #historyTypeFilter {
        order: 2;
        flex: 1 1 0 !important;
        min-width: 0 !important;
        width: auto !important;
    }

    #page-inv-batch #historyLocationFilter {
        order: 3;
        flex: 1 1 0 !important;
        min-width: 0 !important;
        width: auto !important;
    }

    #page-inv-batch .inventory-toolbar-actions {
        order: 4;
        width: auto !important;
        flex: 0 0 auto !important;
        margin-left: 0;
    }

    #page-inv-batch .inventory-action-export {
        height: 38px !important;
        padding-inline: 12px !important;
        font-size: 11.5px !important;
        width: auto !important;
        min-width: 0 !important;
    }
}

/* Settings pages: inventory-aligned operational styling. */
#page-set-receipt,
#page-set-users {
    color: #334155;
}

.settings-grid {
    display: grid;
    gap: 16px;
}

.settings-grid-receipt {
    grid-template-columns: minmax(0, 1.55fr) minmax(300px, .75fr);
}

.settings-panel,
.settings-status-item,
.settings-modal {
    border: 1px solid #dbe5ee;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
}

.settings-panel-header {
    min-height: 68px;
    padding: 15px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid #eef2f7;
}

.settings-panel-header h3,
.settings-modal-header h2 {
    color: #0f172a;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
}

.settings-panel-header p,
.settings-modal-header p {
    margin-top: 3px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.4;
}

.settings-panel-header .inventory-action-btn,
.settings-form-actions .inventory-action-btn,
.settings-modal-actions .inventory-action-btn {
    min-width: 148px;
    height: 38px;
    padding: 0 12px !important;
    border-radius: 8px !important;
    font-size: 12px !important;
    font-weight: 500;
}

.settings-panel-header .inventory-action-btn svg,
.settings-form-actions .inventory-action-btn svg,
.settings-modal-actions .inventory-action-btn svg {
    width: 16px;
    height: 16px;
}

.settings-primary-action {
    min-width: 170px !important;
    height: 40px !important;
    padding: 0 15px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 8px !important;
    line-height: 1;
    white-space: nowrap;
}

.settings-primary-action svg {
    width: 16px !important;
    height: 16px !important;
    flex: 0 0 16px;
}

#syncNowBtn {
    min-width: 190px !important;
}

.settings-form {
    padding: 18px;
    display: grid;
    gap: 15px;
}

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

.settings-field {
    display: grid;
    gap: 6px;
}

.settings-field > span {
    color: #475569;
    font-size: 12px;
    font-weight: 600;
}

.settings-field > span small {
    margin-left: 4px;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 400;
}

.settings-field input,
.settings-field select,
.settings-field textarea {
    width: 100%;
    border: 1px solid #dbe5ee;
    border-radius: 8px;
    background: #f8fafc;
    color: #334155;
    font-size: 13px;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.settings-field input,
.settings-field select {
    height: 40px;
    padding: 0 12px;
}

.settings-field textarea {
    min-height: 82px;
    padding: 10px 12px;
    resize: vertical;
}

.settings-field input:focus,
.settings-field select:focus,
.settings-field textarea:focus {
    border-color: #38bdf8;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, .1);
}

.settings-form-actions {
    margin-top: 2px;
    padding-top: 15px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    border-top: 1px solid #eef2f7;
}

.receipt-preview {
    margin: 18px auto;
    width: min(100% - 36px, 310px);
    padding: 20px;
    border: 1px solid #dbe5ee;
    border-radius: 8px;
    background: #f8fafc;
    color: #475569;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 11px;
    line-height: 1.65;
    letter-spacing: 0;
}

.settings-status-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.settings-status-item {
    min-height: 118px;
    padding: 18px;
    display: flex;
    align-items: flex-start;
    gap: 13px;
}

.settings-status-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: grid;
    place-items: center;
    border-radius: 8px;
}

.settings-status-icon svg {
    width: 20px;
    height: 20px;
}

.settings-status-icon.is-success { background: #ecfdf5; color: #059669; }
.settings-status-icon.is-info { background: #f0f9ff; color: #0284c7; }
.settings-status-icon.is-neutral { background: #f1f5f9; color: #64748b; }
.settings-status-icon.is-warning { background: #fffbeb; color: #d97706; }
.settings-status-icon.is-error { background: #fff1f2; color: #e11d48; }

.settings-status-copy {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.settings-status-copy span {
    color: #64748b;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.settings-status-copy strong {
    color: #0f172a;
    font-size: 14px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.settings-status-copy small {
    color: #64748b;
    font-size: 11px;
    line-height: 1.45;
}

.settings-table-panel {
    overflow: hidden;
}

.settings-table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
    color: #334155;
    font-size: 13px;
}

.users-table {
    min-width: 940px;
}

.settings-table thead th {
    height: 44px;
    padding: 0 18px;
    border-bottom: 1px solid #dbeafe;
    background: rgba(240, 249, 255, .65);
    color: #075985;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .04em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.settings-table tbody td {
    padding: 12px 18px;
    border-bottom: 1px solid #eef2f7;
    color: #334155;
    font-size: 13px;
    vertical-align: middle;
}

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

.settings-table tbody tr:not(:has(.settings-empty)):hover {
    background: rgba(240, 249, 255, .38);
}

.settings-empty {
    height: 104px;
    color: #64748b !important;
    text-align: center;
}

.settings-badge {
    display: inline-flex;
    min-width: 72px;
    height: 26px;
    padding: 0 9px;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

.settings-badge.is-admin { border-color: #ddd6fe; background: #f5f3ff; color: #6d28d9; }
.settings-badge.is-developer { border-color: #fde68a; background: #fffbeb; color: #b45309; }
.settings-badge.is-kasir { border-color: #bae6fd; background: #f0f9ff; color: #0369a1; }
.settings-badge.is-gudang { border-color: #a7f3d0; background: #ecfdf5; color: #047857; }
.settings-badge.is-active,
.settings-badge.is-success { border-color: #a7f3d0; background: #ecfdf5; color: #047857; }
.settings-badge.is-inactive { border-color: #e2e8f0; background: #f8fafc; color: #64748b; }
.settings-badge.is-error { border-color: #fecdd3; background: #fff1f2; color: #be123c; }
.settings-badge.is-upload { border-color: #bae6fd; background: #f0f9ff; color: #0369a1; }

.settings-user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-user-avatar {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: #e0f2fe;
    color: #0369a1;
    font-size: 11px;
    font-weight: 700;
}

.settings-user-cell strong {
    display: block;
    color: #0f172a;
    font-size: 13px;
    font-weight: 600;
}

.settings-user-cell small {
    display: block;
    margin-top: 2px;
    color: #94a3b8;
    font-size: 11px;
}

.settings-table-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

.settings-icon-btn {
    width: 32px;
    height: 32px;
    display: inline-grid;
    place-items: center;
    border: 1px solid #dbe5ee;
    border-radius: 8px;
    background: #fff;
    color: #64748b;
}

.settings-icon-btn:hover {
    border-color: #bae6fd;
    background: #f0f9ff;
    color: #0369a1;
}

.settings-icon-btn.is-danger:hover {
    border-color: #fecdd3;
    background: #fff1f2;
    color: #be123c;
}

.settings-icon-btn svg {
    width: 15px;
    height: 15px;
}

.settings-toolbar {
    border-color: #dbe5ee;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
}

.settings-toolbar .inventory-toolbar-filters input,
.settings-toolbar .inventory-toolbar-filters select {
    height: 38px;
    border-radius: 8px !important;
    font-size: 12px;
}

.settings-toolbar .inventory-toolbar-actions .inventory-action-btn {
    min-width: 148px;
    height: 38px;
    border-radius: 8px !important;
    font-size: 12px !important;
    font-weight: 500;
}

.settings-modal {
    width: min(100%, 480px);
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(15, 23, 42, .18);
}

.settings-modal-header {
    min-height: 72px;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid #eef2f7;
    background: #f8fafc;
}

.settings-modal-actions {
    padding: 14px 18px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    border-top: 1px solid #eef2f7;
}

.settings-secondary-btn {
    height: 38px;
    padding: 0 14px;
    border: 1px solid #dbe5ee;
    border-radius: 8px;
    background: #fff;
    color: #475569;
    font-size: 12px;
    font-weight: 600;
}

.settings-secondary-btn:hover {
    background: #f8fafc;
}

.settings-switch-row {
    min-height: 58px;
    padding: 11px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border: 1px solid #dbe5ee;
    border-radius: 8px;
    background: #f8fafc;
}

.settings-switch-row span {
    display: grid;
    gap: 2px;
}

.settings-switch-row strong {
    color: #334155;
    font-size: 12px;
    font-weight: 600;
}

.settings-switch-row small {
    color: #64748b;
    font-size: 11px;
}

.settings-switch-row input {
    width: 18px;
    height: 18px;
    accent-color: #0284c7;
}

[data-role-hidden="true"] {
    display: none !important;
}

@media (max-width: 1023px) {
    .settings-grid-receipt,
    .settings-status-grid {
        grid-template-columns: 1fr;
    }

    .settings-status-item {
        min-height: 104px;
    }
}

@media (max-width: 767px) {
    .settings-field-grid {
        grid-template-columns: 1fr;
    }

    .settings-panel-header {
        align-items: stretch;
        flex-direction: column;
    }

    .settings-panel-header .inventory-action-btn,
    .settings-form-actions .inventory-action-btn {
        width: 100%;
    }

    .settings-primary-action,
    #syncNowBtn {
        min-width: 0 !important;
        width: 100% !important;
    }

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

    .settings-toolbar .inventory-toolbar-filters input {
        grid-column: 1 / -1;
        width: 100%;
    }

    .settings-toolbar .inventory-toolbar-actions,
    .settings-toolbar .inventory-toolbar-actions .inventory-action-btn {
        width: 100%;
    }

    .settings-modal-actions > * {
        flex: 1 1 0;
    }
}

/* Bluetooth Thermal Printer UI */
#connectPrinterBtn svg,
#disconnectPrinterBtn svg,
#testPrintBtn svg,
#printThermalBtn svg {
    flex-shrink: 0;
}

#printThermalBtn {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #fff;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

#printThermalBtn:hover {
    background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
}

#receiptModalPrinterStatus {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* =========================================================
   COMPREHENSIVE MOBILE LAYOUT & BUTTON OPTIMIZATION
   ========================================================= */
@media (max-width: 767px) {
    /* Form controls across all pages and modals */
    input[type="text"],
    input[type="number"],
    input[type="date"],
    input[type="password"],
    select,
    textarea {
        font-size: 12px !important;
        border-radius: 10px !important;
    }

    /* Modal cards responsive constraints */
    .fixed.inset-0 > div[class*="bg-white"] {
        max-height: calc(100dvh - 16px) !important;
        border-radius: 16px !important;
        width: 100% !important;
    }

    /* Modal headers */
    .fixed.inset-0 [class*="border-b"] {
        padding: 10px 14px !important;
    }
    .fixed.inset-0 [class*="border-b"] h2,
    .fixed.inset-0 [class*="border-b"] h3 {
        font-size: 14px !important;
    }

    /* Modal bodies */
    .fixed.inset-0 form,
    .fixed.inset-0 .p-5 {
        padding: 10px 14px !important;
        gap: 8px !important;
    }

    /* Modal footers: clean 2-column grid for action buttons (Batal & Simpan) */
    .fixed.inset-0 .border-t.flex.justify-end,
    .fixed.inset-0 div[class*="border-t"][class*="justify-end"],
    .settings-modal-actions,
    .modal-actions {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
        padding: 10px 14px !important;
        width: 100% !important;
    }

    .fixed.inset-0 .border-t.flex.justify-end > button,
    .fixed.inset-0 div[class*="border-t"][class*="justify-end"] > button,
    .settings-modal-actions > button,
    .modal-actions > button {
        width: 100% !important;
        height: 38px !important;
        font-size: 12px !important;
        font-weight: 600 !important;
        border-radius: 10px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 8px !important;
    }

    /* Single action button in modal (e.g. alerts or full-width actions) */
    .fixed.inset-0 .border-t.flex.justify-end > button:only-child,
    .fixed.inset-0 div[class*="border-t"][class*="justify-end"] > button:only-child {
        grid-column: 1 / -1 !important;
    }

    /* Bluetooth Printer settings card on mobile */
    #page-set-receipt .settings-panel-header .flex.items-center.gap-2 {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 6px !important;
        width: 100% !important;
    }

    #connectPrinterBtn,
    #disconnectPrinterBtn,
    #testPrintBtn {
        width: 100% !important;
        height: 36px !important;
        font-size: 11.5px !important;
        justify-content: center !important;
        border-radius: 10px !important;
    }

    /* Universal table formatting on mobile */
    table {
        font-size: 11px !important;
    }

    table thead th {
        padding: 7px 9px !important;
        font-size: 9.5px !important;
        letter-spacing: 0.03em !important;
        white-space: nowrap !important;
    }

    table tbody td {
        padding: 7px 9px !important;
    }

    /* Table action buttons */
    table tbody td button,
    .detail-product-btn,
    .edit-product-btn,
    .delete-product-btn {
        padding: 5px !important;
        border-radius: 7px !important;
    }

    /* Badges & Status pills */
    .rounded-full.border {
        font-size: 9.5px !important;
        padding: 2px 6px !important;
    }

    /* Accounting & Reports Toolbars */
    .accounting-toolbar,
    .report-toolbar {
        padding: 8px !important;
        gap: 6px !important;
        flex-direction: column !important;
        align-items: stretch !important;
        border-radius: 12px !important;
    }

    .accounting-period-control {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        width: 100% !important;
        gap: 2px !important;
    }

    .accounting-period-control button {
        height: 28px !important;
        min-width: 0 !important;
        padding: 0 2px !important;
        font-size: 10px !important;
        border-radius: 6px !important;
    }

    .accounting-account-filter {
        width: 100% !important;
        margin-left: 0 !important;
    }

    .accounting-account-filter select {
        width: 100% !important;
        height: 34px !important;
        font-size: 11.5px !important;
    }

    .accounting-print-btn,
    .accounting-action-btn {
        width: 100% !important;
        height: 36px !important;
        font-size: 11.5px !important;
        justify-content: center !important;
        border-radius: 8px !important;
    }

    .journal-filter-toolbar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 6px !important;
        padding: 8px !important;
    }

    .journal-filter-fields {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 6px !important;
        width: 100% !important;
    }

    .journal-filter-fields input,
    .journal-filter-fields select {
        width: 100% !important;
        height: 34px !important;
        font-size: 11.5px !important;
    }

    .journal-filter-actions {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 6px !important;
        width: 100% !important;
    }

    .journal-filter-actions button {
        width: 100% !important;
        height: 36px !important;
        font-size: 11.5px !important;
        justify-content: center !important;
        border-radius: 8px !important;
    }

    /* Pagination controls */
    .table-pagination,
    .report-pagination {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
        padding: 8px 10px !important;
        justify-content: space-between !important;
        align-items: center !important;
        font-size: 10px !important;
    }

    .table-pagination-btn,
    .report-page-btn,
    .table-page-btn {
        height: 28px !important;
        min-width: 28px !important;
        padding: 0 6px !important;
        font-size: 10px !important;
        border-radius: 6px !important;
    }
}

/* ============================================================
   MANUAL JOURNAL — PREMIUM MODAL
   ============================================================ */

/* Modal entrance animation */
@keyframes mj-slide-in {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.mj-modal {
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(15, 23, 42, 0.05);
    width: 100%;
    max-width: 880px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: mj-slide-in 0.25s ease-out;
}

/* Accent strip — brand gradient bar at top */
.mj-accent-strip {
    height: 4px;
    background: linear-gradient(90deg, #0050a8, #4f46e5, #7c3aed);
    flex-shrink: 0;
}

/* Header */
.mj-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 22px;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.mj-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.mj-header-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mj-header-icon svg {
    width: 20px;
    height: 20px;
    color: #4f46e5;
}

.mj-title {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    line-height: 1.3;
}

.mj-subtitle {
    font-size: 12px;
    color: #64748b;
    margin: 1px 0 0;
    line-height: 1.3;
}

.mj-close-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
}

.mj-close-btn:hover {
    background: #fee2e2;
    border-color: #fecaca;
    color: #ef4444;
}

.mj-close-btn svg {
    width: 16px;
    height: 16px;
}

/* Body */
.mj-body {
    padding: 18px 22px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Meta Grid */
.mj-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.mj-field-full {
    grid-column: 1 / -1;
}

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

.mj-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.mj-label svg {
    width: 13px;
    height: 13px;
    color: #94a3b8;
    flex-shrink: 0;
}

.mj-required {
    color: #ef4444;
}

.mj-input {
    height: 38px;
    padding: 0 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    color: #0f172a;
    background: #ffffff;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    width: 100%;
}

.mj-input:hover {
    border-color: #cbd5e1;
}

.mj-input:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.mj-input::placeholder {
    color: #94a3b8;
}

/* Section Divider */
.mj-section-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 2px;
}

.mj-section-label span {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    white-space: nowrap;
}

.mj-section-line {
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

/* Table */
.mj-table-wrap {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    background: #ffffff;
}

.mj-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.mj-table thead th {
    background: #1e293b;
    color: #e2e8f0;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 9px 12px;
    text-align: left;
    border: none;
}

.mj-table thead th.col-numeric {
    text-align: right;
}

.mj-table thead th:first-child { border-radius: 0; }
.mj-table thead th:last-child { border-radius: 0; }

.mj-table td {
    padding: 0;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

/* Zebra stripe */
.mj-table tbody tr:nth-child(even) td {
    background: #f8fafc;
}

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

/* Inputs inside table cells */
.mj-table select.mj-account-select,
.mj-table input.mj-account-input,
.mj-table input.mj-debit-input,
.mj-table input.mj-credit-input,
.mj-table input.mj-row-desc {
    width: 100%;
    height: 40px;
    padding: 0 10px;
    border: none;
    background: transparent;
    font-size: 13px;
    color: #0f172a;
    outline: none;
    transition: background 0.1s;
}

.mj-table select.mj-account-select {
    cursor: pointer;
    font-weight: 500;
    border-radius: 8px;
    background-color: rgba(248, 250, 252, 0.6);
}

.mj-table select.mj-account-select:hover {
    background-color: #f1f5f9;
}

.mj-table select.mj-account-select option {
    background-color: #ffffff;
    color: #0f172a;
    padding: 6px 10px;
    font-weight: normal;
}

.mj-table select.mj-account-select optgroup {
    font-weight: 700;
    color: #475569;
    font-size: 11px;
    padding: 4px 0;
    background-color: #f8fafc;
}

.mj-table input.mj-account-input:focus,
.mj-table select.mj-account-select:focus,
.mj-table input:focus {
    background: #eef2ff;
    box-shadow: inset 0 0 0 2px #6366f1;
}

.mj-table input.mj-debit-input,
.mj-table input.mj-credit-input {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

/* Remove row button in table */
.mj-table .mj-remove-row-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin: 0 auto;
    border: none;
    background: transparent;
    color: #cbd5e1;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.15s;
    padding: 0;
}

.mj-table .mj-remove-row-btn:hover {
    background: #fee2e2;
    color: #ef4444;
}

.mj-table .mj-remove-row-btn svg {
    width: 15px;
    height: 15px;
}

/* Total footer row */
.mj-total-row td {
    background: #f1f5f9 !important;
    border-top: 2px solid #cbd5e1;
    border-bottom: none;
}

.mj-total-label {
    text-align: right;
    padding: 10px 14px !important;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #334155;
}

.mj-total-value {
    text-align: right;
    padding: 10px 12px !important;
    font-size: 13px;
    font-weight: 800;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
}

/* Column widths */
.mj-table .col-account { width: 28%; }
.mj-table .col-desc { width: 30%; }
.mj-table .col-numeric { width: 18%; }
.mj-table .col-action { width: 6%; text-align: center; }

/* Actions Row: Add button + Balance */
.mj-actions-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.mj-add-row-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 14px;
    border-radius: 8px;
    border: 1px dashed #a5b4fc;
    background: #eef2ff;
    color: #4338ca;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.mj-add-row-btn:hover {
    background: #e0e7ff;
    border-color: #818cf8;
    transform: translateY(-1px);
}

.mj-add-row-btn svg {
    width: 14px;
    height: 14px;
}

.mj-balance-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 99px;
}

.mj-balance-label {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
}

/* Balance badges */
.manual-journal-balance-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 99px;
    letter-spacing: 0.02em;
    transition: all 0.2s;
}

.manual-journal-balance-badge.is-balanced {
    background: #d1fae5;
    color: #065f46;
    box-shadow: 0 0 0 1px #a7f3d0;
}

.manual-journal-balance-badge.is-unbalanced {
    background: #fee2e2;
    color: #991b1b;
    box-shadow: 0 0 0 1px #fecaca;
}

/* Footer */
.mj-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 22px;
    background: #fafafa;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.mj-btn-cancel {
    height: 38px;
    padding: 0 18px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s;
}

.mj-btn-cancel:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.mj-btn-save {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 38px;
    padding: 0 20px;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, #0050a8, #4338ca);
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 80, 168, 0.25);
}

.mj-btn-save:hover:not(:disabled) {
    background: linear-gradient(135deg, #003d82, #3730a3);
    box-shadow: 0 4px 14px rgba(0, 80, 168, 0.35);
    transform: translateY(-1px);
}

.mj-btn-save:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

.mj-btn-save svg {
    width: 15px;
    height: 15px;
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
    .mj-modal {
        max-height: 95vh;
        border-radius: 10px;
    }

    .mj-header, .mj-body, .mj-footer {
        padding-left: 14px;
        padding-right: 14px;
    }

    .mj-meta-grid {
        grid-template-columns: 1fr;
    }
    .mj-field-full {
        grid-column: span 1;
    }

    .mj-table-wrap {
        overflow-x: auto;
    }
    .mj-table {
        min-width: 560px;
    }

    .mj-header-icon {
        display: none;
    }
}

/* ==========================================================================
   SEARCHABLE SELECT COMPONENT
   ========================================================================== */
.searchable-select-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.searchable-select-wrapper {
    position: relative;
    display: inline-block;
    vertical-align: middle;
    box-sizing: border-box;
}

.searchable-select-wrapper.w-full {
    display: block;
    width: 100%;
}

.searchable-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 38px;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: #1e293b;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    cursor: pointer;
    user-select: none;
    transition: all 0.15s ease-in-out;
    text-align: left;
    outline: none;
    box-sizing: border-box;
}

.searchable-select-trigger:hover:not(:disabled) {
    border-color: #cbd5e1;
    background-color: #f8fafc;
}

.searchable-select-trigger:focus,
.searchable-select-trigger.is-open {
    border-color: #0284c7;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.searchable-select-trigger.is-disabled,
.searchable-select-trigger:disabled {
    background-color: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
    border-color: #e2e8f0;
}

.searchable-select-trigger.is-invalid {
    border-color: #f43f5e;
    box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.15);
}

.searchable-select-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.searchable-select-chevron {
    width: 1.125rem;
    height: 1.125rem;
    margin-left: 0.5rem;
    color: #64748b;
    flex-shrink: 0;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.searchable-select-trigger.is-open .searchable-select-chevron {
    transform: rotate(180deg);
    color: #0284c7;
}

/* Floating Popover */
.searchable-select-popover {
    position: fixed;
    z-index: 99999;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 0.875rem;
    box-shadow: 0 12px 28px -4px rgba(15, 23, 42, 0.18), 0 6px 12px -4px rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
    font-family: inherit;
    animation: searchableSelectOpen 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes searchableSelectOpen {
    from {
        opacity: 0;
        transform: translateY(-4px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.searchable-select-search-wrap {
    padding: 0.5rem 0.625rem;
    background-color: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    position: relative;
}

.searchable-select-search-icon {
    position: absolute;
    left: 1.125rem;
    width: 1rem;
    height: 1rem;
    color: #94a3b8;
    pointer-events: none;
}

.searchable-select-search-input {
    width: 100%;
    padding: 0.4375rem 0.625rem 0.4375rem 2.125rem;
    font-size: 0.8125rem;
    color: #0f172a;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.searchable-select-search-input:focus {
    border-color: #0284c7;
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15);
}

.searchable-select-options {
    flex: 1;
    overflow-y: auto;
    max-height: 220px;
    padding: 0.25rem 0;
    margin: 0;
    list-style: none;
    overscroll-behavior: contain;
}

.searchable-select-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    color: #334155;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.1s ease, color 0.1s ease;
    gap: 0.5rem;
}

.searchable-select-option-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.searchable-select-option:hover,
.searchable-select-option.is-highlighted {
    background-color: #f0f9ff;
    color: #0284c7;
}

.searchable-select-option.is-selected {
    font-weight: 600;
    color: #0284c7;
    background-color: #f0fdf4;
}

.searchable-select-option.is-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.searchable-select-check {
    width: 1rem;
    height: 1rem;
    color: #0284c7;
    flex-shrink: 0;
}

.searchable-select-empty {
    padding: 1.25rem 0.75rem;
    font-size: 0.8125rem;
    color: #94a3b8;
    text-align: center;
    font-style: italic;
}

/* Specific context adjustments */
.inventory-toolbar-filters .searchable-select-trigger,
.journal-filter-fields .searchable-select-trigger,
.settings-toolbar .searchable-select-trigger {
    min-height: 38px;
    height: 38px;
    background-color: #ffffff;
}

.mj-table .searchable-select-trigger {
    min-height: 34px;
    height: 34px;
    padding: 0.35rem 0.5rem;
    font-size: 0.8125rem;
    border-radius: 0.5rem;
}

.flex > .searchable-select-wrapper:first-child .searchable-select-trigger {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: 0;
}

.searchable-select-custom-option {
    border-top: 1px dashed #e2e8f0;
    margin-top: 2px;
    background-color: #f8fafc;
}

.searchable-select-custom-option:hover,
.searchable-select-custom-option.is-highlighted {
    background-color: #f0f9ff !important;
}

.checkout-modal-body .searchable-select-trigger {
    min-height: 38px;
    height: 38px;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 0.75rem;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
}

.checkout-modal-body .searchable-select-trigger:hover {
    background-color: #ffffff;
    border-color: #0284c7;
}

@media (max-width: 640px) {
    .searchable-select-popover {
        max-width: calc(100vw - 16px) !important;
        border-radius: 0.75rem;
    }
    .searchable-select-options {
        max-height: 170px;
    }
}

/* ==================== SMOOTH PAGE & DATABASE LOADING EFFECTS ==================== */

/* 1. Global Top Progress Bar */
#appTopProgress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #10b981, #06b6d4, #3b82f6, #6366f1);
    background-size: 200% 100%;
    animation: topProgressShimmer 1.8s infinite linear;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.6), 0 0 4px rgba(6, 182, 212, 0.4);
    z-index: 99999;
    pointer-events: none;
    transition: width 0.28s cubic-bezier(0.1, 0.9, 0.2, 1), opacity 0.28s ease;
    opacity: 0;
}

#appTopProgress.is-active {
    opacity: 1;
}

@keyframes topProgressShimmer {
    0% { background-position: 0% 0%; }
    100% { background-position: 200% 0%; }
}

/* 2. In-Page Smooth Loading Overlay - DISABLED */
.page-loading-overlay,
.page-loading-overlay.active {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.page-loading-card {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px 28px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(226, 232, 240, 0.85);
    box-shadow: 0 14px 35px -8px rgba(15, 23, 42, 0.12), 0 4px 12px -2px rgba(15, 23, 42, 0.05);
    transform: scale(0.94) translateY(6px);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.page-loading-overlay.active .page-loading-card {
    transform: scale(1) translateY(0);
}

.page-loading-spinner-wrap {
    position: relative;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-loading-spinner {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid rgba(16, 185, 129, 0.18);
    border-top-color: #10b981;
    border-right-color: #06b6d4;
    animation: pageSpinnerSpin 0.75s linear infinite;
}

@keyframes pageSpinnerSpin {
    to { transform: rotate(360deg); }
}

.page-loading-spinner-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    animation: pulse 1.2s ease-in-out infinite;
}

.page-loading-text {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #1e293b;
    letter-spacing: -0.01em;
}

.page-loading-subtext {
    font-size: 0.6875rem;
    font-weight: 500;
    color: #64748b;
    margin-top: -6px;
}

/* 3. Initial Boot Splash & Database Sync Loader */
.app-boot-loader {
    position: fixed;
    inset: 0;
    z-index: 99998;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 50% 35%, #ffffff 0%, #f1f5f9 100%);
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.app-boot-loader.fade-out {
    opacity: 0;
    transform: scale(1.02);
    pointer-events: none;
}

.boot-loader-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    max-width: 320px;
    width: 88%;
    text-align: center;
}

.boot-logo-wrap {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: #ffffff;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.25), 0 0 0 1px rgba(226, 232, 240, 0.8);
}

.boot-logo-pulse {
    position: absolute;
    inset: -6px;
    border-radius: 26px;
    border: 2px solid rgba(16, 185, 129, 0.35);
    animation: bootPulse 2s ease-in-out infinite;
}

@keyframes bootPulse {
    0%, 100% { transform: scale(0.96); opacity: 0.35; }
    50% { transform: scale(1.06); opacity: 0.9; }
}

.boot-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 14px;
}

.boot-app-name {
    font-size: 1.25rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.02em;
    margin-bottom: 2px;
}

.boot-app-kicker {
    font-size: 0.75rem;
    font-weight: 500;
    color: #64748b;
}

.boot-progress-track {
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
    margin-top: 14px;
    position: relative;
}

.boot-progress-fill {
    height: 100%;
    width: 15%;
    border-radius: 999px;
    background: linear-gradient(90deg, #10b981, #06b6d4);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
    transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.boot-status-text {
    margin-top: 10px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #64748b;
    min-height: 1.2em;
    transition: color 0.2s ease;
}

/* ===== Recalculate Profit Modal (Single Source of Truth) ===== */

/* Overlay — scrollable backdrop */
#recalculateProfitModal {
    overflow-y: auto !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}
#recalculateProfitModal.flex {
    display: flex !important;
}

/* Card — fixed 500px max, flex column */
#recalculateProfitModal .recalc-modal-card {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 24rem !important;
    max-height: 500px !important;
    margin: auto !important;
    overflow: hidden !important;
}

/* Header — pinned top */
#recalculateProfitModal .recalc-modal-card > div:first-child {
    flex-shrink: 0 !important;
}

/* Body — fills remaining space, scrolls internally */
#recalculateProfitModal .recalc-modal-body {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
}

/* Footer — pinned bottom */
#recalculateProfitModal .recalc-modal-footer {
    flex-shrink: 0 !important;
}

/* Visibility guarantees */
#recalculateProfitModal .hidden,
#recalcFormControls.hidden,
#recalcStatusArea.hidden,
#recalcSpinner.hidden,
#recalcResultWrap.hidden,
#recalcCustomDateWrap.hidden,
#recalcBackToFormBtn.hidden,
#recalcCancelBtn.hidden {
    display: none !important;
}

#recalculateProfitModal:has(#recalcStatusArea:not(.hidden)) #recalcFormControls {
    display: none !important;
}