﻿html, body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma;
    background: #f5f7fb;
}

.permissions-page {
    min-height: calc(100vh - 150px);
}

.permissions-page .item-lookup-topbar {
    align-items: center;
    gap: 12px;
}

.permission-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.permission-shell {
    display: grid;
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
}

.permission-users-panel,
.permission-card,
.permission-group {
    background: #fff;
    border: 1px solid #cfdced;
    border-radius: 8px;
}

.permission-users-panel {
    padding: 10px;
    min-height: 560px;
}

.permission-users-list {
    display: grid;
    gap: 6px;
    margin-top: 10px;
    max-height: 520px;
    overflow: auto;
}

.permission-user-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    border: 1px solid #d7e2f0;
    background: #f8fbff;
    color: #0b1f3a;
    border-radius: 7px;
    padding: 10px;
    text-align: right;
}

.permission-user-row.active {
    border-color: #2563eb;
    box-shadow: inset 3px 0 0 #2563eb;
    background: #eef5ff;
}

.permission-empty {
    color: #64748b;
    padding: 16px;
    text-align: center;
}

.permission-editor {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.permission-card {
    padding: 10px;
}

.permission-identity {
    display: grid;
    grid-template-columns: 130px minmax(220px, 1fr) minmax(220px, 1fr);
    gap: 10px;
}

.permission-identity .field,
.permission-users-panel .lookup-filter {
    display: grid;
    gap: 5px;
}

.permission-identity label,
.permission-users-panel label {
    font-weight: 800;
    color: #0b1f3a;
    font-size: 13px;
}

.permission-shortcuts {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
}

.permission-shortcuts label,
.permission-group label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-weight: 800;
    color: #0b1f3a;
}

.permission-tabs {
    display: inline-flex;
    width: fit-content;
    border: 1px solid #b8c9e0;
    border-radius: 8px;
    overflow: hidden;
    background: #f7fbff;
}

.permission-tabs button {
    min-width: 140px;
    border: 0;
    border-inline-end: 1px solid #cbd7e7;
    padding: 9px 12px;
    background: transparent;
    color: #0b1f3a;
    font-weight: 900;
}

.permission-tabs button:last-child {
    border-inline-end: 0;
}

.permission-tabs button.active {
    background: #21406a;
    color: #fff;
}

.permission-doc-table header,
.permission-group header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.permission-doc-table header button,
.permission-group header button {
    border: 1px solid #cbd7e7;
    background: #f8fbff;
    color: #0b1f3a;
    border-radius: 6px;
    padding: 5px 9px;
    font-weight: 800;
}

.permission-table-wrap {
    overflow: auto;
}

.permission-table {
    min-width: 780px;
}

.permission-table th,
.permission-table td {
    text-align: center;
    vertical-align: middle;
}

.permission-table .doc-name {
    text-align: right;
    font-weight: 900;
}

.permission-general-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 10px;
}

.permission-group {
    padding: 10px;
}

.permission-group label {
    display: flex;
    justify-content: flex-start;
    padding: 6px 0;
    border-top: 1px solid #eef3f9;
    font-size: 13px;
}

.permission-group label:first-of-type {
    border-top: 0;
}

.erp-menu-dropdown button:disabled {
    cursor: not-allowed;
    opacity: .45;
    filter: grayscale(.2);
}

@media (max-width: 900px) {
    .permission-shell {
        grid-template-columns: 1fr;
    }

    .permission-users-panel {
        min-height: 0;
    }

    .permission-users-list {
        max-height: 220px;
    }

    .permission-identity {
        grid-template-columns: 1fr;
    }

    .permission-tabs {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
    }

    .permission-tabs button {
        min-width: 0;
    }
}

.pos-entry-page {
    padding: 0;
    background: #eef3f7;
    min-height: calc(100vh - 150px);
}

.pos-cashier-shell {
    direction: rtl;
    display: grid;
    grid-template-columns: minmax(430px, 42%) minmax(520px, 58%);
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 14px;
    min-height: calc(100vh - 155px);
    padding: 14px;
    padding-bottom: 116px;
}

.pos-cart-panel,
.pos-products-panel {
    background: #fff;
    border: 1px solid #d8e2ec;
    border-radius: 18px;
    box-shadow: 0 16px 38px rgba(15, 23, 42, .08);
    min-height: 0;
}

.pos-cart-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pos-cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid #e5edf5;
}

.pos-kicker {
    color: #0f8f78;
    font-weight: 800;
    font-size: 13px;
}

.pos-cart-header h2 {
    margin: 4px 0 0;
    font-size: 28px;
    color: #0f172a;
}

.pos-invoice-number {
    min-width: 78px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #ecfdf5;
    color: #047857;
    font-weight: 900;
    text-align: center;
}

.pos-customer-strip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e5edf5;
    font-weight: 800;
    color: #1e293b;
}

.pos-soft-btn,
.pos-action-btn {
    border: 1px solid #d8e2ec;
    background: #fff;
    color: #26364d;
    border-radius: 12px;
    min-height: 42px;
    padding: 0 16px;
    font-weight: 800;
    cursor: pointer;
}

.pos-cart-headings {
    order: 0;
    display: grid;
    grid-template-columns: 1fr 130px 82px 82px 96px;
    gap: 8px;
    padding: 10px 18px;
    background: #173a5e;
    color: #fff;
    font-weight: 900;
    font-size: 13px;
}

.pos-cart-lines {
    order: 1;
    flex: 1;
    overflow: auto;
    padding: 12px;
}

.pos-cart-line {
    display: grid;
    grid-template-columns: 38px 1fr 130px 82px 82px 96px;
    gap: 8px;
    align-items: center;
    padding: 10px;
    border: 1px solid #e1e8f0;
    border-radius: 14px;
    margin-bottom: 8px;
    background: #fff;
}

.pos-line-name {
    min-width: 0;
}

.pos-line-name strong {
    display: block;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pos-line-name span {
    display: block;
    color: #64748b;
    font-size: 12px;
    margin-top: 3px;
}

.pos-qty-box {
    display: grid;
    grid-template-columns: 34px 1fr 34px;
    gap: 4px;
}

.pos-qty-box button,
.pos-remove-btn {
    border: 0;
    border-radius: 10px;
    min-height: 34px;
    font-weight: 900;
    cursor: pointer;
}

.pos-qty-box button {
    background: #e8f7f4;
    color: #047857;
}

.pos-qty-box input,
.pos-total-box input {
    border: 1px solid #d8e2ec;
    border-radius: 10px;
    min-height: 34px;
    text-align: center;
    font-weight: 800;
}

.pos-remove-btn {
    background: #fee2e2;
    color: #dc2626;
}

.pos-money,
.pos-line-total {
    text-align: center;
    font-weight: 900;
}

.pos-line-total {
    color: #0f8f78;
}

.pos-empty-cart {
    display: grid;
    place-items: center;
    height: 260px;
    border: 2px dashed #d8e2ec;
    border-radius: 18px;
    color: #64748b;
    font-weight: 800;
}

.pos-products-panel {
    display: flex;
    flex-direction: column;
    padding: 16px;
    overflow: hidden;
}

.pos-toolbar {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto auto auto;
    gap: 10px;
    align-items: center;
}

.pos-barcode-box {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: 0 14px;
    border: 1px solid #cfdbe8;
    border-radius: 14px;
    background: #f8fafc;
}

.pos-barcode-box span {
    font-size: 24px;
    color: #0f8f78;
    font-weight: 900;
}

.pos-barcode-box input {
    border: 0;
    outline: 0;
    background: transparent;
    width: 100%;
    font-size: 18px;
    font-weight: 800;
}

.pos-category-strip {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 14px 0;
    border-bottom: 1px solid #e5edf5;
}

.pos-category-strip button {
    white-space: nowrap;
    border: 1px solid #d8e2ec;
    background: #fff;
    border-radius: 999px;
    padding: 10px 16px;
    color: #334155;
    font-weight: 900;
    cursor: pointer;
}

.pos-category-strip button.active {
    background: #dff8f3;
    border-color: #1fb6a6;
    color: #047857;
}

.pos-products-grid {
    flex: 1;
    overflow: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    padding-top: 14px;
}

.pos-product-card {
    border: 1px solid #dbe5ef;
    border-radius: 16px;
    background: #fff;
    min-height: 168px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .05);
}

.pos-product-card:hover {
    border-color: #1fb6a6;
    transform: translateY(-1px);
}

.pos-product-image {
    height: 78px;
    border-radius: 14px;
    background: linear-gradient(135deg, #e8f7f4, #eef4ff);
    display: grid;
    place-items: center;
    color: #0f8f78;
    font-size: 24px;
    font-weight: 900;
}

.pos-product-card strong {
    color: #0f172a;
    min-height: 38px;
    overflow: hidden;
}

.pos-product-price {
    margin-top: auto;
    color: #047857;
    font-size: 18px;
    font-weight: 900;
}

.pos-payment-bar {
    position: fixed;
    left: 14px;
    right: 14px;
    bottom: 14px;
    z-index: 20;
    display: grid;
    grid-template-columns: 140px 150px 140px 190px minmax(420px, 1fr);
    gap: 10px;
    align-items: center;
    padding: 12px;
    border: 1px solid #cfe3df;
    border-radius: 18px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 18px 45px rgba(15, 23, 42, .16);
    backdrop-filter: blur(10px);
}

.pos-total-box,
.pos-final-total {
    min-height: 62px;
    border-radius: 14px;
    border: 1px solid #dbe5ef;
    background: #f8fafc;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

.pos-total-box span,
.pos-final-total span {
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
}

.pos-total-box strong {
    color: #0f172a;
    font-size: 19px;
}

.pos-final-total {
    background: #0f8f78;
    border-color: #0f8f78;
    color: #fff;
}

.pos-final-total span,
.pos-final-total strong {
    color: #fff;
}

.pos-final-total strong {
    font-size: 30px;
    line-height: 1;
}

.pos-pay-buttons {
    display: grid;
    grid-template-columns: repeat(4, minmax(90px, 1fr));
    gap: 8px;
}

.pos-pay-buttons button {
    border: 1px solid #d8e2ec;
    border-radius: 14px;
    background: #fff;
    min-height: 58px;
    color: #26364d;
    font-weight: 900;
    cursor: pointer;
}

.pos-pay-buttons button.selected {
    background: #dff8f3;
    border-color: #1fb6a6;
    color: #047857;
}

.pos-pay-buttons .pos-pay-now {
    background: #16a34a;
    border-color: #16a34a;
    color: #fff;
    font-size: 18px;
}

@media (max-width: 1100px) {
    .pos-cashier-shell {
        grid-template-columns: 1fr;
    }

    .pos-payment-bar {
        grid-template-columns: repeat(2, 1fr);
        position: sticky;
    }
}

/* ===== Layout ===== */

.app-shell {
    display: flex;
    min-height: 100vh;
}

    /* RTL */
    .app-shell.rtl {
        direction: rtl;
    }

    /* LTR */
    .app-shell.ltr {
        direction: ltr;
    }

/* ===== Sidebar ===== */

.sidebar {
    width: 250px;
    background: linear-gradient(180deg, #071b4d 0%, #2b0052 100%);
    color: white;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 20px rgba(0,0,0,.08);
    height: 100vh;
    position: sticky;
    top: 0;
    overflow: hidden;
}

/* اجعل قائمة المنيو قابلة للتمرير عندما تكبر (مع كثرة العناصر/التبويبات) */
.nav-menu {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 14px;
}

.logo {
    padding: 24px;
    font-size: 28px;
    font-weight: bold;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

/* ===== Main ===== */

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: end;
    padding-inline: 30px;
    border-bottom: 1px solid #e5e7eb;
}

.page-content {
    padding: 30px;
    flex: 1;
    min-height: 0;
}

/* ===== Language Button ===== */

.lang-btn {
    border: none;
    background: #4f46e5;
    color: white;
    padding: 10px 18px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: bold;
    transition: .2s;
}

    .lang-btn:hover {
        background: #4338ca;
    }

/* ===== Dashboard ===== */

.executive-dashboard {
    direction: rtl;
    min-height: calc(100vh - 120px);
    padding: 18px;
    color: #172033;
}

.dashboard-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 22px;
    border: 1px solid #dce5ef;
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(255,255,255,.96), rgba(242,247,252,.98)),
        radial-gradient(circle at 12% 20%, rgba(14,165,233,.12), transparent 28%);
    box-shadow: 0 16px 38px rgba(15, 23, 42, .08);
}

.dashboard-kicker {
    display: inline-flex;
    align-items: center;
    height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    background: #e8f7ef;
    color: #087443;
    font-size: 12px;
    font-weight: 900;
}

.dashboard-hero h2 {
    margin: 10px 0 6px;
    font-size: 28px;
    font-weight: 900;
    letter-spacing: 0;
}

.dashboard-hero p {
    margin: 0;
    color: #64748b;
    font-weight: 700;
}

.dashboard-hero-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.dashboard-period {
    display: inline-flex;
    align-items: center;
    height: 38px;
    padding: 0 14px;
    border: 1px solid #d8e1ec;
    border-radius: 8px;
    background: #fff;
    color: #243247;
    font-weight: 900;
}

.dash-refresh-btn,
.dash-mini-btn,
.metric-action {
    border: 1px solid #c9d5e3;
    border-radius: 7px;
    background: #fff;
    color: #1f2d40;
    font-weight: 900;
    cursor: pointer;
}

.dash-refresh-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 14px;
}

.dash-refresh-btn:hover,
.dash-mini-btn:hover,
.metric-action:hover {
    border-color: #1f6feb;
    color: #0f4fb8;
    background: #f4f8ff;
}

.dashboard-metrics-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(190px, 1fr));
    gap: 14px;
    margin-top: 16px;
}

.dashboard-metric {
    display: grid;
    grid-template-columns: 46px 1fr;
    grid-template-rows: auto auto;
    gap: 10px 12px;
    align-items: center;
    min-height: 132px;
    padding: 16px;
    border: 1px solid #dce5ef;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
}

.metric-symbol {
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 20px;
    font-weight: 900;
    color: #fff;
}

.dashboard-metric.mint .metric-symbol { background: #0f9f6e; }
.dashboard-metric.sky .metric-symbol { background: #0284c7; }
.dashboard-metric.amber .metric-symbol { background: #b7791f; }
.dashboard-metric.rose .metric-symbol { background: #be123c; }

.metric-body span {
    display: block;
    color: #64748b;
    font-size: 13px;
    font-weight: 900;
}

.metric-body strong {
    display: block;
    margin-top: 3px;
    color: #0f172a;
    font-size: 30px;
    line-height: 1;
    font-weight: 900;
}

.metric-action {
    grid-column: 1 / -1;
    height: 34px;
    padding: 0 12px;
}

.dashboard-workbench {
    margin-top: 16px;
    padding: 18px;
    border: 1px solid #dce5ef;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 14px 30px rgba(15, 23, 42, .06);
}

.dashboard-section-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.dashboard-section-title h3 {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 900;
}

.dashboard-section-title p {
    margin: 0;
    color: #64748b;
    font-weight: 700;
}

.dashboard-action-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(170px, 1fr));
    gap: 12px;
}

.dash-action-card {
    min-height: 178px;
    padding: 14px;
    border: 1px solid #d8e1ec;
    border-radius: 8px;
    background: #f8fafc;
}

.dash-action-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.dash-action-icon {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #fff;
    font-weight: 900;
}

.dash-action-state {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
}

.dash-action-state.needs-work {
    background: #fff3cd;
    color: #805b00;
}

.dash-action-state.clear {
    background: #dcfce7;
    color: #166534;
}

.dash-action-card h4 {
    margin: 12px 0 8px;
    min-height: 36px;
    font-size: 15px;
    font-weight: 900;
    color: #1f2d40;
}

.dash-action-card strong {
    display: block;
    color: #0f172a;
    font-size: 34px;
    line-height: 1;
    font-weight: 900;
}

.dash-action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 14px;
}

.dash-mini-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 34px;
    padding: 0 8px;
    font-size: 12px;
}

.dash-mini-btn.post {
    background: #1f3a5f;
    border-color: #1f3a5f;
    color: #fff;
}

.dash-mini-btn.post:hover {
    background: #173151;
    color: #fff;
}

.dash-mini-btn:disabled,
.dash-refresh-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.tone-green .dash-action-icon { background: #0f9f6e; }
.tone-indigo .dash-action-icon { background: #4f46e5; }
.tone-blue .dash-action-icon { background: #2563eb; }
.tone-cyan .dash-action-icon { background: #0891b2; }
.tone-amber .dash-action-icon { background: #b7791f; }
.tone-slate .dash-action-icon { background: #475569; }

.dash-message {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #334155;
    font-weight: 800;
}

.dash-message.success {
    border-color: #86efac;
    background: #f0fdf4;
    color: #166534;
}

.dash-message.warning {
    border-color: #fde68a;
    background: #fffbeb;
    color: #92400e;
}

.dash-message.error {
    border-color: #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

@media (max-width: 1200px) {
    .dashboard-action-grid {
        grid-template-columns: repeat(3, minmax(170px, 1fr));
    }
}

@media (max-width: 900px) {
    .dashboard-hero {
        align-items: stretch;
        flex-direction: column;
    }

    .dashboard-hero-actions {
        justify-content: flex-start;
    }

    .dashboard-metrics-row,
    .dashboard-action-grid {
        grid-template-columns: repeat(2, minmax(170px, 1fr));
    }
}

@media (max-width: 560px) {
    .executive-dashboard {
        padding: 10px;
    }

    .dashboard-metrics-row,
    .dashboard-action-grid {
        grid-template-columns: 1fr;
    }

    .dash-action-buttons {
        grid-template-columns: 1fr;
    }
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 30px;
}

.dash-card {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 8px 25px rgba(0,0,0,.05);
    transition: .2s;
}

    .dash-card:hover {
        transform: translateY(-3px);
    }

    .dash-card span {
        color: #6b7280;
        font-size: 15px;
    }

    .dash-card strong {
        display: block;
        margin-top: 12px;
        font-size: 40px;
        color: #111827;
    }

.tree-container {
    direction: rtl;
    font-family: Tahoma;
}

.account-node {
    margin-right: 20px;
    margin-top: 4px;
}

.node-header {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #ffffff;
    border: 1px solid #ddd;
    padding: 6px 10px;
    border-radius: 8px;
}

.toggle-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: #4f46e5;
    color: white;
    font-weight: bold;
}

.code {
    color: #666;
    min-width: 80px;
}

.name {
    font-weight: bold;
}

.children {
    margin-right: 25px;
    border-right: 2px dashed #ccc;
    padding-right: 15px;
    margin-top: 5px;
}






.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a, #312e81);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: Tahoma, Arial;
}

.login-card {
    width: 420px;
    background: #fff;
    border-radius: 22px;
    padding: 32px;
    box-shadow: 0 25px 60px rgba(0,0,0,.25);
}

.login-logo {
    text-align: center;
    margin-bottom: 24px;
}

.logo-circle {
    width: 70px;
    height: 70px;
    border-radius: 22px;
    background: #4f46e5;
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    font-weight: bold;
    margin-bottom: 12px;
}

.login-logo h2 {
    margin: 0;
    font-weight: 800;
    color: #111827;
}

.login-logo p {
    color: #6b7280;
    margin-top: 6px;
}

.form-group {
    margin-bottom: 16px;
}

    .form-group label {
        display: block;
        font-weight: bold;
        margin-bottom: 7px;
        color: #374151;
    }

.form-control {
    width: 100%;
    height: 46px;
    border-radius: 12px;
    border: 1px solid #d1d5db;
    padding: 0 14px;
    outline: none;
}

    .form-control:focus {
        border-color: #4f46e5;
        box-shadow: 0 0 0 3px rgba(79,70,229,.15);
    }

.login-btn {
    width: 100%;
    height: 48px;
    border: none;
    border-radius: 14px;
    background: #4f46e5;
    color: white;
    font-weight: bold;
    font-size: 17px;
    margin-top: 8px;
}

.login-error {
    background: #fee2e2;
    color: #991b1b;
    padding: 10px 14px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-weight: bold;
}


.app-rtl {
    direction: rtl;
}

.main-area {
    flex: 1;
}

.sidebar {
    right: 0;
    left: auto;
}

.content {
    direction: rtl;
    text-align: right;
}




.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 18px;
    margin-top: 24px;
}

.dash-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
}

    .dash-card span {
        color: #6b7280;
        font-weight: bold;
    }

    .dash-card strong {
        display: block;
        font-size: 34px;
        margin-top: 10px;
        color: #111827;
    }





.nav-menu {
    padding: 20px;
}

.menu-item {
    display: block;
    width: 100%;
    padding: 14px 18px;
    margin-bottom: 10px;
    border-radius: 14px;
    background: rgba(255,255,255,.08);
    border: none;
    color: white;
    text-decoration: none;
    transition: .2s;
}

    .menu-item:hover {
        background: rgba(255,255,255,.1);
    }



    /*اضافة حساب شجرة حسابات*/ 

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5000;
}

.picker-modal {
    width: 700px;
    max-height: 80vh;
    overflow: hidden;
    background: white;
    border-radius: 22px;
    display: flex;
    flex-direction: column;
}

.picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid #eee;
}

.close-btn {
    border: none;
    background: none;
    font-size: 28px;
}

.search-box {
    margin: 18px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid #ddd;
    padding-inline: 14px;
}

.picker-list {
    overflow: auto;
    padding: 0 18px 18px;
}

.picker-row {
    display: flex;
    gap: 18px;
    padding: 14px;
    border-radius: 12px;
    cursor: pointer;
}

    .picker-row:hover {
        background: #f3f4f6;
    }

.picker-code {
    width: 120px;
    color: #666;
}



.account-form-modal {
    width: 560px;
    background: white;
    border-radius: 22px;
    overflow: hidden;
}

.account-form-body {
    padding: 24px;
}

    .account-form-body label {
        display: block;
        font-weight: bold;
        margin: 12px 0 7px;
    }

.parent-select {
    display: flex;
    gap: 10px;
}

.pick-btn {
    border: none;
    border-radius: 12px;
    background: #0f172a;
    color: white;
    padding: 0 18px;
}

.save-btn {
    width: 100%;
    height: 48px;
    margin-top: 22px;
    border: none;
    border-radius: 14px;
    background: #16a34a;
    color: white;
    font-weight: bold;
}

.form-success {
    margin-top: 14px;
    padding: 10px;
    border-radius: 12px;
    background: #dcfce7;
    color: #166534;
}

.form-error {
    margin-top: 14px;
    padding: 10px;
    border-radius: 12px;
    background: #fee2e2;
    color: #991b1b;
}

.page-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
}

.add-account-btn {
    border: none;
    border-radius: 14px;
    background: #4f46e5;
    color: white;
    padding: 12px 22px;
    font-weight: bold;
    box-shadow: 0 8px 20px rgba(79, 70, 229, .25);
}

    .add-account-btn:hover {
        background: #4338ca;
    }





.selected-wrapper > .node-header {
    border: 2px solid #dc2626 !important;
    background: #fee2e2 !important;
    box-shadow: 0 0 0 4px rgba(220,38,38,.15);
}

    .selected-wrapper > .node-header .toggle-btn {
        background: #dc2626 !important;
    }

.account-actions {
    display: flex;
    gap: 10px;
}

.edit-account-btn,
.delete-account-btn {
    border: none;
    border-radius: 14px;
    color: white;
    padding: 12px 22px;
    font-weight: bold;
}

.edit-account-btn {
    background: #0f766e;
}

.delete-account-btn {
    background: #dc2626;
}

    .edit-account-btn:disabled,
    .delete-account-btn:disabled {
        background: #9ca3af;
    }


.collapse-btn {
    border: none;
    border-radius: 14px;
    background: #374151;
    color: white;
    padding: 12px 22px;
    font-weight: bold;
}



.app-shell {
    display: flex;
    min-height: 100vh;
    direction: rtl;
}

.sidebar {
    width: 250px;
    flex-shrink: 0;
}

.main-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}




/* حاوية التبويبات الخارجية لمنع التمدد */
.tabs-wrapper {
    background-color: #f1f3f5;
    border-bottom: 1px solid #dee2e6;
    padding: 5px 10px 0 10px;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden; /* يمنع خروج المحتوى خارج الـ Topbar */
}

/* الحاوية الداخلية التي ستتكفل بالـ Scroll الأفقي */
.tabs-container {
    display: flex;
    flex-direction: row;
    overflow-x: auto; /* هنا تفعيل السكرول الأفقي */
    white-space: nowrap;
    gap: 5px;
    scrollbar-width: thin; /* تحسين شكل السكرول في فيرفوكس */
}

    /* تحسين مظهر شريط السكرول في كروم وإيدج */
    .tabs-container::-webkit-scrollbar {
        height: 4px;
    }

    .tabs-container::-webkit-scrollbar-thumb {
        background: #ccc;
        border-radius: 4px;
    }

/* تصميم التبويب المفرد */
.tab-item {
    display: inline-flex;
    align-items: center;
    background-color: transparent; /* سيأخذ لون خلفية الـ Topbar */
    border: 1px solid #ced4da;
    border-bottom: none;
    padding: 6px 16px;
    border-radius: 4px 4px 0 0;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s;
    font-size: 14px;
}

    .tab-item:hover {
        background-color: #dee2e6;
    }

    /* التبويب النشط حالياً */
    .tab-item.active {
        background-color: #ffffff;
        border-color: #b2b2b2;
        border-bottom: 2px solid #5d5fef; /* نفس لون ثيم نظامك الأزرق */
        font-weight: bold;
    }

/* زر الإغلاق (x) */
.close-tab-btn {
    background: none;
    border: none;
    color: #868e96;
    margin-right: -5px;
    margin-left: 8px;
    font-size: 16px;
    cursor: pointer;
    line-height: 1;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .close-tab-btn:hover {
        background-color: #fa5252;
        color: white;
    }

/* لدعم الـ RTL والـ LTR بشكل متناسق في الـ Flex */
.rtl .tabs-container {
    flex-direction: row;
}

.rtl .close-tab-btn {
    margin-left: -5px;
    margin-right: 8px;
}





.menu-parent{
    width:100%;
    display:flex;
    justify-content:space-between;
    align-items:center;

    padding:12px 14px;
    margin-top:10px;

    color:white;
    font-weight:bold;
    cursor:pointer;

    border-radius:12px;
}

.menu-parent:hover{
    background:rgba(255,255,255,0.14);
}

.submenu{
    width:100%;
    display:flex;
    flex-direction:column;
    gap:10px;

    padding:10px 0 0 12px;
    box-sizing:border-box;
}

.arrow{
    font-size:12px;
}









.currency-page {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 22px;
}

.currency-form,
.currency-list {
    background: white;
    border-radius: 20px;
    padding: 22px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
}

    .currency-form label {
        display: block;
        font-weight: bold;
        margin: 14px 0 7px;
    }

.search-row {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

    .data-table th,
    .data-table td {
        padding: 12px;
        border-bottom: 1px solid #e5e7eb;
        text-align: right;
    }

    .data-table th {
        background: #f3f4f6;
        font-weight: bold;
    }

.selected-row {
    background: #eef2ff;
}

.edit-small-btn,
.delete-small-btn {
    border: none;
    border-radius: 10px;
    padding: 8px 14px;
    color: white;
    font-weight: bold;
    cursor: pointer;
}

.edit-small-btn {
    background: #0f766e;
}

.delete-small-btn {
    background: #dc2626;
}

/* Journal entries — full width (لا تستخدم currency-page هنا) */
.journal-entry-page {
    outline: none;
    width: 100%;
}

.journal-page {
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: 100%;
}

.journal-card {
    background: white;
    border-radius: 20px;
    padding: 22px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
    width: 100%;
    box-sizing: border-box;
}

.journal-card label {
    display: block;
    font-weight: bold;
    margin: 0 0 6px;
    font-size: 13px;
}

.journal-header-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px 18px;
}

.journal-grid-section {
    padding: 0;
    overflow: hidden;
}

.journal-grid-wrap {
    overflow: auto;
    max-height: min(52vh, 520px);
    border-top: 1px solid #e5e7eb;
}

.gcr-entry-page .journal-page {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: calc(100vh - 100px);
    width: 100%;
}

.gcr-entry-page .journal-card:first-of-type {
    flex-shrink: 0;
    min-height: 360px;
}

.gcr-entry-page {
    max-width: none;
}

.gcr-entry-page .journal-card {
    border-radius: 12px;
}

.gcr-entry-page .gcr-tab-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    width: 100%;
}

.gcr-entry-page > .page-header-actions,
.gcr-entry-page .journal-page,
.gcr-entry-page .journal-card {
    max-width: none;
}

.gcr-tab-panel {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.gcr-tab-panel .journal-grid-wrap {
    flex: 1;
    max-height: min(66vh, 760px);
    transition: max-height .2s ease;
    overflow: auto;
    padding-bottom: 8px;
}

.gcr-tab-panel.expanded .journal-grid-wrap {
    max-height: min(86vh, 1100px);
}

.gcr-tab-panel.expanded .gcr-notes-area {
    min-height: 360px;
}

.gcr-currency-totals {
    margin: 8px 0 0;
    white-space: pre-wrap;
    font-family: inherit;
    font-size: 13px;
    text-align: right;
    direction: rtl;
    unicode-bidi: plaintext;
}

.gcr-money-row {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(170px, 190px) minmax(360px, 420px) minmax(260px, 300px);
    gap: 12px;
    justify-content: end;
    align-items: end;
}

.gcr-balance-field,
.gcr-currency-field,
.gcr-local-total-field {
    min-width: 0;
}

.gcr-currency-field .currency-row {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) 130px 58px;
    gap: 8px;
}

.gcr-local-total-field {
    align-self: end;
}

.gcr-local-total-input {
    width: 100%;
    min-width: 260px;
    text-align: center;
    font-weight: 700;
    direction: ltr;
}

@media (max-width: 980px) {
    .gcr-money-row {
        grid-template-columns: 1fr;
        justify-content: stretch;
    }

    .gcr-local-total-input {
        min-width: 0;
    }
}

.page-header-actions .save-btn,
.page-header-actions .collapse-btn,
.page-header-actions .delete-small-btn {
    white-space: nowrap;
    min-width: fit-content;
    padding: 8px 16px;
}

.journal-grid .grid-input {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.journal-grid {
    width: 100%;
    border-collapse: collapse;
    min-width: 1500px;
    table-layout: auto;
}

.journal-grid th,
.journal-grid td {
    padding: 6px 8px;
    border-bottom: 1px solid #e5e7eb;
    text-align: right;
    vertical-align: middle;
    font-size: 13px;
}

.journal-grid thead th {
    background: #1e3a5f;
    color: #fff;
    font-weight: bold;
    position: sticky;
    top: 0;
    z-index: 2;
    white-space: nowrap;
}

.journal-grid th,
.journal-grid td,
.journal-grid .grid-input {
    white-space: nowrap;
}

.gcr-detail-grid {
    min-width: 2450px;
}

.gcr-opposite-grid {
    min-width: 1750px;
}

.gcr-detail-grid th:nth-child(1),
.gcr-detail-grid td:nth-child(1) { width: 48px; min-width: 48px; }
.gcr-detail-grid th:nth-child(2),
.gcr-detail-grid td:nth-child(2) { width: 44px; min-width: 44px; text-align: center; }
.gcr-detail-grid th:nth-child(3),
.gcr-detail-grid td:nth-child(3) { width: 110px; min-width: 110px; }
.gcr-detail-grid th:nth-child(4),
.gcr-detail-grid td:nth-child(4) { width: 150px; min-width: 150px; }
.gcr-detail-grid th:nth-child(5),
.gcr-detail-grid td:nth-child(5) { width: 280px; min-width: 280px; }
.gcr-detail-grid th:nth-child(6),
.gcr-detail-grid td:nth-child(6) { width: 130px; min-width: 130px; }
.gcr-detail-grid th:nth-child(7),
.gcr-detail-grid td:nth-child(7) { width: 115px; min-width: 115px; }
.gcr-detail-grid th:nth-child(8),
.gcr-detail-grid td:nth-child(8),
.gcr-detail-grid th:nth-child(9),
.gcr-detail-grid td:nth-child(9) { width: 135px; min-width: 135px; }
.gcr-detail-grid th:nth-child(10),
.gcr-detail-grid td:nth-child(10) { width: 135px; min-width: 135px; }
.gcr-detail-grid th:nth-child(11),
.gcr-detail-grid td:nth-child(11) { width: 125px; min-width: 125px; }
.gcr-detail-grid th:nth-child(12),
.gcr-detail-grid td:nth-child(12),
.gcr-detail-grid th:nth-child(14),
.gcr-detail-grid td:nth-child(14) { width: 115px; min-width: 115px; }
.gcr-detail-grid th:nth-child(13),
.gcr-detail-grid td:nth-child(13),
.gcr-detail-grid th:nth-child(15),
.gcr-detail-grid td:nth-child(15) { width: 210px; min-width: 210px; }
.gcr-detail-grid th:nth-child(16),
.gcr-detail-grid td:nth-child(16) { width: 180px; min-width: 180px; }
.gcr-detail-grid th:nth-child(17),
.gcr-detail-grid td:nth-child(17) { width: 140px; min-width: 140px; }
.gcr-detail-grid th:nth-child(18),
.gcr-detail-grid td:nth-child(18) { width: 260px; min-width: 260px; }

.gcr-opposite-grid th:nth-child(3),
.gcr-opposite-grid td:nth-child(3) { width: 150px; min-width: 150px; }
.gcr-opposite-grid th:nth-child(4),
.gcr-opposite-grid td:nth-child(4) { width: 280px; min-width: 280px; }
.gcr-opposite-grid th:nth-child(10),
.gcr-opposite-grid td:nth-child(10) { width: 260px; min-width: 260px; }

/* Desktop ERP MenuStrip1 layout */
.erp-shell {
    display: flex !important;
    min-height: 100vh;
    width: 100%;
    background: #eef2f7;
}

.erp-main-content {
    width: 100% !important;
    min-width: 0;
}

.erp-desktop-frame {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #f2f5f9;
    border-bottom: 1px solid #cfd8e3;
}

.erp-titlebar {
    min-height: 34px;
    padding: 4px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #3f3f46;
    color: #fff;
}

.erp-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.erp-brand-mark {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .22);
    font-weight: 800;
}

.erp-brand strong,
.erp-brand small {
    display: block;
    line-height: 1.1;
}

.erp-brand small {
    color: rgba(255, 255, 255, .72);
    font-size: 11px;
    margin-top: 2px;
}

.erp-title-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.erp-mobile-menu-btn {
    display: none;
}

.erp-menu-strip {
    min-height: 32px;
    padding: 0 10px;
    display: flex;
    align-items: stretch;
    justify-content: flex-start;
    background: #ef3034;
    border-bottom: 1px solid #b91c1c;
}

.app-shell.rtl .erp-menu-strip {
    justify-content: flex-start;
}

.erp-menu {
    display: flex !important;
    align-items: stretch;
    gap: 0;
    width: auto;
    direction: inherit;
}

.erp-menu-group {
    position: relative;
    display: flex;
    align-items: stretch;
}

.erp-menu-head {
    border: 0;
    background: transparent;
    color: #fff;
    padding: 0 13px;
    min-height: 32px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.erp-menu-group:hover .erp-menu-head {
    background: #c91f24;
    color: #fff;
}

.erp-menu-dropdown {
    position: absolute;
    top: 100%;
    inset-inline-start: 0;
    display: none;
    min-width: 230px;
    max-height: calc(100vh - 130px);
    overflow: auto;
    padding: 4px;
    background: #fff;
    border: 1px solid #9ca3af;
    box-shadow: 0 12px 24px rgba(15, 23, 42, .18);
    z-index: 500;
}

.erp-menu-dropdown.wide {
    min-width: 270px;
}

.erp-menu-group:hover .erp-menu-dropdown {
    display: block;
}

.erp-menu-dropdown button {
    width: 100%;
    display: block;
    border: 0;
    background: transparent;
    color: #111827;
    text-align: inherit;
    padding: 7px 10px;
    border-radius: 2px;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}

.erp-menu-dropdown button:hover,
.erp-menu-dropdown button:focus {
    background: #2563eb;
    color: #fff;
    outline: none;
}

.erp-menu-dropdown button:disabled {
    color: #9ca3af;
    cursor: default;
    background: transparent;
}

.erp-tabs-wrapper {
    background: #e9edf3 !important;
    border-bottom: 1px solid #cbd5e1;
    padding: 0 10px !important;
}

.erp-page-content {
    width: 100% !important;
    min-width: 0;
    padding: 12px 14px 18px !important;
    overflow: auto;
}

@media (max-width: 991.98px) {
    .erp-mobile-menu-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 32px;
        border: 1px solid rgba(255, 255, 255, .25);
        color: #fff;
        background: rgba(255, 255, 255, .12);
    }

    .erp-menu-strip {
        display: none;
    }

    .erp-mobile-menu {
        display: block;
        max-height: calc(100vh - 118px);
        overflow: auto;
        padding: 10px;
        background: #3f3f46;
    }

    .erp-mobile-menu .erp-menu {
        display: block !important;
    }

    .erp-mobile-menu .erp-menu-group {
        display: block;
        margin-bottom: 6px;
    }

    .erp-mobile-menu .erp-menu-head {
        width: 100%;
        min-height: 40px;
        text-align: inherit;
        background: rgba(255, 255, 255, .1);
        border-radius: 4px;
    }

    .erp-mobile-menu .erp-menu-dropdown {
        position: static;
        display: block;
        min-width: 0;
        box-shadow: none;
        border: 0;
        background: transparent;
    }

    .erp-mobile-menu .erp-menu-dropdown button {
        color: #fff;
    }
}

/* ERP polish layer */
.erp-desktop-frame {
    background: #eef2f7;
    box-shadow: 0 2px 10px rgba(15, 23, 42, .08);
}

.erp-titlebar {
    background: linear-gradient(90deg, #343942 0%, #222b3a 48%, #2d2250 100%);
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.erp-brand strong {
    letter-spacing: .2px;
}

.erp-menu-strip {
    min-height: 34px;
    background: linear-gradient(180deg, #425269 0%, #35445a 100%);
    border-top: 1px solid rgba(255, 255, 255, .08);
    border-bottom: 1px solid #253247;
}

.erp-menu {
    gap: 3px;
}

.erp-menu-head {
    min-height: 46px;
    padding: 0 24px;
    border-radius: 4px 4px 0 0;
    color: #f8fafc;
    font-size: 22px;
    font-weight: 900;
    font-family: Arial, Tahoma, sans-serif;
    letter-spacing: 0;
    transition: background-color .14s ease, color .14s ease, box-shadow .14s ease;
}

.erp-menu-group:hover .erp-menu-head {
    background: #f8fafc;
    color: #1f2937;
    box-shadow: inset 0 3px 0 #5d5fef;
}

.erp-menu-dropdown {
    margin-top: 0;
    min-width: 250px;
    padding: 7px;
    border: 1px solid #b8c2d1;
    border-top: 0;
    border-radius: 0 0 7px 7px;
    background: #ffffff;
    box-shadow: 0 18px 34px rgba(15, 23, 42, .18);
}

.erp-menu-dropdown.wide {
    min-width: 290px;
}

.erp-menu-dropdown button {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 40px;
    padding: 9px 12px;
    border-radius: 5px;
    color: #263244;
    font-size: 17px;
    font-weight: 800;
    transition: background-color .12s ease, color .12s ease, padding-inline-start .12s ease;
}

.erp-menu-dropdown button:hover,
.erp-menu-dropdown button:focus {
    background: #eef2ff;
    color: #312e81;
    padding-inline-start: 13px;
}

.menu-icon {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 22px;
    border-radius: 5px;
    background: #eef2f7;
    color: #46546a;
    font-size: 12px;
    font-weight: 800;
}

.menu-section-title {
    padding: 6px 9px 4px;
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.menu-separator {
    height: 1px;
    margin: 5px 4px;
    background: #e2e8f0;
}

.erp-tabs-wrapper {
    background: #e8edf5 !important;
    padding: 4px 10px 0 !important;
}

.tabs-container {
    gap: 4px;
    min-height: 38px;
}

.tab-item {
    height: 34px;
    padding: 0 13px;
    border: 1px solid #bfcbda;
    border-bottom: 0;
    border-radius: 7px 7px 0 0;
    background: linear-gradient(180deg, #f8fafc 0%, #edf2f7 100%);
    color: #334155;
    box-shadow: inset 0 -1px 0 rgba(148, 163, 184, .28);
    transition: background .14s ease, color .14s ease, border-color .14s ease;
}

.tab-item:hover {
    background: #ffffff;
    color: #1e293b;
    border-color: #94a3b8;
}

.tab-item.active {
    height: 37px;
    background: #ffffff;
    color: #111827;
    border-color: #9aa8ba;
    border-top: 3px solid #5d5fef;
    box-shadow: 0 -1px 6px rgba(15, 23, 42, .08);
}

.close-tab-btn {
    width: 20px;
    height: 20px;
    margin-inline-start: 3px;
    border-radius: 5px;
    color: #64748b;
    transition: background-color .12s ease, color .12s ease;
}

.close-tab-btn:hover {
    background: #fee2e2;
    color: #b91c1c;
}

.page-tabs-bar {
    direction: rtl;
    background: linear-gradient(180deg, #eef3f9 0%, #e6edf6 100%) !important;
    border-top: 1px solid #d9e2ee;
    border-bottom: 1px solid #c9d4e2;
    padding: 8px 14px 0 !important;
    min-height: 54px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);
}

.page-tabs-bar .tabs-container {
    direction: rtl;
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 7px;
    min-height: 45px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 0 6px;
    scrollbar-width: thin;
}

.page-tabs-bar .tabs-container::-webkit-scrollbar {
    height: 6px;
}

.page-tabs-bar .tabs-container::-webkit-scrollbar-thumb {
    background: #b8c4d4;
    border-radius: 999px;
}

.page-tabs-bar .tab-item {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex: 0 0 auto;
    min-width: 150px;
    max-width: 260px;
    height: 37px;
    padding: 0 12px 0 9px;
    border: 1px solid #c6d2e2;
    border-bottom-color: #b7c5d6;
    border-radius: 8px 8px 0 0;
    background: linear-gradient(180deg, #ffffff 0%, #f4f7fb 100%);
    color: #475569;
    font-family: Arial, Tahoma, sans-serif;
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
    cursor: pointer;
    transition: background .14s ease, color .14s ease, border-color .14s ease, box-shadow .14s ease, transform .14s ease;
}

.page-tabs-bar .tab-item:hover {
    background: #ffffff;
    color: #1f2937;
    border-color: #9fb0c7;
    box-shadow: 0 3px 9px rgba(15, 23, 42, .08);
}

.page-tabs-bar .tab-item.active {
    height: 42px;
    background: #ffffff;
    color: #111827;
    border-color: #93a5bd;
    border-top: 4px solid #2563eb;
    border-bottom-color: #ffffff;
    box-shadow: 0 -2px 10px rgba(37, 99, 235, .12);
    transform: translateY(1px);
}

.page-tabs-bar .tab-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.page-tabs-bar .close-tab-btn {
    order: -1;
    width: 22px;
    height: 22px;
    min-width: 22px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #64748b;
    font-size: 16px;
    font-weight: 900;
    line-height: 1;
}

.page-tabs-bar .close-tab-btn:hover {
    background: #fee2e2;
    color: #b91c1c;
}

.page-tabs-bar .tab-item:not(.active) .close-tab-btn {
    opacity: .72;
}

.page-tabs-bar .tab-item:not(.active):hover .close-tab-btn {
    opacity: 1;
}

.erp-page-content {
    background: #f4f7fb;
}

.dashboard-page {
    max-width: none;
}

.dashboard-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 16px;
}

.dashboard-heading h2 {
    margin: 0;
    color: #1f2937;
    font-size: 28px;
    font-weight: 800;
}

.dashboard-heading p {
    margin: 4px 0 0;
    font-size: 13px;
}

.dashboard-period {
    padding: 6px 10px;
    border: 1px solid #d1d9e6;
    border-radius: 6px;
    background: #fff;
    color: #475569;
    font-size: 13px;
    font-weight: 700;
}

.dashboard-grid {
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 14px;
}

.dash-card {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 108px;
    padding: 18px;
    border: 1px solid #dde5ef;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .06);
}

.dash-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(15, 23, 42, .1);
}

.dash-card .dash-icon {
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: #fff;
    font-size: 19px;
    font-weight: 900;
}

.dash-card span {
    display: block;
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
}

.dash-card strong {
    display: block;
    margin-top: 4px;
    color: #111827;
    font-size: 32px;
    line-height: 1;
}

.dash-card.accent-blue .dash-icon { background: #3b5998; }
.dash-card.accent-green .dash-icon { background: #198754; }
.dash-card.accent-violet .dash-icon { background: #5d5fef; }
.dash-card.accent-amber .dash-icon { background: #b7791f; }

@media (max-width: 991.98px) {
    .erp-menu-strip {
        display: none;
    }

    .erp-mobile-menu {
        background: #2f3a4d;
    }

    .erp-mobile-menu .erp-menu-head {
        background: rgba(255, 255, 255, .09);
        color: #fff;
    }

    .erp-mobile-menu .erp-menu-dropdown button {
        color: #e5e7eb;
    }

    .dashboard-heading {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* Keep all MenuStrip dropdowns vertical, especially Accounting */
.erp-menu-dropdown,
.erp-menu-dropdown.wide {
    flex-direction: column !important;
    columns: auto !important;
    column-count: 1 !important;
}

.erp-menu-group:hover .erp-menu-dropdown {
    display: flex !important;
    align-items: stretch !important;
    gap: 2px !important;
}

.erp-menu-dropdown button,
.erp-menu-dropdown .menu-section-title,
.erp-menu-dropdown .menu-separator {
    width: 100%;
}

/* Inventory ERP module */
.inventory-header h2 {
    margin-bottom: 2px;
}

.inventory-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.inventory-workspace {
    padding: 14px;
}

.inventory-filterbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.inventory-filterbar .form-control {
    min-width: 190px;
    max-width: 320px;
}

.erp-grid-wrap {
    overflow: auto;
    border: 1px solid #d8e0ea;
    border-radius: 6px;
    background: #fff;
}

.inventory-items-workspace .erp-grid-wrap {
    max-height: calc(100vh - 245px);
}

.inventory-load-more-sentinel {
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-weight: 700;
}

.erp-data-grid {
    min-width: 980px;
}

.erp-data-grid th {
    position: sticky;
    top: 0;
    background: #eef3f8;
    color: #1f2937;
    z-index: 1;
    white-space: nowrap;
}

.erp-data-grid td {
    white-space: nowrap;
}

.ltr-cell {
    direction: ltr;
    text-align: left;
}

.inventory-card-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 250px;
    gap: 12px;
    align-items: stretch;
    margin-bottom: 12px;
}

.inventory-form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(170px, 1fr));
    gap: 10px 12px;
}

.inventory-form-grid.compact {
    grid-template-columns: repeat(6, minmax(140px, 1fr));
}

.inventory-note-field {
    grid-column: span 2;
}

.item-image-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.item-image-box {
    height: 180px;
    border: 1px dashed #b8c2d1;
    border-radius: 8px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    overflow: hidden;
}

.item-image-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.inventory-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.inventory-settings-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 10px;
}

.inventory-split {
    display: grid;
    grid-template-columns: minmax(320px, .8fr) minmax(0, 1.2fr);
    gap: 12px;
}

.inventory-directory {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 12px;
}

.directory-tree {
    max-height: calc(100vh - 190px);
    overflow: auto;
}

.directory-node {
    width: 100%;
    border: 1px solid #d8e0ea;
    background: #fff;
    color: #263244;
    padding: 8px 10px;
    margin-top: 6px;
    border-radius: 6px;
    text-align: inherit;
}

.directory-node:hover,
.directory-node.active {
    background: #eef2ff;
    border-color: #aeb9ff;
    color: #312e81;
}

.empty-erp-state {
    min-height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #64748b;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
}

.empty-erp-state strong {
    color: #1f2937;
    font-size: 20px;
}

@media (max-width: 1100px) {
    .inventory-card-layout,
    .inventory-split,
    .inventory-directory {
        grid-template-columns: 1fr;
    }

    .inventory-form-grid,
    .inventory-form-grid.compact,
    .inventory-settings-grid {
        grid-template-columns: repeat(2, minmax(160px, 1fr));
    }
}

@media (max-width: 700px) {
    .inventory-form-grid,
    .inventory-form-grid.compact,
    .inventory-settings-grid {
        grid-template-columns: 1fr;
    }

    .inventory-note-field {
        grid-column: auto;
    }
}

.journal-grid tbody tr:hover {
    background: #f8fafc;
}

.journal-grid .col-num { width: 40px; text-align: center; }
.journal-grid .col-code { width: 100px; }
.journal-grid .col-name { width: 220px; }
.journal-grid .col-amount { width: 110px; }
.journal-grid .col-note { width: 160px; }
.journal-grid .col-job { width: 130px; }
.journal-grid .col-currency { width: 100px; }
.journal-grid .col-rate { width: 80px; }
.journal-grid .col-vat { width: 100px; }
.journal-grid .col-vat-date { width: 120px; }
.journal-grid .col-vat-flag { width: 70px; text-align: center; }
.journal-grid .col-action { width: 44px; text-align: center; }

.journal-grid-hint {
    padding: 8px 16px;
    font-size: 12px;
    color: #64748b;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
}

.currency-cell-btn {
    cursor: pointer;
    background: #f0f9ff !important;
}

.grid-input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 13px;
    background: #fff;
}

.grid-input:focus {
    border-color: #4f46e5;
    outline: none;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, .15);
}

.grid-input[readonly] {
    background: #f9fafb;
}

.journal-grid .grid-input:disabled,
.journal-grid .grid-input.detail-cell-disabled {
    background: #d9d9d9 !important;
    color: #6b7280;
    border-color: #bdbdbd;
    cursor: not-allowed;
    opacity: 1;
}

.journal-grid .grid-input.detail-cell-disabled[readonly] {
    background: #d9d9d9 !important;
}

.journal-totals-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    padding: 14px 22px;
    background: #f1f5f9;
    border-top: 2px solid #cbd5e1;
}

.journal-total-box {
    display: flex;
    flex-direction: column;
    min-width: 120px;
}

.journal-total-box span {
    font-size: 12px;
    color: #64748b;
    font-weight: bold;
}

.journal-total-box strong {
    font-size: 18px;
    color: #0f172a;
}

.journal-total-box.diff strong {
    color: #dc2626;
}

.journal-total-box.diff.balanced strong {
    color: #059669;
}

.totals-row {
    background: #f1f5f9;
}

.balance-ok {
    color: #059669;
    font-weight: bold;
}

.balance-bad {
    color: #dc2626;
    font-weight: bold;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: bold;
}

.status-badge.saved {
    background: #fef3c7;
    color: #92400e;
}

.status-badge.posted {
    background: #d1fae5;
    color: #065f46;
}

.clickable-row {
    cursor: pointer;
}

.clickable-row:hover {
    background: #f8fafc;
}

.account-suggest {
    position: absolute;
    z-index: 50;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 8px 24px rgba(0,0,0,.1);
    min-width: 280px;
}

.suggest-item {
    padding: 8px 12px;
    cursor: pointer;
}

.suggest-item:hover {
    background: #eef2ff;
}

.msg-success {
    color: #059669;
    font-weight: bold;
}

.msg-error {
    color: #dc2626;
    font-weight: bold;
}

.msg-info {
    color: #2563eb;
}



.currency-row {
    display: flex;
    gap: 8px;
}

.currency-name {
    width: 70px;
}

.currency-rate {
    width: 120px;
    min-width: 120px;
}

/* Inventory item card - WinForms-like ERP layout */
.item-vb-page {
    min-height: calc(100vh - 92px);
    background: #f3f6fb;
    color: #111827;
    font-size: 13px;
    direction: inherit;
}

.item-vb-toolbar {
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 8px;
    background: #eef2f7;
    border: 1px solid #cfd8e3;
    border-radius: 4px 4px 0 0;
}

.item-vb-toolbar-left,
.item-vb-toolbar-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.erp-tool-btn {
    min-width: 72px;
    height: 30px;
    border: 1px solid #aab5c4;
    border-radius: 3px;
    background: linear-gradient(180deg, #ffffff 0%, #e7edf5 100%);
    color: #111827;
    font-weight: 700;
    cursor: pointer;
    padding: 0 10px;
}

.erp-tool-btn:hover:not(:disabled) {
    background: #dde7f5;
    border-color: #7d8ca0;
}

.erp-tool-btn.success {
    background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
    border-color: #15803d;
    color: #fff;
}

.erp-tool-btn.danger {
    background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
    border-color: #b91c1c;
    color: #fff;
}

.erp-tool-btn.muted {
    background: #e5e7eb;
    color: #475569;
}

.item-vb-frame {
    border: 1px solid #bfc9d7;
    background: #fff;
    min-height: calc(100vh - 150px);
    position: relative;
}

.item-vb-title {
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #4b3f91;
    color: #fff;
    font-size: 20px;
    font-weight: 800;
}

.item-vb-body {
    width: 100%;
    margin: 18px 0 10px;
    display: grid;
    grid-template-columns: 470px minmax(680px, 1fr);
    gap: 10px;
    align-items: start;
    padding-inline: 8px;
    box-sizing: border-box;
}

.app-shell.rtl .item-vb-body {
    direction: rtl;
}

.app-shell.ltr .item-vb-body {
    direction: ltr;
}

.item-vb-side-form,
.item-vb-work-area,
.item-vb-footer {
    border: 1px solid #d5dce6;
    background: #fbfcfe;
    padding: 10px;
}

.erp-field-row {
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: center;
    margin-bottom: 7px;
}

.app-shell.rtl .erp-field-row {
    flex-direction: row;
}

.erp-field-row label {
    flex: 0 0 136px;
    margin: 0;
    padding: 5px 8px;
    background: #eef1f5;
    color: #111827;
    font-weight: 800;
    text-align: left;
    white-space: nowrap;
}

.erp-field-row > :not(label) {
    flex: 1 1 auto;
    min-width: 0;
}

.app-shell.rtl .erp-field-row label {
    text-align: right;
}

.app-shell.rtl .erp-field-row .form-control,
.app-shell.rtl .item-vb-notes-row .form-control {
    text-align: right;
}

.app-shell.rtl .erp-field-row .ltr-cell,
.app-shell.rtl .item-vb-grid .ltr-cell {
    text-align: left;
}

.erp-field-row .form-control,
.item-vb-page .form-control {
    height: 30px;
    min-height: 30px;
    border-radius: 2px;
    padding: 3px 8px;
    font-size: 13px;
}

.item-barcode-row {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 6px;
}

.app-shell.ltr .item-barcode-row {
    grid-template-columns: 76px minmax(0, 1fr);
}

.category-picker-row {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 6px;
}

.app-shell.ltr .category-picker-row {
    grid-template-columns: minmax(0, 1fr) 38px;
}

.barcode-field-row .form-control {
    min-width: 0;
}

.barcode-field-row .erp-square-btn {
    width: 76px;
    min-width: 76px;
    padding: 0 6px;
    font-size: 11px;
}

.erp-square-btn {
    height: 30px;
    border: 1px solid #7f8ea3;
    background: #f8fafc;
    font-weight: 700;
    font-size: 12px;
}

.item-price-box {
    margin-top: 12px;
    border: 1px solid #d5dce6;
    padding: 12px 8px 6px;
}

.item-price-box legend {
    float: none;
    width: auto;
    margin: 0;
    padding: 0 8px;
    color: #111827;
    font-size: 13px;
    font-weight: 800;
}

.item-vb-notes-row {
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: start;
}

.app-shell.ltr .item-vb-notes-row {
    flex-direction: row;
}

.item-vb-notes-row label {
    flex: 0 0 90px;
    padding: 6px 8px;
    margin: 0;
    background: #eef1f5;
    font-weight: 800;
}

.item-vb-notes-row textarea {
    flex: 1 1 auto;
    min-width: 0;
    height: 74px;
    resize: vertical;
}

.item-vb-tabs {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    margin-top: 8px;
    border-bottom: 1px solid #aeb8c8;
}

.item-vb-tabs button {
    min-width: 72px;
    height: 28px;
    border: 1px solid #aeb8c8;
    border-bottom: 0;
    background: #eef2f7;
    font-weight: 800;
}

.item-vb-tabs button.active {
    background: #fff;
    color: #312e81;
}

.item-vb-grid-wrap {
    max-height: 285px;
    overflow: auto;
    border: 1px solid #aeb8c8;
    border-top: 0;
}

.item-vb-grid {
    min-width: 980px;
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.item-vb-grid th:nth-child(1),
.item-vb-grid td:nth-child(1) {
    width: 62px;
}

.item-vb-grid th:nth-child(2),
.item-vb-grid td:nth-child(2) {
    width: 210px;
}

.item-vb-grid th:nth-child(3),
.item-vb-grid td:nth-child(3) {
    width: 170px;
}

.item-vb-grid th {
    background: #4b3f91;
    color: #fff;
    height: 30px;
    font-size: 12px;
    border: 1px solid #cfd8e3;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 1;
}

.item-vb-grid td {
    height: 29px;
    border: 1px solid #c0c8d4;
    background: #eef9f7;
    padding: 0;
}

.item-vb-grid tr:nth-child(even) td {
    background: #fff;
}

.item-vb-grid .grid-input {
    height: 28px;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.grid-delete-btn {
    width: 100%;
    height: 28px;
    border: 0;
    background: #f8fafc;
    font-size: 12px;
    font-weight: 700;
}

.grid-delete-btn:hover {
    background: #fee2e2;
    color: #b91c1c;
}

.item-image-panel {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 12px;
    padding-top: 10px;
    align-items: center;
}

.item-image-panel .item-image-box {
    height: 170px;
}

.item-settings-panel {
    display: grid;
    grid-template-columns: repeat(3, minmax(150px, 1fr));
    gap: 10px;
    padding: 18px 4px 4px;
}

.item-settings-panel label {
    border: 1px solid #d5dce6;
    background: #fff;
    padding: 10px;
    font-weight: 800;
}

.item-vb-footer {
    width: 100%;
    margin: 10px 0 24px;
    display: grid;
    grid-template-columns: repeat(4, minmax(210px, 1fr));
    gap: 8px 12px;
    padding-inline: 8px;
    box-sizing: border-box;
}

.erp-field-row.compact {
    margin-bottom: 0;
}

.erp-field-row.compact label {
    flex-basis: 130px;
}

.readonly-money {
    background: #e9edf2 !important;
    color: #111827;
    font-weight: 800;
    text-align: center;
    direction: ltr;
}

.opening-balance-field .form-control {
    border-color: #9387dd;
    box-shadow: inset 3px 0 0 #4b3f91;
}

.opening-balance-overlay {
    position: absolute;
    inset: 58px 12px 12px;
    background: rgba(15, 23, 42, .18);
    z-index: 20;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 42px;
}

.bill-entry-page .journal-card {
    border-radius: 4px;
}

.bill-header-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(150px, 1fr));
    gap: 8px 10px;
    align-items: end;
}

.bill-header-grid label,
.bill-totals-row label {
    font-size: 12px;
    font-weight: 700;
    color: #1b2535;
    margin-bottom: 3px;
}

.bill-grid-card {
    margin-top: 8px;
}

.bill-grid-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.bill-items-grid {
    min-width: 1280px;
}

.bill-items-grid th:nth-child(2) { min-width: 150px; }
.bill-items-grid th:nth-child(3) { min-width: 300px; }
.bill-items-grid th:nth-child(4),
.bill-items-grid th:nth-child(5),
.bill-items-grid th:nth-child(6),
.bill-items-grid th:nth-child(9),
.bill-items-grid th:nth-child(10) { min-width: 110px; }

.bill-total-card {
    margin-top: 8px;
}

.bill-totals-row {
    display: grid;
    grid-template-columns: auto minmax(120px, 180px) auto minmax(120px, 160px) auto minmax(120px, 160px) auto minmax(140px, 190px);
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.bill-totals-row .total-input {
    background: #0b7f73;
    color: #fff;
    font-weight: 800;
}

.bill-item-picker {
    width: min(1120px, 96vw);
}

.item-picker-filters {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 8px;
    margin-bottom: 8px;
}

.modal-grid {
    max-height: 520px;
}

.bills-grid-wrap {
    min-height: 520px;
}

@media (max-width: 1100px) {
    .bill-header-grid {
        grid-template-columns: repeat(2, minmax(140px, 1fr));
    }

    .bill-totals-row {
        grid-template-columns: auto 1fr;
    }
}

.erp-item-picker {
    width: clamp(75vw, 82vw, 85vw);
    height: min(86vh, 880px);
    max-height: 88vh;
    border-radius: 10px;
    border: 1px solid #9aa8bd;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .34);
    background: #f5f7fb;
    overflow: hidden;
}

.erp-picker-topbar {
    height: 58px;
    display: grid;
    grid-template-columns: 1fr auto 44px;
    align-items: center;
    gap: 14px;
    padding: 0 16px;
    color: #fff;
    background: linear-gradient(90deg, #1e3a5f, #4f3f93);
    border-bottom: 1px solid rgba(255,255,255,.16);
}

.erp-picker-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.erp-picker-title h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 900;
}

.erp-picker-title-icon {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(255,255,255,.16);
    font-size: 21px;
}

.erp-picker-count {
    min-width: 130px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,.14);
    text-align: center;
    font-weight: 900;
}

.erp-picker-close {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255,255,255,.12);
    color: #fff;
    font-size: 26px;
    line-height: 1;
}

.erp-picker-close:hover {
    background: #dc2626;
}

.erp-item-picker-toolbar {
    display: grid;
    grid-template-columns: minmax(190px, .9fr) minmax(260px, 1.35fr) minmax(190px, .75fr) minmax(150px, .55fr);
    gap: 10px;
    margin: 0;
    padding: 12px 14px;
    background: #eef3f9;
    border: 0;
    border-bottom: 1px solid #cad6e6;
}

.erp-item-picker-toolbar label {
    display: grid;
    gap: 5px;
    margin: 0;
    color: #1f2937;
    font-size: 12px;
    font-weight: 900;
}

.erp-item-picker-toolbar .search-box {
    width: 100%;
    height: 38px;
    margin: 0;
    padding: 6px 12px;
    border: 1px solid #b8c5d6;
    border-radius: 9px;
    background: #fff;
    color: #111827;
    font-size: 14px;
    font-weight: 700;
    outline: none;
}

.erp-item-picker-toolbar .search-box:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .14);
}

.erp-item-picker .modal-grid {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    margin: 0;
    background: #fff;
    border-top: 1px solid #d9e2ef;
    overflow: auto;
}

.erp-item-picker-grid {
    width: max(1240px, 100%);
    min-width: 1240px;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    direction: rtl;
    background: #fff;
}

.erp-item-picker-grid th {
    position: sticky;
    top: 0;
    z-index: 5;
    height: 38px;
    padding: 8px 10px;
    background: #1f3f68;
    color: #fff;
    border: 0;
    border-left: 1px solid rgba(255,255,255,.2);
    text-align: right;
    font-size: 13px;
    font-weight: 900;
    white-space: nowrap;
}

.erp-item-picker-grid td {
    height: 34px;
    padding: 6px 10px;
    border: 0;
    border-bottom: 1px solid #d9e2ef;
    border-left: 1px solid #e4ebf4;
    color: #111827;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: #fff;
}

.erp-item-picker-grid tbody tr:nth-child(even) td {
    background: #f2f7fb;
}

.erp-item-picker-grid tbody tr:hover td {
    background: #e0efff;
    color: #0f172a;
}

.erp-item-picker-grid tbody tr.selected td {
    background: #2563eb;
    color: #fff;
}

.erp-item-picker-grid .lookup-name {
    width: auto;
    min-width: 300px;
    font-weight: 900;
}

.erp-item-picker-grid .barcode-cell {
    color: #0f766e;
}

.erp-item-picker-grid tbody tr.selected .barcode-cell {
    color: #fff;
}

.erp-item-picker-grid .num-cell,
.erp-item-picker-grid .ltr-cell {
    direction: ltr;
    text-align: left;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.erp-item-picker-grid th:nth-child(1) { width: 180px; }
.erp-item-picker-grid th:nth-child(2) { width: 360px; }
.erp-item-picker-grid th:nth-child(3) { width: 170px; }
.erp-item-picker-grid th:nth-child(4) { width: 110px; }
.erp-item-picker-grid th:nth-child(5),
.erp-item-picker-grid th:nth-child(6),
.erp-item-picker-grid th:nth-child(7),
.erp-item-picker-grid th:nth-child(8) { width: 135px; }

@media (max-width: 760px) {
    .modal-overlay:has(.erp-item-picker) {
        align-items: stretch;
        justify-content: flex-start;
    }

    .erp-item-picker {
        width: min(94vw, 460px);
        height: 100vh;
        max-height: 100vh;
        border-radius: 0 14px 14px 0;
        animation: erpItemPickerSlideIn .18s ease-out;
    }

    .erp-picker-topbar {
        grid-template-columns: 1fr 44px;
        height: auto;
        min-height: 58px;
    }

    .erp-picker-count {
        grid-column: 1 / -1;
        justify-self: stretch;
    }

    .erp-item-picker-toolbar {
        grid-template-columns: 1fr;
    }
}

@keyframes erpItemPickerSlideIn {
    from { transform: translateX(-24px); opacity: .85; }
    to { transform: translateX(0); opacity: 1; }
}

.account-statement-page {
    display: grid;
    gap: 10px;
}

.report-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.account-report-actions {
    gap: 5px;
}

.account-report-actions .save-btn,
.account-report-actions .collapse-btn {
    min-height: 30px;
    height: 30px;
    min-width: 54px;
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1;
}

.account-statement-filter {
    border-top: 4px solid #4f3f93;
    padding: 12px 16px;
}

.statement-filter-grid {
    display: grid;
    grid-template-columns: minmax(180px, 240px) minmax(260px, 1fr) minmax(180px, 240px) minmax(260px, 1fr);
    gap: 8px 10px;
    align-items: end;
}

.statement-filter-grid label {
    display: block;
    margin-bottom: 4px;
    color: #111827;
    font-size: 12px;
    font-weight: 900;
}

.statement-date-stack {
    display: grid;
    gap: 6px;
    align-self: stretch;
}

.statement-checks {
    display: flex;
    align-items: center;
    gap: 18px;
    min-height: 34px;
    font-weight: 900;
}

.account-statement-filter .form-control {
    height: 34px;
    min-height: 34px;
    padding-block: 5px;
}

.account-statement-filter .square-picker-btn {
    width: 46px;
    min-width: 46px;
    height: 34px;
    min-height: 34px;
}

.statement-checks label {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0;
}

.statement-summary {
    display: grid;
    grid-template-columns: repeat(6, minmax(130px, 1fr));
    gap: 10px;
}

.statement-summary div {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border: 1px solid #c7d2e2;
    border-radius: 6px;
    background: #f8fafc;
}

.statement-summary span {
    color: #334155;
    font-size: 12px;
    font-weight: 900;
}

.statement-summary strong {
    direction: ltr;
    text-align: left;
    color: #0f766e;
    font-size: 20px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.statement-grid-wrap {
    max-height: calc(100vh - 360px);
    min-height: 340px;
    overflow: auto;
}

.statement-grid {
    min-width: 1500px;
}

.account-statement-result-grid th,
.account-statement-result-grid td {
    white-space: nowrap;
    text-align: center;
    vertical-align: middle;
    padding-inline: 8px;
}

.account-statement-result-grid .num-cell {
    text-align: center;
}

.account-statement-result-grid .statement-source-row {
    cursor: pointer;
}

.account-statement-result-grid .statement-source-row:hover td {
    background: #dbeafe !important;
}

.account-statement-result-grid td:nth-child(7) {
    min-width: 260px;
    white-space: normal;
    text-align: right;
}

.account-statement-result-grid .statement-detail-head td {
    background: #dbeafe !important;
    color: #1e3a5f;
    font-weight: 900;
    border-top: 1px solid #93c5fd;
    border-bottom: 1px solid #93c5fd;
}

.account-statement-result-grid .statement-detail-row td {
    background: #f8fbff !important;
    color: #334155;
    font-size: 12px;
    border-bottom: 1px dashed #cbd5e1;
}

.account-statement-result-grid .statement-detail-row td:nth-child(7) {
    padding-inline-start: 22px;
}

.account-statement-print-area {
    display: none;
}

@media print {
    @page {
        size: A4 portrait;
        margin: 10mm;
    }

    body:has(.account-statement-print-area) * {
        visibility: hidden !important;
    }

    body:has(.account-statement-print-area) .account-statement-print-area,
    body:has(.account-statement-print-area) .account-statement-print-area * {
        visibility: visible !important;
    }

    body:has(.account-statement-print-area) .account-statement-print-area {
        display: block !important;
        position: static !important;
        width: 100%;
        min-height: 0 !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        background: #fff;
        color: #000;
        font-family: "Tahoma", "Arial", sans-serif;
        font-size: 11px;
        line-height: 1.45;
        break-after: avoid !important;
        page-break-after: avoid !important;
    }

    body:has(.account-statement-print-area) .account-statement-page {
        display: block !important;
        visibility: visible !important;
        padding: 0 !important;
        margin: 0 !important;
        min-height: 0 !important;
        height: auto !important;
        overflow: visible !important;
    }

    body:has(.account-statement-print-area) .account-statement-page > :not(.account-statement-print-area) {
        display: none !important;
    }

    .print-company-header {
        display: grid;
        grid-template-columns: 1fr 1.2fr 1fr;
        gap: 12px;
        align-items: end;
        border-bottom: 2px solid #111;
        padding-bottom: 8px;
        margin-bottom: 8px;
    }

    .print-company-side {
        display: grid;
        gap: 3px;
        font-size: 11px;
        font-weight: 700;
        text-align: right;
    }

    .print-company-side.left {
        text-align: left;
        direction: ltr;
    }

    .print-company-side img {
        max-width: 82px;
        max-height: 54px;
        object-fit: contain;
        margin-bottom: 4px;
    }

    .print-title-block {
        display: grid;
        gap: 4px;
        text-align: center;
        font-weight: 700;
    }

    .print-title-block h1 {
        margin: 0;
        font-size: 16px;
        font-weight: 900;
    }

    .print-report-meta {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        margin: 8px 0 10px;
    }

    .print-account-box,
    .print-extra-box {
        border: 1.5px solid #111;
        padding: 7px 10px;
        display: grid;
        gap: 5px;
    }

    .print-account-box div,
    .print-extra-box div {
        display: grid;
        grid-template-columns: 86px 1fr;
        gap: 8px;
        align-items: center;
    }

    .print-account-box span,
    .print-extra-box span {
        font-weight: 800;
    }

    .print-account-box strong,
    .print-extra-box strong {
        text-align: right;
        font-weight: 900;
    }

    .print-statement-table {
        width: 100%;
        max-width: 180mm;
        border-collapse: collapse;
        table-layout: fixed;
        direction: rtl;
        box-sizing: border-box;
        margin-inline: auto;
    }

    .print-statement-table.without-account-col.without-note-col .print-col-number { width: 7%; }
    .print-statement-table.without-account-col.without-note-col .print-col-date { width: 13%; }
    .print-statement-table.without-account-col.without-note-col .print-col-money { width: 12%; }
    .print-statement-table.without-account-col.without-note-col .print-col-type { width: 35%; }
    .print-statement-table.without-account-col.without-note-col .print-col-status { width: 9%; }

    .print-statement-table.without-account-col.with-note-col .print-col-number { width: 6%; }
    .print-statement-table.without-account-col.with-note-col .print-col-date { width: 10%; }
    .print-statement-table.without-account-col.with-note-col .print-col-money { width: 10%; }
    .print-statement-table.without-account-col.with-note-col .print-col-note { width: 26%; }
    .print-statement-table.without-account-col.with-note-col .print-col-type { width: 20%; }
    .print-statement-table.without-account-col.with-note-col .print-col-status { width: 8%; }

    .print-statement-table.with-account-col.without-note-col .print-col-number { width: 6%; }
    .print-statement-table.with-account-col.without-note-col .print-col-date { width: 10%; }
    .print-statement-table.with-account-col.without-note-col .print-col-account { width: 14%; }
    .print-statement-table.with-account-col.without-note-col .print-col-money { width: 10%; }
    .print-statement-table.with-account-col.without-note-col .print-col-type { width: 29%; }
    .print-statement-table.with-account-col.without-note-col .print-col-status { width: 11%; }

    .print-statement-table.with-account-col.with-note-col .print-col-number { width: 5%; }
    .print-statement-table.with-account-col.with-note-col .print-col-date { width: 9%; }
    .print-statement-table.with-account-col.with-note-col .print-col-account { width: 12%; }
    .print-statement-table.with-account-col.with-note-col .print-col-money { width: 9%; }
    .print-statement-table.with-account-col.with-note-col .print-col-note { width: 24%; }
    .print-statement-table.with-account-col.with-note-col .print-col-type { width: 17%; }
    .print-statement-table.with-account-col.with-note-col .print-col-status { width: 6%; }

    .print-statement-table th,
    .print-statement-table td {
        border: 1px solid #111;
        padding: 3px 4px;
        text-align: center;
        vertical-align: middle;
        word-break: normal;
        overflow-wrap: anywhere;
        box-sizing: border-box;
        font-size: 10.5px;
    }

    .print-statement-table th {
        background: #f1f5f9 !important;
        font-weight: 900;
    }

    .print-statement-table td:nth-child(7),
    .print-statement-table td:nth-child(8) {
        text-align: right;
    }

    .print-statement-table .num-cell {
        direction: ltr;
        font-weight: 800;
        text-align: center;
    }

    .print-opening-row td,
    .print-total-row td {
        font-weight: 900;
        background: #f8fafc !important;
    }

    .print-detail-row td {
        font-size: 10px;
    }

    .print-detail-cell {
        padding: 0 !important;
        background: #fff !important;
    }

    .print-detail-cell table {
        width: 100%;
        border-collapse: collapse;
        table-layout: fixed;
    }

    .print-detail-cell table th:first-child,
    .print-detail-cell table td:first-child {
        width: 64%;
        text-align: right;
    }

    .print-detail-cell th,
    .print-detail-cell td {
        border: 0;
        border-inline-start: 1px solid #111;
        border-bottom: 1px solid #111;
        padding: 3px 4px;
        font-size: 10px;
    }

    .print-detail-cell th {
        background: #f8fafc !important;
        font-weight: 900;
    }

    .print-footer-row {
        display: flex;
        align-items: flex-end;
        justify-content: space-between;
        gap: 20px;
        margin-top: 10px;
        font-weight: 800;
    }

    .print-footer-row img {
        max-width: 110px;
        max-height: 70px;
        object-fit: contain;
    }
}

.statement-grid th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #1f3f68;
    color: #fff;
}

.statement-grid td {
    height: 30px;
    font-weight: 700;
}

.statement-grid tbody tr:nth-child(even) td {
    background: #f2f7fb;
}

.statement-grid tbody tr:hover td {
    background: #e0efff;
}

.statement-grid .opening-row td {
    background: #fff7ed !important;
    font-weight: 900;
}

.statement-grid .num-cell {
    direction: ltr;
    text-align: left;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.statement-grid .debit {
    color: #166534;
}

.statement-grid .credit {
    color: #991b1b;
}

.statement-grid .balance {
    color: #1d4ed8;
}

@media (max-width: 1100px) {
    .statement-filter-grid,
    .statement-summary {
        grid-template-columns: repeat(2, minmax(150px, 1fr));
    }
}

.opening-balance-dialog {
    width: min(980px, calc(100vw - 80px));
    max-height: min(620px, calc(100vh - 190px));
    background: #fff;
    border: 1px solid #9aa8bb;
    box-shadow: 0 18px 35px rgba(15, 23, 42, .2);
    display: flex;
    flex-direction: column;
}

.opening-balance-head,
.opening-balance-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 10px;
    background: #eef2f7;
    border-bottom: 1px solid #cbd5e1;
}

.opening-balance-head strong {
    font-size: 15px;
    color: #111827;
}

.opening-balance-actions {
    justify-content: flex-start;
    background: #fff;
}

.opening-balance-actions span {
    min-width: 150px;
    font-weight: 800;
}

.opening-store-picker {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-weight: 800;
}

.opening-store-picker .form-control {
    width: 180px;
    height: 30px;
    padding: 2px 8px;
}

.opening-balance-grid-wrap {
    overflow: auto;
    padding: 10px;
}

.opening-balance-grid {
    min-width: 860px;
}

.item-lookup-page {
    direction: rtl;
    height: calc(100vh - 120px);
    background: #f3f6fa;
    border: 1px solid #b9c5d4;
    display: flex;
    flex-direction: column;
    font-size: 13px;
}

.item-lookup-topbar {
    height: 34px;
    background: #4b3f91;
    color: #fff;
    display: grid;
    grid-template-columns: 220px 1fr 220px;
    align-items: center;
    gap: 12px;
    padding: 0 10px;
    font-weight: 800;
}

.item-lookup-title {
    text-align: center;
    font-size: 16px;
}

.item-lookup-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.item-lookup-status .form-control {
    height: 24px;
    padding: 1px 6px;
}

.item-lookup-filters {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(230px, .8fr) minmax(260px, .9fr) minmax(260px, 1fr);
    gap: 8px 12px;
    padding: 8px 10px;
    background: #fff;
    border-bottom: 1px solid #c8d3e0;
    align-items: end;
}

.lookup-filter label {
    display: block;
    font-weight: 800;
    margin-bottom: 4px;
}

.bills-list-page .item-lookup-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    align-items: end;
}

.bills-list-page .item-lookup-filters .erp-tool-btn {
    width: 150px;
    flex: 0 0 150px;
}

.bills-list-page .bill-status-filter {
    width: 180px;
    flex: 0 0 180px;
}

.bills-list-page .lookup-filter {
    width: 190px;
    flex: 0 0 190px;
}

.bills-list-page .lookup-filter:not(.compact-date):not(.bill-status-filter) {
    width: 230px;
    flex-basis: 230px;
}

.lookup-filter .form-control,
.lookup-shelf-filters .form-control {
    height: 28px;
    border-radius: 0;
    border-color: #aeb9c7;
    font-size: 13px;
}

.lookup-checks {
    display: grid;
    gap: 4px;
    align-content: end;
    font-weight: 800;
}

.lookup-checks label {
    margin: 0;
}

.lookup-shelf-filters {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(160px, 220px));
    gap: 8px;
    justify-content: start;
}

.item-lookup-grid-wrap {
    flex: 1 1 auto;
    min-height: 360px;
    overflow: auto;
    background: #f7f8fa;
}

.item-lookup-grid {
    width: max(1300px, 100%);
    border-collapse: collapse;
    table-layout: fixed;
    background: #fff;
}

.item-lookup-grid th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #4b3f91;
    color: #fff;
    border: 1px solid #c8d3e0;
    padding: 6px 8px;
    text-align: right;
    white-space: nowrap;
}

.item-lookup-grid td {
    border: 1px solid #b7c1cf;
    padding: 4px 7px;
    height: 24px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-lookup-grid tbody tr:nth-child(even) td {
    background: #eaf8f8;
}

.item-lookup-grid tbody tr:hover td,
.item-lookup-grid tbody tr.selected td {
    background: #0d86d9;
    color: #fff;
}

.lookup-name {
    width: 360px;
}

.num-cell {
    text-align: left;
    direction: ltr;
}

.lookup-empty {
    text-align: center !important;
    padding: 24px !important;
    color: #64748b;
}

.item-lookup-footer {
    min-height: 54px;
    padding: 7px 10px;
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fff;
    border-top: 1px solid #c8d3e0;
    font-weight: 800;
}

.btn-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.item-lookup-actions {
    margin-right: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.item-lookup-actions .erp-tool-btn {
    min-width: 104px;
}

@media (max-width: 900px) {
    .item-lookup-topbar {
        grid-template-columns: 1fr;
        height: auto;
        padding: 8px;
    }

    .item-lookup-filters {
        grid-template-columns: 1fr;
    }

    .lookup-shelf-filters {
        grid-template-columns: 1fr;
    }
}

.item-vb-frame .msg-success,
.item-vb-frame .msg-error,
.item-vb-frame .msg-info {
    width: calc(100% - 16px);
    margin: 8px 8px 16px;
    padding: 8px 10px;
    border-radius: 4px;
    background: #fff;
    border: 1px solid currentColor;
}

.add-unit-btn {
    margin-top: 7px;
    width: auto;
}

@media (max-width: 1050px) {
    .item-vb-body,
    .item-vb-footer {
        width: 100%;
    }

    .item-vb-body {
        grid-template-columns: 1fr;
    }

    .item-vb-footer {
        grid-template-columns: repeat(2, minmax(210px, 1fr));
    }
}

@media (max-width: 640px) {
    .item-vb-footer {
        grid-template-columns: 1fr;
    }

    .erp-field-row,
    .erp-field-row.compact,
    .item-vb-notes-row,
    .item-image-panel {
        grid-template-columns: 1fr;
    }
}

.bill-entry-page {
    --bill-line: #b7c4d6;
    --bill-head: #4e4392;
    --bill-soft: #eef4f8;
    padding-bottom: 14px;
}

.bill-entry-page .page-header-actions {
    margin-bottom: 12px;
}

.bill-entry-page .page-header-actions > div {
    align-items: center;
}

.bill-entry-page .page-header-actions .save-btn {
    width: 220px;
    margin-top: 0;
    border-radius: 10px;
}

.bill-header-card,
.bill-grid-card,
.bill-total-card {
    border-radius: 3px;
    border: 1px solid #cbd6e2;
    box-shadow: none;
}

.bill-header-card {
    padding: 10px;
}

.bill-header-grid {
    display: grid;
    direction: ltr;
    grid-template-columns: minmax(250px, 300px) repeat(3, minmax(210px, 1fr));
    gap: 12px;
    align-items: start;
}

.bill-header-grid > div {
    direction: rtl;
    min-width: 0;
}

.bill-header-grid > div:nth-child(3) {
    grid-column: 1;
    grid-row: 1;
}

.bill-header-grid > div:nth-child(4) {
    grid-column: 1;
    grid-row: 2;
}

.bill-header-grid > div:nth-child(6) {
    grid-column: 1;
    grid-row: 3;
}

.bill-header-grid > div:nth-child(5) {
    grid-column: 1;
    grid-row: 4;
}

.bill-header-grid > div:nth-child(1) {
    grid-column: 4;
    grid-row: 1;
}

.bill-header-grid > div:nth-child(2) {
    grid-column: 3;
    grid-row: 1;
}

.bill-header-grid > div:nth-child(7) {
    grid-column: 2;
    grid-row: 1;
}

.bill-header-grid label,
.bill-totals-row label {
    font-weight: 700;
    font-size: 12px;
    color: #111827;
    margin-bottom: 3px;
}

.bill-header-grid .form-control {
    width: 100%;
    min-height: 46px;
}

.bill-header-grid .collapse-btn {
    min-width: 56px;
    min-height: 46px;
    padding-inline: 12px;
}

.bill-header-grid .square-picker-btn {
    width: 46px;
    min-width: 46px;
    padding: 0;
    aspect-ratio: 1;
}

.bill-lookup-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 46px;
    gap: 8px;
    margin: 0;
}

.bill-currency-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 90px 58px;
    gap: 8px;
    margin: 0;
}

.talb-entry-page {
    padding-bottom: 8px;
}

.talb-entry-page .page-header-actions {
    margin-bottom: 8px;
    align-items: center;
}

.talb-entry-page .page-header-actions h2 {
    font-size: 26px;
    line-height: 1.15;
}

.talb-entry-page .page-header-actions .save-btn {
    width: 150px;
    min-height: 38px;
    border-radius: 7px;
}

.talb-entry-page .page-header-actions .collapse-btn {
    min-height: 38px;
    padding: 7px 14px;
}

.talb-entry-page .bill-header-card {
    padding: 8px 10px;
}

.talb-entry-page .bill-header-grid {
    direction: rtl;
    grid-template-columns: repeat(4, minmax(220px, 1fr));
    justify-content: stretch;
    gap: 10px 12px;
    align-items: end;
}

.talb-entry-page .bill-header-grid > div {
    direction: rtl;
    min-width: 0;
}

.talb-entry-page .bill-header-grid > div:nth-child(n) {
    grid-column: auto;
    grid-row: auto;
}

.talb-entry-page .bill-header-grid > div:nth-child(2),
.talb-entry-page .bill-header-grid > div:nth-child(3),
.talb-entry-page .bill-header-grid > div:nth-child(10),
.talb-entry-page .bill-header-grid > div:nth-child(11) {
    min-width: 0;
}

.talb-entry-page .bill-header-grid label,
.talb-entry-page .bill-totals-row label {
    font-size: 11px;
    margin-bottom: 2px;
}

.talb-entry-page .bill-header-grid .form-control {
    min-height: 36px;
    height: 36px;
    padding: 6px 10px;
    font-size: 14px;
}

.talb-entry-page .bill-header-grid .collapse-btn {
    min-height: 36px;
    min-width: 42px;
    padding-inline: 9px;
}

.talb-entry-page .bill-header-grid .square-picker-btn {
    width: 36px;
    min-width: 36px;
}

.talb-entry-page .bill-lookup-row {
    display: grid;
    width: 100%;
    grid-template-columns: minmax(0, 1fr) 36px;
    gap: 6px;
    align-items: center;
    margin: 0;
}

.talb-entry-page .bill-currency-row {
    display: grid;
    width: 100%;
    grid-template-columns: minmax(0, 1fr) 72px 38px;
    gap: 6px;
    align-items: center;
    margin: 0;
}

.talb-entry-page .bill-lookup-row .form-control,
.talb-entry-page .bill-currency-row .form-control {
    min-width: 0;
}

.talb-entry-page .bill-lookup-row .collapse-btn,
.talb-entry-page .bill-currency-row .collapse-btn {
    width: 36px;
    min-width: 36px;
    padding: 0;
}

.talb-entry-page .bill-grid-card,
.talb-entry-page .bill-total-card {
    padding: 6px 8px;
}

.talb-entry-page .bill-grid-actions {
    margin-bottom: 5px;
}

.talb-entry-page .bill-grid-actions .collapse-btn {
    min-height: 34px;
    padding: 6px 12px;
}

.talb-entry-page .bill-items-grid th,
.talb-entry-page .bill-items-grid td {
    min-width: 92px;
}

.talb-entry-page .bill-items-grid th:nth-child(2),
.talb-entry-page .bill-items-grid td:nth-child(2) {
    min-width: 128px;
}

.talb-entry-page .bill-items-grid th:nth-child(3),
.talb-entry-page .bill-items-grid td:nth-child(3) {
    min-width: 230px;
}

.talb-entry-page .bill-items-grid .grid-input {
    min-height: 31px;
    height: 31px;
    font-size: 14px;
}

@media (max-width: 1280px) {
    .talb-entry-page .bill-header-grid {
        grid-template-columns: repeat(3, minmax(210px, 1fr));
    }
}

@media (max-width: 900px) {
    .talb-entry-page .bill-header-grid {
        grid-template-columns: repeat(2, minmax(190px, 1fr));
    }
}

@media (max-width: 560px) {
    .talb-entry-page .bill-header-grid {
        grid-template-columns: 1fr;
    }
}

.stock-voucher-entry-page {
    --bill-head: #1f6f68;
    --bill-soft: #eef8f6;
}

.stock-voucher-entry-page .page-header-actions {
    border-block-end: 1px solid #cbd6e2;
    padding-bottom: 10px;
}

.stock-voucher-entry-page .page-header-actions h2 {
    font-size: 28px;
    line-height: 1.1;
}

.stock-voucher-entry-page .page-header-actions .save-btn {
    width: 180px;
    border-radius: 7px;
}

.stock-voucher-entry-page .bill-header-card {
    background: linear-gradient(180deg, #f8fbfd 0%, #ffffff 100%);
    padding: 12px;
}

.stock-voucher-entry-page .bill-header-grid {
    direction: rtl;
    grid-template-columns: repeat(5, minmax(170px, 1fr));
    gap: 10px 12px;
    align-items: end;
}

.stock-voucher-entry-page .bill-header-grid > div:nth-child(n) {
    grid-column: auto;
    grid-row: auto;
}

.stock-voucher-entry-page .bill-header-grid .form-control {
    min-height: 38px;
    height: 38px;
}

.stock-voucher-entry-page .bill-currency-row {
    grid-template-columns: minmax(0, 1fr) 88px 42px;
}

.stock-voucher-entry-page .bill-header-grid .collapse-btn,
.stock-voucher-entry-page .bill-header-grid .square-picker-btn {
    min-height: 38px;
    width: 42px;
    min-width: 42px;
}

@media (max-width: 1200px) {
    .stock-voucher-entry-page .bill-header-grid {
        grid-template-columns: repeat(3, minmax(180px, 1fr));
    }
}

@media (max-width: 760px) {
    .stock-voucher-entry-page .bill-header-grid {
        grid-template-columns: 1fr;
    }
}

.bill-grid-card {
    padding: 8px;
    overflow: hidden;
}

.bill-grid-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.bill-items-grid {
    min-width: 1320px;
}

.bill-items-grid th {
    background: var(--bill-head);
    color: #fff;
    border-color: #d5dcea;
    white-space: nowrap;
}

.bill-items-grid td {
    min-width: 110px;
    white-space: nowrap;
}

.bill-items-grid .grid-input {
    font-weight: 700;
}

.bill-items-grid th:nth-child(2),
.bill-items-grid td:nth-child(2) {
    min-width: 150px;
}

.bill-items-grid th:nth-child(3),
.bill-items-grid td:nth-child(3) {
    min-width: 280px;
}

.bill-items-grid tbody tr:nth-child(even) {
    background: #eaf8f8;
}

.bill-total-card {
    padding: 8px 12px;
}

.bill-totals-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(170px, 1fr));
    gap: 12px;
    align-items: stretch;
    margin-bottom: 10px;
}

.bill-total-field {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    padding: 8px;
    background: #f8fafc;
    border: 1px solid #d8e0eb;
    border-radius: 4px;
}

.bill-total-field label {
    margin: 0;
    text-align: center;
}

.discount-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 36px 64px;
    gap: 6px;
    align-items: center;
}

.mini-action {
    min-width: 0;
    height: 32px;
    padding: 0 8px;
    justify-content: center;
    font-weight: 800;
}

.bill-item-picker {
    width: min(1280px, 97vw);
    max-height: 86vh;
    border-radius: 4px;
    border: 1px solid #9fb0c7;
}

.item-picker-filters {
    display: grid;
    grid-template-columns: minmax(360px, 1.4fr) minmax(260px, .8fr);
    gap: 8px;
    margin-bottom: 8px;
    padding: 8px;
    background: #eef3f8;
    border: 1px solid #c9d5e4;
}

.vehicle-entry-page {
    --vehicle-blue: #173b63;
    --vehicle-border: #cdd9e6;
    gap: 10px;
}

.vehicle-page-header {
    min-height: 70px;
    padding: 12px 18px;
    align-items: center;
}

.page-kicker {
    display: block;
    color: #64748b;
    font-size: 12px;
    font-weight: 900;
    margin-bottom: 4px;
}

.vehicle-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.vehicle-actions .save-btn,
.vehicle-actions .collapse-btn {
    min-width: 86px;
    height: 36px;
    border-radius: 7px;
    padding-inline: 14px;
}

.vehicle-actions .danger-soft {
    border-color: #fecaca;
    background: #fff1f2;
    color: #b91c1c;
}

.vehicle-form-card,
.vehicle-note-card,
.vehicle-search-card,
.vehicle-list-card {
    padding: 10px 12px;
    border-radius: 6px;
}

.vehicle-form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 10px 12px;
    align-items: end;
}

.vehicle-field {
    min-width: 0;
}

.vehicle-field label {
    display: block;
    margin-bottom: 4px;
    color: #10233b;
    font-size: 12px;
    font-weight: 900;
}

.vehicle-field .form-control,
.vehicle-search-panel .search-box,
.vehicle-search-panel .form-control {
    height: 35px;
    min-height: 35px;
    border-radius: 7px;
    padding: 5px 10px;
    font-size: 13px;
    font-weight: 800;
}

.vehicle-field .form-control:focus,
.vehicle-search-panel .search-box:focus,
.vehicle-search-panel .form-control:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, .12);
}

.vehicle-picker-row {
    margin: 0;
    gap: 6px;
}

.vehicle-picker-row .form-control {
    flex: 1 1 auto;
}

.vehicle-picker-row .square-picker-btn {
    width: 40px;
    min-width: 40px;
    height: 35px;
    padding: 0;
    border-radius: 7px;
}

.vehicle-note-card textarea.form-control {
    min-height: 42px;
    height: 42px;
    border-radius: 7px;
    padding: 8px 12px;
    font-size: 13px;
    resize: vertical;
}

.vehicle-search-panel {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr)) auto;
    gap: 8px;
    padding: 8px;
    background: #eef3f8;
    border: 1px solid #c9d5e4;
    border-radius: 6px;
}

.vehicle-search-btn {
    min-width: 96px;
    height: 35px;
    border-radius: 7px;
}

.vehicle-grid-wrap {
    max-width: 100%;
    overflow-x: auto;
}

.vehicle-grid-wrap .vehicle-grid {
    width: 100%;
    min-width: 1380px;
    table-layout: fixed;
}

.vehicle-grid th,
.vehicle-grid td {
    padding: 6px 7px;
    font-size: 12.5px;
    line-height: 1.25;
    white-space: normal;
    overflow-wrap: anywhere;
}

.vehicle-grid tbody tr {
    cursor: pointer;
}

.vehicle-grid tbody tr:hover td {
    background: #fff8d6;
}

@media (max-width: 1180px) {
    .vehicle-form-grid,
    .vehicle-search-panel {
        grid-template-columns: repeat(3, minmax(160px, 1fr));
    }

    .vehicle-search-btn {
        width: 100%;
    }
}

@media (max-width: 760px) {
    .vehicle-page-header {
        align-items: stretch;
        flex-direction: column;
    }

    .vehicle-actions {
        justify-content: flex-start;
    }

    .vehicle-form-grid,
    .vehicle-search-panel {
        grid-template-columns: 1fr;
    }

    .vehicle-grid-wrap .vehicle-grid {
        min-width: 1050px;
    }
}

.modal-grid {
    max-height: 62vh;
    overflow: auto;
}

.bill-item-picker .item-lookup-grid {
    min-width: 980px;
}

.bill-item-picker .item-lookup-grid th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #4e4392;
}

.bill-item-picker .item-lookup-grid td:nth-child(2) {
    min-width: 320px;
}

.salesman-picker-modal {
    width: min(620px, 94vw);
}

.salesman-picker-modal .item-picker-filters {
    grid-template-columns: minmax(220px, 380px);
    justify-content: end;
}

.salesman-picker-modal .item-lookup-grid-wrap {
    min-height: 280px;
}

.salesman-picker-modal .item-lookup-grid {
    width: 100%;
    min-width: 0;
    table-layout: auto;
}

.salesman-picker-modal .item-lookup-grid th:first-child,
.salesman-picker-modal .item-lookup-grid td:first-child {
    width: 90px;
    max-width: 90px;
    text-align: center;
}

.salesman-picker-modal .item-lookup-grid th:nth-child(2),
.salesman-picker-modal .item-lookup-grid td:nth-child(2) {
    width: auto;
    min-width: 220px;
}

.salesmen-entry-grid {
    display: grid;
    grid-template-columns: minmax(240px, 380px) minmax(220px, 320px) auto;
    gap: 10px;
    align-items: end;
}

.salesmen-entry-grid label {
    font-weight: 700;
    font-size: 12px;
    color: #111827;
    margin-bottom: 4px;
}

.salesmen-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.salesmen-actions .save-btn {
    width: 120px;
    margin-top: 0;
    border-radius: 8px;
}

.salesmen-grid-wrap .journal-grid {
    min-width: 640px;
}

/* Employee styles */
.employee-entry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    align-items: end;
}

.employee-entry-grid label {
    font-weight: 700;
    font-size: 12px;
    color: #111827;
    margin-bottom: 4px;
}

.employee-grid-wrap .journal-grid {
    min-width: 900px;
}

/* Menu hover action for employees */
.menu-hover-action {
    margin-right: auto;
    margin-left: 8px;
    font-size: 11px;
    color: #2563eb;
    font-weight: 600;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    background: #eff6ff;
}

.menu-hover-action:hover {
    background: #dbeafe;
}

.bill-unit-picker {
    width: min(980px, 96vw);
    max-height: 82vh;
    border-radius: 4px;
    border: 1px solid #9fb0c7;
}

.unit-picker-title {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 10px;
    background: #eef3f8;
    border: 1px solid #c9d5e4;
    margin-bottom: 8px;
    font-weight: 800;
}

.selected-unit-price {
    color: #087f6f;
    font-weight: 900;
}

/* Employee Form Styles - Matching VB.NET FRM_EMPLOYEE */
.employee-page {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: white;
    color: #000;
    font-family: Arial, Tahoma, sans-serif;
}

.employee-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 28px;
    padding: 2px 8px;
    background: #4f3f8f;
    border-bottom: 1px solid #3d3170;
}

.toolbar-left, .toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toolbar-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 2px;
    background: transparent;
    border: 0;
    border-radius: 0;
    color: white;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    line-height: 22px;
}

.toolbar-btn:hover:not(:disabled) {
    text-decoration: underline;
}

.toolbar-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.vb-date-box {
    width: 88px;
    height: 21px;
    border: 1px solid #aaa;
    background: #fff;
    color: #000;
    font-size: 12px;
    text-align: center;
}

.employee-nav-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    min-height: 80px;
    padding: 14px 28px 8px;
    border-bottom: 1px dotted #8b8b8b;
    background: #fff;
}

.employee-nav-buttons {
    direction: ltr;
    display: flex;
    gap: 4px;
}

.nav-btn {
    min-width: 30px;
    height: 30px;
    border: 1px solid #c8c8c8;
    border-radius: 4px;
    background: linear-gradient(#fff, #f0f0f0);
    color: #064ed0;
    font-weight: 700;
    cursor: pointer;
}

.nav-btn.wide {
    min-width: 82px;
    color: #000;
    font-size: 13px;
}

.doc-number-box {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 4px;
    font-size: 14px;
    font-weight: 700;
    color: #000;
}

.doc-number-label {
    color: white;
    font-size: 12px;
    margin-left: 6px;
    margin-right: 0;
}

.doc-number-input {
    width: 124px;
    height: 26px;
    padding: 2px 6px;
    border: 1px solid #cfcfcf;
    border-radius: 0;
    font-size: 13px;
    background: #fff;
}

.divider {
    width: 1px;
    height: 24px;
    background: #6b6b9c;
    margin: 0 4px;
}

/* Employee Tabs */
.employee-tabs {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tab-headers {
    display: flex;
    justify-content: flex-start;
    background: #fff;
    border-bottom: 1px solid #8b8b8b;
    padding: 0 12px;
}

.tab-header {
    min-width: 96px;
    height: 24px;
    padding: 2px 14px;
    background: #f4f4f4;
    border: 1px solid #999;
    border-bottom: none;
    border-radius: 0;
    font-size: 12px;
    font-weight: 700;
    color: #000;
    cursor: pointer;
    margin-top: 0;
}

.tab-header.active {
    background: white;
    border-color: #777;
    color: #000;
    margin-bottom: -1px;
    padding-bottom: 3px;
}

.tab-content {
    flex: 1;
    overflow: auto;
    padding: 10px 12px;
    background: white;
    border: 1px solid #8b8b8b;
    border-top: none;
}

/* Sub Tabs */
.sub-tabs {
    border: 1px dotted #8b8b8b;
    border-radius: 0;
    background: white;
}

.sub-tab-headers {
    display: flex;
    background: #fff;
    border-bottom: 1px dotted #8b8b8b;
    padding: 0 4px;
}

.sub-tab-header {
    padding: 3px 12px;
    background: #f4f4f4;
    border: 1px solid #aaa;
    border-bottom: none;
    border-radius: 0;
    font-size: 11px;
    color: #000;
    cursor: pointer;
    margin-top: 0;
}

.sub-tab-header.active {
    background: white;
    border-color: #888;
    color: #000;
    font-weight: 700;
    margin-bottom: -1px;
    padding-bottom: 4px;
}

.sub-tab-content {
    min-height: 155px;
    width: 900px;
    max-width: calc(100vw - 48px);
    margin: 0 auto;
    padding: 16px 0;
}

/* General Tab Layout - Photo on right (RTL), fields on left */
.general-top-section {
    display: flex;
    gap: 56px;
    width: 760px;
    max-width: calc(100vw - 48px);
    margin: 46px auto 38px;
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
}

.photo-section {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    min-width: 210px;
    order: 2;
}

.photo-frame {
    width: 140px;
    height: 156px;
    border: 1px dotted #555;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    overflow: hidden;
}

.photo-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-placeholder {
    font-size: 88px;
    color: #64748b;
}

.photo-btn {
    padding: 4px 12px;
    background: #e2e8f0;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.basic-info-section {
    width: 485px;
    min-width: 485px;
    display: grid;
    gap: 7px;
    order: 1;
}

.vb-field-row {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 118px;
    align-items: center;
    gap: 12px;
}

.vb-field-row label {
    font-size: 14px;
    font-weight: 700;
    color: #000;
    text-align: right;
}

/* Form Layout - Matching VB form */
.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 12px;
    align-items: flex-end;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.form-group label {
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    text-align: right;
}

.form-control {
    padding: 2px 6px;
    border: 1px solid #bdbdbd;
    border-radius: 0;
    font-size: 13px;
    background: white;
    height: 25px;
}

.form-control:focus {
    outline: none;
    border-color: #4c4c7c;
    box-shadow: 0 0 0 2px rgba(76, 76, 124, 0.1);
}

.ltr-cell {
    direction: ltr;
    text-align: left;
}

/* Sub tabs form - 2 columns */
.sub-tab-content .form-row {
    display: grid;
    grid-template-columns: 390px 390px;
    justify-content: center;
    gap: 18px 54px;
    margin-bottom: 10px;
}

.sub-tab-content .form-group {
    max-width: none;
    display: grid;
    grid-template-columns: 270px 100px;
    align-items: center;
    gap: 10px;
}

.sub-tab-content .form-group label {
    order: 2;
    margin-bottom: 0;
    color: #000;
    font-size: 13px;
    font-weight: 700;
}

.sub-tab-content .form-group .form-control {
    order: 1;
}

/* Salary Tab - Two column layout */
.salary-tab {
    display: flex;
    flex-direction: column;
    gap: 0;
    direction: rtl;
    min-height: 500px;
    padding: 26px 28px 0;
    background: #fff;
}

.salary-left {
    flex: 1;
}

.salary-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.group-box {
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 16px;
    background: #fafafa;
}

.group-box h4 {
    margin: 0 0 12px 0;
    font-size: 13px;
    color: #4c4c7c;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 8px;
    font-weight: 700;
}

.group-box .form-row {
    gap: 12px;
}

.group-box .form-group {
    flex: 1;
}

/* Salary Tab VB-style */
.salary-main-row {
    display: grid;
    grid-template-columns: minmax(300px, 1fr) 340px;
    gap: 72px;
    align-items: flex-start;
    justify-content: end;
    min-height: 280px;
}

.salary-col-right {
    width: 310px;
    justify-self: end;
}

.salary-col-left {
    width: 302px;
    justify-self: start;
    margin-top: 16px;
}

.form-row-salary {
    display: grid;
    grid-template-columns: 210px 116px;
    align-items: center;
    gap: 8px;
    margin-bottom: 7px;
    justify-content: flex-end;
}

.sal-label {
    font-size: 13px;
    font-weight: 700;
    color: #000;
    white-space: nowrap;
    text-align: right;
    order: 2;
}

.sal-input {
    order: 1;
    width: 210px;
    max-width: none;
    height: 25px;
    padding: 2px 6px;
    font-size: 13px;
}

.sal-input-sm {
    width: 101px;
    height: 25px;
    padding: 2px 6px;
    font-size: 13px;
    border: 1px solid #bdbdbd;
    border-radius: 0;
    background: #fff;
}

.pink-cmb {
    background-color: #ffe4e4 !important;
    color: navy;
}

.group-box-vb {
    border: 1px solid #d8d8d8;
    border-radius: 0;
    padding: 16px 8px 10px;
    background: #fff;
    position: relative;
    margin-bottom: 8px;
}

.group-box-title {
    position: absolute;
    top: -10px;
    right: 10px;
    background: #fff;
    padding: 0 6px;
    font-size: 13px;
    font-weight: 700;
    color: #000;
}

.hour-settings-box {
    min-height: 176px;
    margin-top: 10px;
}

.salary-inner-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px 58px;
    align-items: center;
    padding: 2px 120px 0 90px;
}

.salary-inner-grid .form-row-salary {
    margin-bottom: 0;
}

.sal-split-row {
    grid-template-columns: 101px 101px 118px;
}

.sal-split-row .sal-label {
    grid-column: 3;
}

.sal-split-row .sal-input-sm,
.sal-split-row .form-control {
    order: initial;
}

.sal-dash {
    font-weight: bold;
    color: #000;
    font-size: 13px;
    grid-column: 1 / -1;
    text-align: right;
    padding-right: 312px;
}

.employee-check-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 28px;
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    color: #000;
    justify-self: start;
    direction: rtl;
}

.employee-check-row input {
    width: 14px;
    height: 14px;
}

/* Training Tab */
.training-tab {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.training-inputs {
    background: #f8fafc;
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
}

.btn-group {
    flex-direction: row;
    align-items: flex-end;
    gap: 8px;
}

.training-grid {
    flex: 1;
    overflow: auto;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
}

.data-grid {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.data-grid th {
    background: #4c4c7c;
    color: white;
    padding: 10px;
    text-align: center;
    font-weight: 600;
}

.data-grid td {
    padding: 8px 10px;
    border-bottom: 1px solid #e2e8f0;
    text-align: center;
}

.data-grid tr:hover {
    background: #f1f5f9;
}

.data-grid tr.selected-row {
    background: #dbeafe;
}

.bill-save-modal {
    width: min(420px, 94vw);
    border-radius: 4px;
    border: 1px solid #9fb0c7;
}

.bill-save-summary {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
}

.bill-save-summary label {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 700;
    color: #111827;
}

.bill-save-summary .total-input {
    text-align: center;
    font-size: 20px;
    font-weight: 700;
}

.bill-save-modal .modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-start;
    padding: 0 12px 12px;
}

.discount-modal {
    width: min(760px, 96vw);
    border-radius: 4px;
    border: 1px solid #9fb0c7;
}

.discount-dialog-body {
    display: grid;
    gap: 12px;
    padding: 12px;
}

.discount-summary-grid,
.discount-input-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(180px, 1fr));
    gap: 10px;
}

.discount-summary-grid label,
.discount-input-grid label {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 700;
    color: #111827;
}

.discount-modal .total-input {
    text-align: center;
    font-size: 18px;
    font-weight: 800;
}

.discount-presets {
    display: grid;
    grid-template-columns: repeat(6, minmax(56px, 1fr));
    gap: 8px;
}

.discount-modal .modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-start;
    padding: 0 12px 12px;
}

.purchase-price-modal {
    width: min(560px, 94vw);
    border-radius: 4px;
    border: 1px solid #9fb0c7;
}

.purchase-price-body {
    padding: 18px;
    display: grid;
    gap: 18px;
}

.purchase-price-body p {
    margin: 0;
    text-align: center;
    font-size: 18px;
    font-weight: 800;
    color: #111827;
}

.purchase-price-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.purchase-price-actions button {
    min-height: 74px;
    justify-content: center;
    white-space: normal;
}

.danger-action {
    border-color: #b91c1c !important;
    color: #b91c1c !important;
    background: #fff5f5 !important;
}

.settings-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    font-weight: 700;
    color: #1f2937;
}

.company-settings-page {
    min-height: 100%;
}

.company-settings-shell {
    display: grid;
    gap: 14px;
    max-width: 1320px;
    margin-inline: auto;
}

.settings-group {
    border: 1px solid #cbd5e1;
    border-top: 4px solid #4f46e5;
    border-radius: 14px;
    background: #fff;
    padding: 22px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.settings-group legend {
    width: auto;
    float: none;
    padding: 0 12px;
    margin-inline-start: 18px;
    color: #111827;
    font-size: 22px;
    font-weight: 900;
}

.settings-grid {
    display: grid;
    gap: 14px;
    align-items: end;
}

.settings-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.settings-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settings-grid label {
    display: block;
    margin-bottom: 6px;
    color: #111827;
    font-weight: 800;
    font-size: 13px;
}

.settings-textarea {
    min-height: 88px;
    resize: vertical;
}

.media-picker-box {
    min-height: 144px;
    padding: 14px;
    border: 1px solid #d7dee9;
    border-radius: 12px;
    background: #f8fafc;
}

.settings-media-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.settings-check.compact {
    margin: 0;
    font-size: 12px;
}

.settings-image-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}

.settings-image-preview img {
    max-width: 160px;
    max-height: 88px;
    object-fit: contain;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: #fff;
    padding: 6px;
}

.danger-soft-btn {
    border: 0;
    border-radius: 9px;
    padding: 8px 14px;
    color: #b91c1c;
    background: #fee2e2;
    font-weight: 900;
}

.compact-settings {
    align-items: center;
}

.compact-settings .settings-check {
    min-height: 42px;
    margin-top: 22px;
}

.trial-filter-card {
    margin-bottom: 12px;
}

.trial-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 12px;
    align-items: end;
}

.trial-summary-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(120px, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

.trial-summary-grid div {
    display: grid;
    gap: 4px;
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    text-align: center;
}

.trial-summary-grid span {
    font-size: 12px;
    font-weight: 800;
    color: #334155;
}

.trial-summary-grid strong {
    direction: ltr;
    color: #0f766e;
    font-size: 15px;
    font-weight: 900;
}

.trial-balance-grid th,
.trial-balance-grid td {
    text-align: center;
    white-space: nowrap;
}

.trial-balance-grid td:nth-child(2),
.trial-balance-grid td:nth-child(3) {
    text-align: right;
}

.trial-total-row td {
    background: #ecfdf5 !important;
    font-weight: 900;
}

.trial-account-total-row td {
    background: #e2f0d9 !important;
    font-weight: 900;
}

.trial-account-total-row td:nth-child(2),
.trial-account-total-row td:nth-child(3) {
    color: #111827;
}

.trial-grand-total-row td {
    background: #0b84d7 !important;
    color: #fff !important;
    font-weight: 900;
}

@media (max-width: 1200px) {
    .trial-filter-grid,
    .trial-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .trial-filter-grid,
    .trial-summary-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1100px) {
    .settings-grid-3,
    .settings-grid-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .settings-grid-3,
    .settings-grid-2 {
        grid-template-columns: 1fr;
    }

    .settings-group {
        padding: 16px;
    }
}

.tab-confirm-overlay {
    align-items: center;
    justify-content: center;
    z-index: 5000;
}

.tab-confirm-dialog {
    width: min(420px, calc(100vw - 32px));
    background: #fff;
    border: 1px solid #c8d3e1;
    border-radius: 6px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, .24);
    padding: 20px;
    text-align: center;
}

.tab-confirm-dialog h3 {
    margin: 0 0 10px;
    font-size: 20px;
    font-weight: 800;
    color: #111827;
}

.tab-confirm-dialog p {
    margin: 0;
    color: #334155;
    line-height: 1.7;
    font-weight: 700;
}

.tab-confirm-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 18px;
}

.tab-confirm-yes-btn {
    width: 100%;
    min-height: 48px;
    border: none;
    border-radius: 6px;
    background: #dc2626;
    color: #fff;
    font-weight: bold;
    font-size: 15px;
    cursor: pointer;
}

.tab-confirm-yes-btn:hover {
    background: #b91c1c;
}

.tab-confirm-actions .collapse-btn {
    min-height: 48px;
}

@media (max-width: 1100px) {
    .bill-header-grid {
        grid-template-columns: repeat(2, minmax(170px, 1fr));
    }

    .bill-totals-row,
    .item-picker-filters {
        grid-template-columns: 1fr;
    }

    .bill-total-field {
        grid-template-columns: 1fr;
    }

    .discount-tools {
        grid-template-columns: 1fr 44px 72px;
    }

    .discount-summary-grid,
    .discount-input-grid,
    .discount-presets {
        grid-template-columns: 1fr;
    }
}

.trial-vb-filter-grid {
    grid-template-columns: repeat(2, minmax(190px, 260px));
    justify-content: end;
}

.trial-category-total-row td {
    background: #ededed !important;
    font-weight: 900;
}

.trial-status-bar {
    margin-top: 8px;
    padding: 9px 12px;
    border: 1px solid #d1d5db;
    background: #f8fafc;
    color: #111827;
    font-weight: 800;
    text-align: right;
}

.trial-balance-grid .negative-number {
    color: #dc2626;
}

.trial-print-sheet {
    display: none;
}

@media print {
    @page {
        size: A4 landscape;
        margin: 9mm 10mm 11mm;
    }

    body * {
        visibility: hidden !important;
    }

    .trial-print-sheet,
    .trial-print-sheet *,
    .financial-print-sheet,
    .financial-print-sheet * {
        visibility: visible !important;
    }

    .trial-print-sheet {
        display: block !important;
        position: absolute;
        inset: 0;
        width: 100%;
        min-height: 100%;
        direction: rtl;
        background: #fff;
        color: #000;
        font-family: Tahoma, Arial, sans-serif;
        font-size: 11px;
        line-height: 1.2;
    }

    .trial-print-company-row {
        min-height: 62px;
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: start;
        gap: 12px;
        padding: 2px 6px 0;
    }

    .trial-print-company-side {
        display: grid;
        gap: 10px;
        font-weight: 700;
        min-width: 0;
    }

    .trial-print-company-side.left-side {
        text-align: left;
        direction: rtl;
        justify-items: start;
    }

    .trial-print-company-side.right-side {
        text-align: right;
        justify-items: end;
    }

    .trial-print-company-side span,
    .trial-print-company-side strong {
        display: block;
        max-width: 260px;
        overflow-wrap: anywhere;
    }

    .trial-print-logo {
        max-width: 82px;
        max-height: 56px;
        object-fit: contain;
        justify-self: center;
    }

    .trial-print-rule {
        border-top: 2px solid #000;
        margin: 4px 6px 10px;
    }

    .trial-print-title-row {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: start;
        gap: 12px;
        margin: 0 6px 10px;
    }

    .trial-print-title-row h1 {
        margin: 0;
        text-align: center;
        font-size: 22px;
        font-weight: 800;
        letter-spacing: 0;
        color: #000;
        white-space: nowrap;
    }

    .trial-print-tax {
        text-align: left;
        direction: rtl;
        font-weight: 700;
        padding-top: 5px;
        min-height: 16px;
    }

    .trial-print-dates {
        display: grid;
        gap: 7px;
        justify-items: end;
        direction: ltr;
        font-size: 16px;
        line-height: 1;
    }

    .trial-print-table {
        width: calc(100% - 12px);
        margin: 0 6px;
        border-collapse: collapse;
        table-layout: fixed;
        direction: rtl;
        font-size: 12px;
        page-break-inside: auto;
    }

    .trial-print-table thead {
        display: table-header-group;
    }

    .trial-print-table tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }

    .trial-print-table th,
    .trial-print-table td {
        border: 1.4px solid #000;
        padding: 4px 5px;
        text-align: center;
        vertical-align: middle;
        color: #000 !important;
        background: #fff !important;
        font-weight: 700;
        overflow-wrap: anywhere;
    }

    .trial-print-table th {
        font-size: 11px;
        height: 30px;
    }

    .trial-print-table td {
        height: 28px;
    }

    .trial-print-table th:nth-child(1),
    .trial-print-table td:nth-child(1) {
        width: 7%;
    }

    .trial-print-table th:nth-child(2),
    .trial-print-table td:nth-child(2) {
        width: 15%;
        text-align: right;
    }

    .trial-print-table th:nth-child(3),
    .trial-print-table td:nth-child(3) {
        width: 6%;
    }

    .trial-print-table th:nth-child(4),
    .trial-print-table td:nth-child(4) {
        width: 11%;
    }

    .trial-print-table th:nth-child(5),
    .trial-print-table td:nth-child(5),
    .trial-print-table th:nth-child(7),
    .trial-print-table td:nth-child(7) {
        width: 9%;
    }

    .trial-print-table th:nth-child(6),
    .trial-print-table td:nth-child(6),
    .trial-print-table th:nth-child(8),
    .trial-print-table td:nth-child(8) {
        width: 9%;
    }

    .trial-print-table th:nth-child(9),
    .trial-print-table td:nth-child(9),
    .trial-print-table th:nth-child(10),
    .trial-print-table td:nth-child(10) {
        width: 7%;
    }

    .trial-print-table th:nth-child(11),
    .trial-print-table td:nth-child(11) {
        width: 12%;
    }

    .trial-print-table .trial-account-total-row td,
    .trial-print-table .trial-category-total-row td,
    .trial-print-table .trial-grand-total-row td {
        font-weight: 900;
    }

    .trial-print-footer {
        position: fixed;
        right: 10mm;
        left: 10mm;
        bottom: 3mm;
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
        font-weight: 700;
        color: #000;
    }

    .trial-print-footer > span:first-child {
        justify-self: start;
        direction: ltr;
    }

    .trial-print-page-number {
        justify-self: center;
    }

    .trial-print-page-number::after {
        content: counter(page);
    }
}

.trial-balance-grid .num-cell,
.trial-balance-grid .ltr-cell,
.trial-summary-grid strong,
.trial-status-bar {
    font-family: Arial, Tahoma, sans-serif;
    font-variant-numeric: tabular-nums;
    direction: ltr;
    unicode-bidi: plaintext;
}

@media print {
    .trial-print-table td:not(:nth-child(2)),
    .trial-print-table th:not(:nth-child(2)),
    .trial-print-dates,
    .trial-print-footer,
    .trial-print-company-side span {
        font-family: Arial, Tahoma, sans-serif;
        font-variant-numeric: tabular-nums;
    }

    .trial-print-table td:nth-child(n+4),
    .trial-print-table th:nth-child(n+4),
    .trial-print-table td:first-child,
    .trial-print-dates,
    .trial-print-footer {
        direction: ltr;
        unicode-bidi: plaintext;
    }
}

.trial-balance-grid .num-cell,
.trial-balance-grid .ltr-cell {
    font-family: Arial, Tahoma, sans-serif;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.25;
}

.trial-summary-grid strong {
    font-family: Arial, Tahoma, sans-serif;
    font-size: 16px;
}

@media print {
    .trial-print-table td:not(:nth-child(2)) {
        font-family: Arial, Tahoma, sans-serif;
        font-size: 12.5px;
        font-weight: 800;
    }

    .trial-print-table th:not(:nth-child(2)) {
        font-family: Arial, Tahoma, sans-serif;
        font-size: 11.5px;
    }
}

.financial-report-page {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.financial-filter-card {
    padding: 12px;
}

.financial-action-chooser {
    display: grid;
    grid-template-columns: minmax(260px, 420px) auto auto;
    gap: 10px;
    align-items: end;
    padding: 12px;
    border-inline-start: 4px solid #1f3f66;
}

.financial-action-chooser label {
    display: block;
    margin-bottom: 5px;
    color: #1f2937;
    font-weight: 900;
}

.financial-filter-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(130px, 1fr));
    gap: 10px;
    align-items: end;
}

.financial-check-cell {
    min-height: 38px;
    display: flex;
    align-items: center;
}

.inline-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

.financial-job-cell {
    min-width: 180px;
}

.financial-tabs-card {
    padding: 8px;
}

.financial-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.financial-tabs button {
    border: 1px solid #b8c7d8;
    background: #f7fbff;
    color: #17324d;
    border-radius: 6px;
    padding: 8px 14px;
    font-weight: 800;
    cursor: pointer;
}

.financial-tabs button.active {
    background: #1f3f66;
    color: #fff;
    border-color: #1f3f66;
}

.financial-report-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 8px 2px 12px;
    color: #1f2933;
}

.financial-report-grid th {
    background: #1f3f66;
    color: #fff;
}

.financial-report-grid {
    min-width: 1120px;
    table-layout: fixed;
}

.financial-report-grid th,
.financial-report-grid td {
    font-family: Tahoma, Arial, sans-serif;
    text-align: center;
    vertical-align: middle;
}

.financial-report-grid th:nth-child(1),
.financial-report-grid td:nth-child(1) {
    width: 140px;
}

.financial-report-grid th:nth-child(2),
.financial-report-grid td:nth-child(2) {
    width: 110px;
}

.financial-report-grid th:nth-child(3),
.financial-report-grid td:nth-child(3) {
    width: 320px;
    text-align: right;
    padding-inline: 12px;
}

.financial-report-grid th:nth-child(4),
.financial-report-grid td:nth-child(4) {
    width: 90px;
}

.financial-report-grid th:nth-child(5),
.financial-report-grid td:nth-child(5),
.financial-report-grid th:nth-child(6),
.financial-report-grid td:nth-child(6),
.financial-report-grid th:nth-child(7),
.financial-report-grid td:nth-child(7) {
    width: 150px;
}

.financial-report-grid .num-cell,
.financial-report-grid .ltr-cell {
    font-family: Arial, Tahoma, sans-serif;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.25;
    text-align: center !important;
    direction: ltr;
    unicode-bidi: plaintext;
}

.financial-row-main td {
    background: #ffe699 !important;
    font-weight: 900;
    font-size: 15px;
}

.financial-row-sub td {
    background: #ddebf7 !important;
    font-weight: 900;
}

.financial-row-subtotal td {
    background: #f2f2f2 !important;
    font-weight: 900;
}

.financial-row-total td {
    background: #4472c4 !important;
    color: #fff;
    font-weight: 900;
}

.financial-row-result td {
    background: #fff2cc !important;
    font-weight: 900;
}

.financial-row-blank td {
    background: #f7f7f7 !important;
    height: 16px;
    border-color: transparent;
}

.account-balances-filter-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(170px, 1fr));
    gap: 12px;
    align-items: end;
}

.account-parent-toggle {
    display: flex;
    align-items: center;
    min-height: 44px;
    font-weight: 800;
}

.account-parent-toggle label {
    display: inline-flex;
    gap: 8px;
    align-items: center;
}

.account-balances-grid th,
.account-balances-grid td {
    font-size: 15px;
    height: 33px;
}

.account-balances-grid .num-cell,
.account-balances-grid .ltr-cell {
    font-family: Arial, Tahoma, sans-serif;
    font-size: 16px;
    font-weight: 900;
    text-align: center !important;
    direction: ltr;
    unicode-bidi: plaintext;
}

.account-balances-grid .debit-cell {
    color: #b91c1c;
}

.account-balances-grid .credit-cell {
    color: #1e3a8a;
}

.account-balances-summary strong {
    font-family: Arial, Tahoma, sans-serif;
}

.account-balance-print-meta {
    width: calc(100% - 12px);
    margin: 0 6px 8px;
    border: 1.5px solid #000;
    padding: 7px 10px;
    display: flex;
    justify-content: center;
    gap: 16px;
    font-weight: 800;
}

.final-filter-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(160px, 1fr));
    gap: 12px;
    align-items: end;
}

.final-tabs-card {
    padding-block: 10px;
}

.final-main-grid th,
.final-main-grid td,
.final-inventory-grid th,
.final-inventory-grid td {
    height: 32px;
    font-size: 15px;
}

.final-main-grid .num-cell,
.final-main-grid .ltr-cell,
.final-inventory-grid .num-cell {
    font-family: Arial, Tahoma, sans-serif;
    font-size: 15.5px;
    font-weight: 900;
    direction: ltr;
    unicode-bidi: plaintext;
    text-align: center !important;
}

.final-main-grid td:nth-child(2),
.final-inventory-grid td:first-child {
    text-align: right;
    font-weight: 800;
}

.final-row-section td {
    background: #ffe699 !important;
    font-weight: 900;
}

.final-row-total td {
    background: #dde9d5 !important;
    font-weight: 900;
}

.final-row-separator td {
    background: #f2f2f2 !important;
    color: #555;
}

@media (max-width: 1100px) {
    .final-filter-grid {
        grid-template-columns: repeat(2, minmax(170px, 1fr));
    }
}

@media (max-width: 720px) {
    .final-filter-grid {
        grid-template-columns: 1fr;
    }
}

@media print {
    .final-print-sheet .trial-print-title-row {
        grid-template-columns: 1fr auto 1fr;
    }

    .final-print-table {
        table-layout: fixed;
    }

    .final-print-table th,
    .final-print-table td {
        font-family: Arial, Tahoma, sans-serif !important;
        font-size: 12px !important;
        font-weight: 800 !important;
    }

    .final-print-table th:nth-child(1),
    .final-print-table td:nth-child(1) {
        width: 10%;
    }

    .final-print-table th:nth-child(2),
    .final-print-table td:nth-child(2) {
        width: 30%;
        text-align: right;
    }

    .final-print-table th:nth-child(n+3),
    .final-print-table td:nth-child(n+3) {
        width: 10%;
        direction: ltr;
        unicode-bidi: plaintext;
    }
}

@media (max-width: 1100px) {
    .account-balances-filter-grid {
        grid-template-columns: repeat(2, minmax(170px, 1fr));
    }
}

@media (max-width: 720px) {
    .account-balances-filter-grid {
        grid-template-columns: 1fr;
    }
}

@media print {
    .account-balance-print-sheet {
        font-family: Arial, Tahoma, sans-serif !important;
    }

    .account-balance-print-sheet .trial-print-title-row {
        grid-template-columns: 1fr auto 1fr;
    }

    .account-balance-print-table {
        table-layout: fixed;
    }

    .account-balance-print-table th,
    .account-balance-print-table td {
        font-family: Arial, Tahoma, sans-serif !important;
        font-size: 12.5px !important;
        font-weight: 800 !important;
    }

    .account-balance-print-table th:nth-child(1),
    .account-balance-print-table td:nth-child(1) {
        width: 16%;
    }

    .account-balance-print-table th:nth-child(2),
    .account-balance-print-table td:nth-child(2) {
        width: 36%;
        text-align: right;
    }

    .account-balance-print-table th:nth-child(3),
    .account-balance-print-table td:nth-child(3),
    .account-balance-print-table th:nth-child(4),
    .account-balance-print-table td:nth-child(4),
    .account-balance-print-table th:nth-child(5),
    .account-balance-print-table td:nth-child(5) {
        width: 16%;
        direction: ltr;
        unicode-bidi: plaintext;
    }
}

.financial-print-sheet {
    display: none;
}

@media (max-width: 1100px) {
    .financial-filter-grid {
        grid-template-columns: repeat(3, minmax(150px, 1fr));
    }
}

@media (max-width: 720px) {
    .financial-action-chooser,
    .financial-filter-grid {
        grid-template-columns: 1fr;
    }
}

@media print {
    @page {
        size: A4 portrait;
        margin: 9mm 10mm 11mm;
    }

    .financial-report-page > :not(.financial-print-sheet) {
        display: none !important;
    }

    .financial-print-sheet {
        display: block !important;
        position: absolute;
        inset: 0;
        width: 100%;
        min-height: 100%;
        color: #000;
        background: #fff;
        font-family: Arial, Tahoma, sans-serif;
        direction: rtl;
    }

    .financial-print-sheet .trial-print-title-row {
        grid-template-columns: 1fr auto 1fr;
        margin-bottom: 10px;
    }

    .financial-print-sheet .trial-print-title-row h1 {
        font-size: 20px;
    }

    .financial-print-table {
        width: calc(100% - 12px);
        margin: 0 6px;
        table-layout: fixed;
        border-collapse: collapse;
    }

    .financial-print-table td,
    .financial-print-table th {
        font-family: Arial, Tahoma, sans-serif;
        font-size: 12px;
        border: 1.4px solid #000;
        color: #000 !important;
        background: #fff !important;
        text-align: center;
        vertical-align: middle;
        font-weight: 800;
        padding: 4px 5px;
    }

    .financial-print-table th:nth-child(1),
    .financial-print-table td:nth-child(1) {
        width: 15%;
    }

    .financial-print-table th:nth-child(2),
    .financial-print-table td:nth-child(2) {
        width: 11%;
    }

    .financial-print-table th:nth-child(3),
    .financial-print-table td:nth-child(3) {
        width: 27%;
        text-align: right;
    }

    .financial-print-table th:nth-child(4),
    .financial-print-table td:nth-child(4) {
        width: 8%;
    }

    .financial-print-table th:nth-child(5),
    .financial-print-table td:nth-child(5),
    .financial-print-table th:nth-child(6),
    .financial-print-table td:nth-child(6),
    .financial-print-table th:nth-child(7),
    .financial-print-table td:nth-child(7) {
        width: 13%;
        direction: ltr;
        unicode-bidi: plaintext;
    }

    .financial-print-table .financial-row-main td,
    .financial-print-table .financial-row-sub td,
    .financial-print-table .financial-row-subtotal td,
    .financial-print-table .financial-row-result td,
    .financial-print-table .financial-row-total td {
        font-weight: 900;
    }
}
/* Receivables reports */
.receivables-filter-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(180px, 1fr));
    gap: 12px;
    align-items: end;
}

/* Income statement report */
.income-filter-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(150px, 220px));
    gap: 10px;
    align-items: end;
    justify-content: end;
}

.income-filter-grid label {
    display: block;
    margin-bottom: 5px;
    font-weight: 800;
    color: #15233a;
    font-size: 13px;
}

.income-summary-grid {
    grid-template-columns: repeat(6, minmax(140px, 1fr));
}

.income-statement-wrap {
    max-width: 760px;
    margin-inline-start: auto;
    margin-inline-end: auto;
}

.income-statement-grid {
    min-width: 560px;
}

.income-statement-grid th:first-child,
.income-statement-grid td:first-child {
    text-align: right;
}

.income-statement-grid th:last-child,
.income-statement-grid td:last-child {
    width: 180px;
    text-align: center;
}

.income-account-grid th,
.income-account-grid td,
.income-inventory-grid th,
.income-inventory-grid td {
    text-align: center;
    white-space: nowrap;
}

.income-account-grid td:nth-child(2),
.income-inventory-grid td:first-child {
    text-align: right;
    white-space: normal;
}

.income-statement-grid .section-row td,
.income-account-grid .section-row td,
.income-inventory-grid .section-row td {
    background: #ffe699;
    font-weight: 900;
}

.income-statement-grid .subtotal-row td,
.income-statement-grid .total-row td,
.income-account-grid .total-row td,
.income-inventory-grid .total-row td {
    background: #dde9d5;
    font-weight: 900;
}

.income-statement-grid .grand-row td {
    background: #fff2cc;
    font-weight: 950;
    font-size: 16px;
}

.income-print-sheet {
    display: none;
}

@media (max-width: 1100px) {
    .income-filter-grid {
        grid-template-columns: repeat(2, minmax(150px, 1fr));
    }

    .income-summary-grid {
        grid-template-columns: repeat(2, minmax(140px, 1fr));
    }
}

@media print {
    body:has(.income-statement-page) .income-statement-page > :not(.income-print-sheet) {
        display: none !important;
    }

    body:has(.income-statement-page) .income-print-sheet {
        display: block !important;
        width: 185mm;
        min-height: 260mm;
        margin: 0 auto;
        padding: 18mm 10mm 12mm;
        color: #000;
        background: #fff;
        font-family: Arial, sans-serif;
    }

    .income-print-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 12px;
        font-family: Arial, sans-serif;
    }

    .income-print-table th,
    .income-print-table td {
        border: 1px solid #000;
        padding: 5px 7px;
        text-align: center;
        font-weight: 700;
    }

    .income-print-table td:first-child {
        text-align: right;
        width: 70%;
    }

    .income-print-table .section-row td {
        background: #ffe699 !important;
    }

    .income-print-table .total-row td,
    .income-print-table .subtotal-row td {
        background: #dde9d5 !important;
    }

    .income-print-table .grand-row td {
        background: #fff2cc !important;
        font-size: 13px;
    }
}

.report-check {
    min-height: 46px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-weight: 700;
    color: #1f2937;
}

.receivables-grid th,
.receivables-grid td {
    font-family: Arial, Tahoma, sans-serif;
    font-size: 15px;
    white-space: nowrap;
    text-align: center;
    vertical-align: middle;
}

.receivables-grid {
    table-layout: fixed;
    width: 100%;
    min-width: 1180px;
}

.receivables-grid .receivables-code-col {
    width: 150px;
}

.receivables-grid .receivables-name-col {
    width: 260px;
}

.receivables-grid .receivables-money-col {
    width: 154px;
}

.receivables-grid td:nth-child(2),
.receivables-grid th:nth-child(2) {
    text-align: right;
}

.receivables-grid td:first-child,
.receivables-grid th:first-child {
    text-align: center;
}

.receivables-grid .num-cell,
.statement-grid.receivables-grid .num-cell {
    direction: ltr;
    text-align: center;
    unicode-bidi: plaintext;
    font-variant-numeric: tabular-nums;
}

.receivables-grid .debit-cell,
.receivables-grid .credit-cell,
.receivables-grid .negative-cell {
    text-align: center;
}

.receivables-summary {
    grid-template-columns: repeat(6, minmax(150px, 1fr));
}

.salesman-account-page .account-balances-filter {
    padding: 14px 16px;
}

.salesman-account-filter-grid {
    display: grid;
    grid-template-columns: 160px 160px 220px 220px;
    gap: 12px;
    align-items: end;
    justify-content: end;
}

.salesman-account-filter-grid > div {
    min-width: 0;
}

.salesman-account-filter-grid label {
    display: block;
    margin-bottom: 5px;
    font-weight: 700;
    text-align: right;
    color: #111827;
}

.salesman-account-filter-grid .form-control {
    width: 100%;
    height: 38px;
    min-height: 38px;
    padding: 6px 12px;
}

.salesman-account-page .account-report-actions .save-btn {
    min-width: 120px;
}

.salesman-account-grid {
    min-width: 1500px;
}

.salesman-account-grid .num-cell {
    text-align: center !important;
    direction: ltr;
    unicode-bidi: plaintext;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 980px) {
    .salesman-account-filter-grid {
        grid-template-columns: repeat(2, minmax(150px, 220px));
    }
}

@media (max-width: 1100px) {
    .receivables-filter-grid {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }

    .receivables-summary {
        grid-template-columns: repeat(2, minmax(150px, 1fr));
    }
}

/* Daily movement report */
.all-day-filter-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(150px, 220px));
    gap: 10px;
    align-items: end;
    justify-content: end;
}

.all-day-filter-grid label {
    display: block;
    margin-bottom: 5px;
    font-weight: 800;
    color: #15233a;
    font-size: 13px;
}

.all-day-summary {
    grid-template-columns: repeat(6, minmax(130px, 1fr));
}

.all-day-grid {
    min-width: 1320px;
    table-layout: fixed;
}

.all-day-grid th,
.all-day-grid td {
    font-family: Arial, Tahoma, sans-serif;
    font-size: 14px;
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
}

.all-day-grid td:nth-child(3),
.all-day-grid td:nth-child(6) {
    text-align: right;
    white-space: normal;
}

.all-day-grid th:nth-child(1) { width: 85px; }
.all-day-grid th:nth-child(2) { width: 95px; }
.all-day-grid th:nth-child(3) { width: 190px; }
.all-day-grid th:nth-child(4),
.all-day-grid th:nth-child(5),
.all-day-grid th:nth-child(10),
.all-day-grid th:nth-child(11) { width: 105px; }
.all-day-grid th:nth-child(6) { width: 260px; }
.all-day-grid th:nth-child(7) { width: 90px; }
.all-day-grid th:nth-child(8) { width: 95px; }
.all-day-grid th:nth-child(9) { width: 125px; }

.all-day-grid tbody tr {
    cursor: pointer;
}

.all-day-grid tbody tr:hover td {
    background: #fff8d6;
}

.all-day-grid .currency-amount {
    background: #fff9c4;
}

.all-day-print-sheet {
    display: none;
}

.all-day-print-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 12px;
    font-weight: 800;
    margin: 8px 0 10px;
}

@media (max-width: 1100px) {
    .all-day-filter-grid {
        grid-template-columns: repeat(2, minmax(150px, 1fr));
    }

    .all-day-summary {
        grid-template-columns: repeat(2, minmax(140px, 1fr));
    }
}

@media print {
    body:has(.all-day-report-page) .all-day-report-page > :not(.all-day-print-sheet) {
        display: none !important;
    }

    body:has(.all-day-report-page) .all-day-print-sheet {
        display: block !important;
        width: 190mm;
        min-height: 260mm;
        margin: 0 auto;
        padding: 14mm 8mm 10mm;
        color: #000;
        background: #fff;
        font-family: Arial, sans-serif;
    }

    .all-day-print-table {
        width: 100%;
        border-collapse: collapse;
        table-layout: fixed;
        font-size: 10.5px;
        font-family: Arial, sans-serif;
    }

    .all-day-print-table th,
    .all-day-print-table td {
        border: 1px solid #000;
        padding: 4px 5px;
        text-align: center;
        font-weight: 700;
        color: #000 !important;
    }

    .all-day-print-table td:nth-child(3),
    .all-day-print-table td:nth-child(6) {
        text-align: right;
    }

.all-day-print-table .total-row td {
        background: #dde9d5 !important;
        font-weight: 900;
    }
}

/* Item profit report */
.item-profit-filter-card {
    padding: 12px 14px;
}

.item-profit-filter-grid {
    display: grid;
    grid-template-columns: 145px 145px 150px 190px 220px 150px 130px;
    gap: 10px;
    align-items: end;
    justify-content: end;
}

.item-profit-filter-grid label:not(.erp-check) {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    font-weight: 800;
    color: #172033;
}

.item-profit-filter-grid .form-control {
    width: 100%;
    height: 36px;
    min-height: 36px;
    padding: 6px 10px;
}

.item-profit-filter-grid .erp-check {
    height: 36px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 7px;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

.item-profit-summary {
    grid-template-columns: repeat(5, minmax(130px, 1fr));
}

@media (max-width: 1350px) {
    .item-profit-filter-grid {
        grid-template-columns: repeat(4, minmax(140px, 220px));
    }
}

@media (max-width: 820px) {
    .item-profit-filter-grid {
        grid-template-columns: repeat(2, minmax(140px, 1fr));
    }

    .item-profit-summary {
        grid-template-columns: repeat(2, minmax(130px, 1fr));
    }
}

.cash-voucher-entry-page {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cash-voucher-entry-page .page-header-actions {
    min-height: 74px;
    margin: 0;
    padding: 12px 18px 4px;
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.cash-voucher-entry-page .page-header-actions h2 {
    margin: 0;
    color: #111827;
    font-size: 28px;
    font-weight: 900;
    line-height: 1.2;
}

.cash-voucher-entry-page .page-header-actions > div {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    gap: 10px !important;
    flex-wrap: nowrap !important;
}

.cash-voucher-entry-page .page-header-actions .save-btn,
.cash-voucher-entry-page .page-header-actions .collapse-btn {
    min-width: 126px;
    height: 42px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 900;
}

.cash-voucher-entry-page .journal-page {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.cash-voucher-entry-page .journal-card {
    border: 1px solid #e1e8f0;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .05);
}

.cash-voucher-entry-page .journal-page > .journal-card:first-child {
    padding: 24px 22px 20px;
}

.cash-voucher-entry-page .journal-header-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(130px, 1fr));
    gap: 14px 16px;
    align-items: end;
}

.cash-voucher-entry-page .journal-header-grid > div {
    min-width: 0;
}

.cash-voucher-entry-page .journal-header-grid > div:nth-child(1) { order: 1; }
.cash-voucher-entry-page .journal-header-grid > div:nth-child(2) { order: 2; }
.cash-voucher-entry-page .journal-header-grid > div:nth-child(3) { order: 3; }
.cash-voucher-entry-page .journal-header-grid > div:nth-child(4) { order: 4; }
.cash-voucher-entry-page .journal-header-grid > div:nth-child(5) { order: 5; }
.cash-voucher-entry-page .journal-header-grid > div:nth-child(6) { order: 6; }

.cash-voucher-entry-page .journal-header-grid > div:nth-child(9) {
    order: 7;
    grid-column: 1 / -1 !important;
}

.cash-voucher-entry-page .journal-header-grid > div:nth-child(10) {
    order: 8;
    grid-column: 4 / span 1;
}

.cash-voucher-entry-page .journal-header-grid > div:nth-child(11) {
    order: 9;
    grid-column: 5 / span 1;
}

.cash-voucher-entry-page .journal-header-grid > div:nth-child(12) {
    order: 10;
    grid-column: 6 / span 1;
}

.cash-voucher-entry-page .journal-header-grid > div:nth-child(7) {
    order: 11;
    grid-column: 1 / span 3;
}

.cash-voucher-entry-page .journal-header-grid > div:nth-child(8) {
    order: 12;
    grid-column: 4 / span 3;
}

.cash-voucher-entry-page .journal-header-grid > div:nth-child(13) {
    order: 13;
    grid-column: 1 / -1 !important;
}

.cash-voucher-entry-page .journal-card label {
    margin-bottom: 7px;
    color: #0f172a;
    font-size: 12.5px;
    font-weight: 900;
}

.cash-voucher-entry-page .form-control,
.cash-voucher-entry-page .grid-input {
    min-height: 42px;
    border-color: #d3dde8;
    border-radius: 8px;
    background: #ffffff;
    font-size: 14px;
}

.cash-voucher-entry-page .form-control[readonly],
.cash-voucher-entry-page input[readonly] {
    background: #f3f6f9;
}

.cash-voucher-entry-page .search-row {
    margin: 0 !important;
    display: grid;
    grid-template-columns: 1fr 48px;
    gap: 8px;
    align-items: stretch;
}

.cash-voucher-entry-page .search-row .collapse-btn {
    width: 48px;
    min-width: 48px;
    height: 42px;
    border-radius: 9px;
    background: #334155;
    color: #ffffff;
}

.cash-voucher-entry-page .journal-grid-section {
    padding: 14px 16px 16px;
}

.cash-voucher-entry-page .journal-grid-hint {
    margin: 0 0 10px;
    text-align: right;
    color: #64748b;
}

.cash-voucher-entry-page .journal-grid-wrap {
    border: 1px solid #dbe5ef;
    border-radius: 8px;
    overflow: auto;
}

.cash-voucher-entry-page .journal-grid thead th {
    height: 34px;
    background: #193b62;
    color: #ffffff;
    font-size: 12.5px;
    font-weight: 900;
}

@media (max-width: 1200px) {
    .cash-voucher-entry-page .journal-header-grid {
        grid-template-columns: repeat(3, minmax(150px, 1fr));
    }

    .cash-voucher-entry-page .journal-header-grid > div:nth-child(n) {
        grid-column: auto;
    }

    .cash-voucher-entry-page .journal-header-grid > div:nth-child(9),
    .cash-voucher-entry-page .journal-header-grid > div:nth-child(13) {
        grid-column: 1 / -1 !important;
    }
}

.gcr-entry-page {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.gcr-entry-page .page-header-actions {
    min-height: 64px;
    margin: 0;
    padding: 10px 16px 0;
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.gcr-entry-page .page-header-actions h2 {
    margin: 0;
    font-size: 28px;
    font-weight: 900;
    color: #111827;
}

.gcr-entry-page .page-header-actions > div {
    display: flex !important;
    align-items: center;
    flex-wrap: nowrap !important;
    gap: 9px !important;
}

.gcr-entry-page .page-header-actions .save-btn,
.gcr-entry-page .page-header-actions .collapse-btn,
.gcr-entry-page .page-header-actions .delete-small-btn {
    height: 40px;
    min-width: 88px;
    padding: 0 16px;
    border-radius: 10px;
    font-weight: 900;
}

.gcr-entry-page .journal-page {
    gap: 14px !important;
    min-height: 0 !important;
}

.gcr-entry-page .journal-card:first-of-type {
    min-height: 0 !important;
    padding: 18px 20px !important;
}

.gcr-entry-page .journal-card:first-of-type > div:first-child {
    margin-bottom: 10px !important;
    padding: 8px 10px;
    border: 1px solid #e3ebf3;
    border-radius: 10px;
    background: #f8fafc;
}

.gcr-entry-page .journal-card:first-of-type > div:nth-child(2) {
    display: grid !important;
    grid-template-columns: minmax(170px, 220px) 1fr !important;
    gap: 14px !important;
}

.gcr-entry-page .journal-card:first-of-type .journal-card {
    min-height: 0 !important;
    padding: 12px !important;
    border-radius: 10px;
}

.gcr-entry-page .journal-header-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 12px 14px;
    align-items: end;
}

.gcr-entry-page .journal-header-grid > div {
    min-width: 0;
}

.gcr-entry-page .journal-header-grid > div[style*="grid-column"] {
    grid-column: 1 / -1 !important;
}

.gcr-entry-page .journal-card label {
    margin-bottom: 6px;
    color: #0f172a;
    font-size: 12.5px;
    font-weight: 900;
}

.gcr-entry-page .form-control,
.gcr-entry-page .grid-input {
    min-height: 40px;
    border-color: #d3dde8;
    border-radius: 8px;
    font-size: 14px;
}

.gcr-entry-page .search-row {
    margin: 0 !important;
}

.gcr-entry-page .search-row .collapse-btn {
    height: 40px;
    min-width: 46px;
    border-radius: 9px;
    background: #334155;
    color: #ffffff;
}

.gcr-money-row {
    grid-column: 1 / -1 !important;
    grid-template-columns: minmax(170px, 210px) minmax(320px, 380px) minmax(210px, 260px) !important;
    gap: 12px !important;
    justify-content: end !important;
}

.gcr-entry-page .journal-grid-hint {
    margin-top: 8px !important;
}

.gcr-entry-page .gcr-tab-panel {
    min-height: 0 !important;
    padding: 0 !important;
    overflow: hidden;
    border-radius: 12px;
}

.gcr-entry-page .gcr-tab-panel > div:first-child {
    min-height: 50px;
    margin: 0 !important;
    padding: 8px 12px;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 7px !important;
    flex-wrap: wrap !important;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
}

.gcr-entry-page .gcr-tab-panel > div:first-child > button {
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 92px !important;
    max-width: 190px !important;
    height: 34px !important;
    margin: 0 !important;
    padding: 0 14px !important;
    border-radius: 10px !important;
    border: 1px solid #cfd9e7 !important;
    background: #ffffff !important;
    color: #334155 !important;
    box-shadow: none !important;
    font-size: 13px !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
}

.gcr-entry-page .gcr-tab-panel > div:first-child > button:nth-child(1),
.gcr-entry-page .gcr-tab-panel > div:first-child > button:nth-child(2),
.gcr-entry-page .gcr-tab-panel > div:first-child > button:nth-child(3) {
    min-width: 88px !important;
    background: #ffffff !important;
    color: #334155 !important;
}

.gcr-entry-page .gcr-tab-panel > div:first-child > button.save-btn:nth-child(1),
.gcr-entry-page .gcr-tab-panel > div:first-child > button.save-btn:nth-child(2),
.gcr-entry-page .gcr-tab-panel > div:first-child > button.save-btn:nth-child(3) {
    background: #16a34a !important;
    border-color: #16a34a !important;
    color: #ffffff !important;
}

.gcr-entry-page .gcr-tab-panel > div:first-child > button:not(.save-btn):hover {
    background: #f0fdf4 !important;
    border-color: #86efac !important;
    color: #15803d !important;
}

.gcr-entry-page .gcr-tab-panel > div:first-child > .journal-grid-hint {
    flex: 1 1 240px;
    margin: 0 !important;
    color: #64748b;
    text-align: left;
}

.gcr-entry-page .journal-grid-wrap {
    max-height: min(58vh, 620px) !important;
    border-top: 0;
}

.gcr-entry-page .journal-grid thead th {
    height: 34px;
    background: #193b62;
    color: #ffffff;
}

@media (max-width: 1200px) {
    .gcr-entry-page .journal-card:first-of-type > div:nth-child(2),
    .gcr-entry-page .journal-header-grid,
    .gcr-money-row {
        grid-template-columns: 1fr !important;
    }
}

.app-shell.rtl .journal-grid,
.app-shell.rtl .data-table,
.app-shell.rtl .item-lookup-grid,
.app-shell.rtl .item-vb-grid,
.app-shell.rtl .erp-data-grid,
.app-shell.rtl .statement-grid {
    direction: rtl !important;
}

.app-shell.ltr .journal-grid,
.app-shell.ltr .data-table,
.app-shell.ltr .item-lookup-grid,
.app-shell.ltr .item-vb-grid,
.app-shell.ltr .erp-data-grid,
.app-shell.ltr .statement-grid {
    direction: ltr !important;
}

.app-shell.rtl .journal-grid th,
.app-shell.rtl .journal-grid td,
.app-shell.rtl .data-table th,
.app-shell.rtl .data-table td,
.app-shell.rtl .item-lookup-grid th,
.app-shell.rtl .item-lookup-grid td,
.app-shell.rtl .item-vb-grid th,
.app-shell.rtl .item-vb-grid td,
.app-shell.rtl .erp-data-grid th,
.app-shell.rtl .erp-data-grid td,
.app-shell.rtl .statement-grid th,
.app-shell.rtl .statement-grid td {
    text-align: right;
}

.app-shell.ltr .journal-grid th,
.app-shell.ltr .journal-grid td,
.app-shell.ltr .data-table th,
.app-shell.ltr .data-table td,
.app-shell.ltr .item-lookup-grid th,
.app-shell.ltr .item-lookup-grid td,
.app-shell.ltr .item-vb-grid th,
.app-shell.ltr .item-vb-grid td,
.app-shell.ltr .erp-data-grid th,
.app-shell.ltr .erp-data-grid td,
.app-shell.ltr .statement-grid th,
.app-shell.ltr .statement-grid td {
    text-align: left;
}

.app-shell.ltr .journal-grid input,
.app-shell.ltr .journal-grid select,
.app-shell.ltr .data-table input,
.app-shell.ltr .data-table select,
.app-shell.ltr .item-lookup-grid input,
.app-shell.ltr .item-lookup-grid select,
.app-shell.ltr .item-vb-grid input,
.app-shell.ltr .item-vb-grid select,
.app-shell.ltr .erp-data-grid input,
.app-shell.ltr .erp-data-grid select,
.app-shell.ltr .statement-grid input,
.app-shell.ltr .statement-grid select {
    text-align: left;
}

.app-shell.rtl .journal-grid input,
.app-shell.rtl .journal-grid select,
.app-shell.rtl .data-table input,
.app-shell.rtl .data-table select,
.app-shell.rtl .item-lookup-grid input,
.app-shell.rtl .item-lookup-grid select,
.app-shell.rtl .item-vb-grid input,
.app-shell.rtl .item-vb-grid select,
.app-shell.rtl .erp-data-grid input,
.app-shell.rtl .erp-data-grid select,
.app-shell.rtl .statement-grid input,
.app-shell.rtl .statement-grid select {
    text-align: right;
}

.app-shell .journal-grid .num-cell,
.app-shell .journal-grid .ltr-cell,
.app-shell .data-table .num-cell,
.app-shell .data-table .ltr-cell,
.app-shell .item-lookup-grid .num-cell,
.app-shell .item-lookup-grid .ltr-cell,
.app-shell .item-vb-grid .num-cell,
.app-shell .item-vb-grid .ltr-cell,
.app-shell .erp-data-grid .num-cell,
.app-shell .erp-data-grid .ltr-cell,
.app-shell .statement-grid .num-cell,
.app-shell .statement-grid .ltr-cell {
    direction: ltr !important;
    text-align: center;
}

.stock-balance-page {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.stock-balance-toolbar {
    grid-template-columns: minmax(150px, 210px) minmax(190px, 250px) auto auto auto minmax(120px, 170px);
}

.stock-balance-summary {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
}

.stock-balance-grid th,
.stock-balance-grid td {
    white-space: nowrap;
}

.stock-balance-grid td:nth-child(2),
.stock-balance-grid td:nth-child(3) {
    min-width: 180px;
    white-space: normal;
}

@media (max-width: 900px) {
    .stock-balance-toolbar {
        grid-template-columns: 1fr 1fr;
    }
}

@media print {
    body:has(.stock-balance-page) .stock-balance-page > :not(.stock-balance-print-sheet) {
        display: none !important;
    }

    body:has(.stock-balance-page) .stock-balance-print-sheet {
        display: block !important;
    }
}

/* SaaS report filters */
.account-statement-page {
    gap: 14px !important;
    padding: 12px 18px 22px;
}

.account-statement-page .statement-saas-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    min-height: 70px;
    padding: 4px 0 4px;
}

.account-statement-page .statement-title-block {
    display: flex;
    align-items: center;
    gap: 14px;
}

.account-statement-page .statement-title-icon {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #ecfdf5;
    color: #0f9f8f;
    border: 1px solid #b7efe4;
    font-size: 20px;
    font-weight: 900;
}

.account-statement-page .statement-title-block h2 {
    margin: 0;
    color: #172033;
    font-size: 27px;
    font-weight: 900;
    letter-spacing: 0;
}

.account-statement-page .statement-breadcrumb {
    margin-top: 5px;
    color: #8090a7;
    font-size: 14px;
    font-weight: 700;
}

.account-statement-page .statement-breadcrumb span {
    margin-inline: 8px;
    color: #b7c2d1;
}

.account-statement-page .account-report-actions {
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding-top: 6px;
}

.account-statement-page .account-report-actions .save-btn,
.account-statement-page .account-report-actions .collapse-btn {
    width: auto !important;
    height: 36px;
    min-height: 36px;
    min-width: 86px;
    padding: 0 14px;
    border-radius: 8px;
    border: 1px solid #d7e0eb;
    background: #fff;
    color: #1f2b3d;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .05);
    font-size: 13px;
    font-weight: 900;
}

.account-statement-page .account-report-actions .statement-primary-action {
    min-width: 120px;
    background: linear-gradient(180deg, #16b65b, #079443);
    border-color: #079443;
    color: #fff;
    box-shadow: 0 14px 24px rgba(8, 148, 67, .24);
}

.account-statement-page .account-statement-filter {
    border: 1px solid #dbe4ef !important;
    border-top: 0 !important;
    border-radius: 12px !important;
    padding: 18px 24px 20px !important;
    background: #fff !important;
    box-shadow: 0 10px 26px rgba(15, 23, 42, .06);
}

.account-statement-page .statement-filter-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.account-statement-page .statement-filter-title h3 {
    margin: 0;
    color: #1d2939;
    font-size: 19px;
    font-weight: 900;
}

.account-statement-page .statement-filter-title span:not(.statement-filter-symbol) {
    display: block;
    margin-top: 4px;
    color: #7c8aa0;
    font-size: 12px;
    font-weight: 700;
}

.account-statement-page .statement-filter-symbol {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    color: #0f766e;
    background: #ecfdf5;
    border: 1px solid #b7efe4;
    font-size: 17px;
    font-weight: 900;
}

.account-statement-page .statement-filter-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 14px 18px !important;
    align-items: start !important;
}

.account-statement-page .statement-filter-grid > div {
    min-width: 0;
}

.account-statement-page .statement-filter-grid label {
    margin-bottom: 6px !important;
    color: #233044 !important;
    font-size: 13px !important;
    font-weight: 900 !important;
}

.account-statement-page .statement-date-stack {
    display: grid !important;
    gap: 10px !important;
    padding: 0 !important;
}

.account-statement-page .account-statement-filter .form-control {
    height: 42px !important;
    min-height: 42px !important;
    padding: 0 13px !important;
    border: 1px solid #d5deea !important;
    border-radius: 8px !important;
    background: #fff !important;
    color: #172033 !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    box-shadow: inset 0 1px 1px rgba(15, 23, 42, .02);
}

.account-statement-page .account-statement-filter input[readonly],
.account-statement-page .account-statement-filter input:disabled,
.account-statement-page .account-statement-filter select:disabled {
    background: #f3f6fa !important;
}

.account-statement-page .account-statement-filter .square-picker-btn {
    width: 44px !important;
    min-width: 44px !important;
    height: 42px !important;
    min-height: 42px !important;
    border-radius: 9px !important;
    background: #273449 !important;
    color: #fff !important;
    font-size: 15px !important;
    box-shadow: none !important;
}

.account-statement-page .statement-checks {
    grid-column: 1 / -1;
    display: flex !important;
    align-items: center !important;
    gap: 20px !important;
    min-height: 46px !important;
    padding-top: 4px;
    border-top: 1px dashed #dce5ef;
}

.account-statement-page .statement-checks label {
    color: #243247;
    font-size: 13px;
    line-height: 1.35;
}

.account-statement-page .statement-checks input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #16a34a;
}

.account-statement-page .statement-filter-submit {
    display: flex;
    justify-content: flex-start;
    margin-top: 14px;
}

.account-statement-page .statement-wide-search {
    width: auto !important;
    min-width: 180px;
    height: 42px;
    border-radius: 9px;
    border: 1px solid #079443;
    background: linear-gradient(180deg, #18b760, #079443);
    color: #fff;
    box-shadow: 0 10px 18px rgba(8, 148, 67, .18);
    font-size: 14px;
    font-weight: 900;
}

@media (max-width: 1100px) {
    .account-statement-page .statement-saas-header {
        flex-direction: column;
    }

    .account-statement-page .statement-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 720px) {
    .account-statement-page {
        padding: 14px;
    }

    .account-statement-page .statement-filter-grid {
        grid-template-columns: 1fr !important;
    }

    .account-statement-page .account-report-actions .save-btn,
    .account-statement-page .account-report-actions .collapse-btn {
        min-width: 0;
        flex: 1 1 130px;
    }

    .account-statement-page .statement-checks {
        flex-direction: column;
        align-items: flex-start !important;
    }
}

.item-movement-page {
    display: grid;
    gap: 16px;
    padding: 18px;
    color: #172033;
}

.items-category-report-page {
    display: grid;
    gap: 16px;
    padding: 18px;
    color: #172033;
}

.sales-category-report-page {
    display: grid;
    gap: 16px;
    padding: 18px;
    color: #172033;
}

.item-movement-search,
.item-movement-result-header,
.item-movement-filter-panel {
    border: 1px solid #d9e4ef;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .05);
}

.item-movement-search {
    overflow: hidden;
}

.item-movement-hero,
.item-movement-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid #e6edf5;
    background: linear-gradient(180deg, #f8fbff, #eef5fb);
}

.item-movement-result-header {
    border-bottom: 0;
}

.item-movement-hero span,
.item-movement-result-header span {
    color: #64748b;
    font-size: 13px;
    font-weight: 800;
}

.item-movement-hero h2,
.item-movement-result-header h2 {
    margin: 4px 0 0;
    color: #10243d;
    font-size: 24px;
    font-weight: 900;
    letter-spacing: 0;
}

.item-movement-filter-panel {
    margin: 16px;
    padding: 18px;
    box-shadow: none;
}

.movement-filter-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.movement-filter-grid label {
    display: block;
    margin-bottom: 7px;
    color: #344256;
    font-size: 13px;
    font-weight: 900;
}

.movement-filter-grid .form-control {
    height: 42px;
    min-height: 42px;
    border: 1px solid #d4deea;
    border-radius: 8px;
    background: #fff;
    color: #132033;
    font-size: 14px;
    font-weight: 750;
}

.movement-job-field .search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    gap: 8px;
}

.movement-item-field {
    grid-column: span 2;
}

.category-report-filter {
    grid-template-columns: minmax(260px, 2fr) minmax(190px, 1fr);
    align-items: end;
}

.category-report-check {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid #d8e3ee;
    border-radius: 8px;
    background: #f8fbff;
    color: #243247;
    font-size: 13px;
    font-weight: 900;
}

.category-report-check input {
    width: 16px;
    height: 16px;
    accent-color: #0d9488;
}

.sales-category-modebar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px dashed #dce5ef;
}

.sales-category-modebar button {
    height: 36px;
    padding: 0 14px;
    border: 1px solid #d4e1ee;
    border-radius: 8px;
    background: #fff;
    color: #334155;
    font-size: 13px;
    font-weight: 900;
}

.sales-category-modebar button.active {
    border-color: #14b8a6;
    background: #ecfdf5;
    color: #0f766e;
}

.sales-category-filter-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.movement-job-field .collapse-btn {
    width: 44px;
    min-width: 44px;
    height: 42px;
    border-radius: 8px;
    background: #172033;
    color: #fff;
    font-weight: 900;
}

.item-movement-summary {
    grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.item-movement-summary div {
    border-color: #dfe8f2;
    background: linear-gradient(180deg, #ffffff, #f7fbff);
}

.item-movement-summary span {
    color: #607087;
    font-size: 12px;
    font-weight: 850;
}

.item-movement-summary strong {
    color: #0f1d32;
    font-size: 20px;
    font-weight: 950;
}

.item-movement-grid-wrap {
    max-height: calc(100vh - 320px);
    border: 1px solid #dbe5ef;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .04);
}

.item-movement-grid {
    min-width: 1380px;
}

.all-item-movement-page {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.all-item-movement-filter-grid {
    grid-template-columns: minmax(320px, 560px);
}

.all-item-movement-summary {
    grid-template-columns: repeat(5, minmax(150px, 1fr));
}

.all-item-movement-grid-wrap {
    max-height: calc(100vh - 330px);
}

.all-item-movement-grid {
    min-width: 1320px;
}

.all-item-movement-grid .lookup-name {
    min-width: 230px;
}

.vehicle-report-page {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.vehicle-report-filter-grid {
    grid-template-columns: minmax(240px, 1.4fr) minmax(240px, 1.4fr) repeat(3, minmax(150px, 1fr));
    align-items: end;
}

.vehicle-report-filter-grid .category-report-check {
    min-height: 42px;
}

.vehicle-report-summary {
    grid-template-columns: repeat(5, minmax(140px, 1fr));
}

.vehicle-report-grid-wrap {
    max-height: calc(100vh - 330px);
}

.vehicle-report-grid {
    min-width: 1320px;
}

.vehicle-report-modal {
    width: min(920px, calc(100vw - 48px));
    max-height: 82vh;
}

.vehicle-report-picker-filters {
    grid-template-columns: minmax(240px, 360px);
    justify-content: end;
    padding: 10px 16px;
    margin: 0;
}

.vehicle-report-picker-filters .search-box {
    margin: 0;
    width: 100%;
}

.vehicle-picker-grid-wrap {
    max-height: 460px;
    min-height: 320px;
    margin: 0 16px 16px;
    border: 1px solid #c9d3e1;
    border-radius: 0;
}

.vehicle-picker-grid-wrap .item-lookup-grid {
    min-width: 100%;
}

.vehicle-picker-grid-wrap .item-lookup-grid th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #4e4392;
}

@media (max-width: 1200px) {
    .vehicle-report-filter-grid {
        grid-template-columns: repeat(3, minmax(180px, 1fr));
    }
}

@media (max-width: 760px) {
    .vehicle-report-filter-grid {
        grid-template-columns: minmax(240px, 1fr);
    }

    .vehicle-report-summary {
        grid-template-columns: repeat(2, minmax(150px, 1fr));
    }
}

.inventory-check-page {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.inventory-check-filter-grid {
    grid-template-columns: minmax(280px, 420px);
}

.inventory-check-summary {
    grid-template-columns: repeat(5, minmax(150px, 1fr));
}

.inventory-check-grid-wrap {
    max-height: calc(100vh - 330px);
}

.inventory-check-grid {
    min-width: 1080px;
}

.inventory-check-grid .lookup-name {
    min-width: 260px;
}

.inventory-check-alert td {
    background: #fff7ed;
    color: #7c2d12;
}

.inventory-unit-balance-page {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.inventory-unit-balance-filter-grid {
    grid-template-columns: minmax(280px, 460px);
}

.inventory-unit-balance-summary {
    grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.inventory-unit-balance-grid-wrap {
    max-height: calc(100vh - 330px);
}

.inventory-unit-balance-grid {
    min-width: 980px;
}

.inventory-unit-balance-grid .lookup-name {
    min-width: 280px;
}

.inventory-store-balance-page {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.inventory-store-balance-filter-grid {
    grid-template-columns: minmax(240px, 1fr) minmax(300px, 1.1fr) minmax(240px, .9fr);
}

.inventory-store-balance-summary {
    grid-template-columns: repeat(5, minmax(150px, 1fr));
}

.inventory-store-balance-grid-wrap {
    max-height: calc(100vh - 330px);
}

.inventory-store-balance-grid {
    min-width: 1120px;
}

.inventory-store-balance-grid .lookup-name {
    min-width: 260px;
}

.category-report-grid {
    min-width: 920px;
}

.sales-category-grid {
    min-width: 1260px;
}

.purchase-cost-page {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.purchase-cost-filter-grid {
    grid-template-columns: repeat(4, minmax(180px, 1fr));
}

.purchase-cost-check {
    min-height: 44px;
}

.purchase-cost-summary {
    grid-template-columns: repeat(6, minmax(150px, 1fr));
}

.purchase-cost-grid {
    min-width: 1180px;
}

.purchase-cost-grid .lookup-name {
    min-width: 220px;
}

.bill-details-report-page {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.inventory-cost-page {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.inventory-cost-filter-grid {
    grid-template-columns: minmax(170px, 0.75fr) minmax(170px, 0.75fr) minmax(240px, 1fr) minmax(280px, 1.1fr);
    align-items: end;
}

.inventory-cost-method {
    min-width: 240px;
}

.inventory-cost-check {
    min-height: 44px;
    align-self: end;
}

.inventory-cost-summary {
    grid-template-columns: repeat(6, minmax(150px, 1fr));
}

.inventory-cost-grid-wrap {
    max-height: calc(100vh - 350px);
}

.inventory-cost-grid {
    min-width: 980px;
}

.inventory-cost-grid th,
.inventory-cost-grid td {
    white-space: nowrap;
}

.inventory-cost-grid .lookup-name {
    min-width: 260px;
    white-space: normal;
}

.subscription-report-page {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.subscription-summary {
    grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.subscription-grid-wrap {
    max-height: calc(100vh - 270px);
}

.subscription-grid {
    min-width: 1050px;
}

.subscription-grid .lookup-name {
    min-width: 240px;
}

.subscription-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 78px;
    height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 900;
}

.subscription-status.active {
    background: #dcfce7;
    color: #166534;
}

.subscription-status.expired {
    background: #fee2e2;
    color: #991b1b;
}

.subscription-status.missing {
    background: #f1f5f9;
    color: #475569;
}

.items-account-report-page {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.items-account-filter-grid {
    grid-template-columns: minmax(170px, 0.75fr) minmax(170px, 0.75fr) minmax(280px, 1.4fr);
}

.items-account-summary {
    grid-template-columns: minmax(230px, 1.4fr) repeat(4, minmax(150px, 1fr));
}

.items-account-grid-wrap {
    max-height: calc(100vh - 330px);
}

.items-account-grid {
    min-width: 1120px;
}

.items-account-grid .lookup-name {
    min-width: 240px;
}

.bill-details-filter-grid {
    grid-template-columns: minmax(240px, 1.4fr) repeat(3, minmax(170px, 1fr));
}

.bill-details-check {
    min-height: 44px;
}

.bill-details-summary {
    grid-template-columns: repeat(5, minmax(150px, 1fr));
}

.bill-details-grid {
    min-width: 1240px;
}

.bill-details-grid .lookup-name {
    min-width: 220px;
}

.bill-details-total-row td {
    background: #e8f3ff;
    color: #b42318;
    font-weight: 900;
}

.status-bill-filter-grid {
    grid-template-columns: repeat(3, minmax(170px, 1fr));
}

.status-bill-summary {
    grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.status-bill-grid-wrap {
    max-height: calc(100vh - 330px);
}

.status-bill-grid {
    min-width: 1260px;
}

.status-bill-grid .lookup-name {
    min-width: 180px;
}

.customer-item-filter-grid {
    grid-template-columns: repeat(3, minmax(170px, 1fr)) repeat(2, minmax(240px, 1.2fr));
}

.customer-picker-searchbar {
    grid-template-columns: minmax(0, 1fr);
}

.customer-item-summary {
    grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.customer-item-grid-wrap {
    max-height: calc(100vh - 330px);
}

.customer-item-grid {
    min-width: 1520px;
}

.customer-item-grid .lookup-name {
    min-width: 180px;
}

.category-report-grid-wrap {
    max-height: calc(100vh - 360px);
}

.sales-category-grid-wrap {
    max-height: calc(100vh - 330px);
}

.category-report-actions {
    justify-content: flex-start;
}

.category-report-summary {
    grid-template-columns: repeat(4, minmax(140px, 1fr));
}

.item-movement-grid th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f2f6fb;
    color: #26364b;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.item-movement-grid td {
    color: #1f2d3f;
    font-size: 13px;
    vertical-align: middle;
    white-space: nowrap;
}

.item-movement-grid .lookup-name {
    min-width: 210px;
    white-space: normal;
    font-weight: 850;
}

.item-movement-grid .ltr-cell,
.item-movement-grid .num-cell {
    direction: ltr;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.grid-mini-btn {
    min-width: 58px;
    height: 30px;
    border: 1px solid #bfe7df;
    border-radius: 7px;
    background: #ecfdf5;
    color: #047857;
    font-size: 12px;
    font-weight: 900;
}

.grid-mini-btn:hover {
    background: #d1fae5;
}

.movement-opening-row td {
    background: #fff7ed !important;
    color: #7c2d12 !important;
    font-weight: 900;
}

.movement-item-picker {
    width: min(860px, calc(100vw - 32px));
    height: auto;
    max-height: min(78vh, 700px);
    border-radius: 14px;
    border: 1px solid #c7d2e0;
    box-shadow: 0 28px 70px rgba(15, 23, 42, .32);
    background: #fff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.movement-item-picker .erp-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 22px;
    color: #fff;
    background: linear-gradient(90deg, #1e3a5f, #4f3f93);
}

.movement-item-picker .erp-picker-header > div {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.movement-item-picker .erp-picker-header strong {
    font-size: 18px;
    font-weight: 900;
}

.movement-item-picker .erp-picker-header span {
    font-size: 12.5px;
    color: rgba(255, 255, 255, .82);
}

.movement-item-picker .erp-picker-close {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 9px;
    background: rgba(255, 255, 255, .14);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: background .15s;
}

.movement-item-picker .erp-picker-close:hover {
    background: #dc2626;
}

.movement-item-picker .erp-item-picker-searchbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(170px, 240px);
    gap: 10px;
    padding: 14px 22px;
    background: #f1f5fb;
    border-bottom: 1px solid #dbe4f0;
}

.movement-item-picker .erp-item-picker-searchbar .form-control {
    height: 40px;
    border-radius: 9px;
    border: 1px solid #c2cedd;
    background: #fff;
}

.movement-item-picker .erp-item-picker-grid-wrap {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    background: #fff;
}

.movement-item-picker .erp-item-picker-grid {
    width: 100%;
    min-width: 0;
    table-layout: auto;
}

.movement-item-picker .erp-item-picker-grid th,
.movement-item-picker .erp-item-picker-grid td {
    width: auto;
}

.movement-item-picker .erp-item-picker-grid .lookup-name {
    min-width: 0;
    width: 42%;
}

.movement-item-picker .erp-item-picker-grid tbody tr {
    cursor: pointer;
}

.movement-item-picker .lookup-empty {
    padding: 26px 12px;
    text-align: center;
    color: #64748b;
    font-weight: 700;
}

.item-movement-print-sheet {
    display: none;
}

.item-movement-print-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}

.item-movement-print-table th,
.item-movement-print-table td {
    border: 1px solid #b9c4d0;
    padding: 5px 6px;
}

.item-movement-print-table th {
    background: #eef3f8;
    font-weight: 900;
}

@media (max-width: 900px) {
    .item-movement-hero,
    .item-movement-result-header {
        align-items: stretch;
        flex-direction: column;
    }

    .movement-filter-grid,
    .item-movement-summary {
        grid-template-columns: 1fr;
    }

    .item-movement-grid-wrap {
        max-height: none;
    }
}

@media print {
    body:has(.item-movement-page) .item-movement-page > :not(.item-movement-print-sheet) {
        display: none !important;
    }

    body:has(.item-movement-page) .item-movement-print-sheet {
        display: block !important;
        padding: 0;
        color: #000;
        background: #fff;
    }
}

.store-transfer-page {
    display: grid;
    gap: 14px;
}

.store-transfer-card,
.store-transfer-lines-card {
    display: grid;
    gap: 14px;
}

.store-transfer-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 10px;
}

.store-transfer-badge {
    border: 1px solid #d8e3ee;
    border-radius: 8px;
    background: #f8fafc;
    padding: 12px 14px;
}

.store-transfer-badge span {
    display: block;
    color: #52657c;
    font-size: 12px;
    font-weight: 800;
}

.store-transfer-badge strong {
    display: block;
    margin-top: 5px;
    color: #0f233d;
    font-size: 22px;
    font-weight: 950;
    font-variant-numeric: tabular-nums;
}

.store-transfer-badge.in {
    border-color: #b7ead7;
    background: #ecfdf5;
}

.store-transfer-badge.out {
    border-color: #fed7aa;
    background: #fff7ed;
}

.store-transfer-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(190px, 1fr));
    gap: 12px;
}

.store-transfer-form label {
    display: grid;
    gap: 6px;
    color: #334155;
    font-size: 12px;
    font-weight: 900;
}

.store-transfer-note {
    grid-column: span 3;
}

.store-transfer-table-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.store-transfer-table-head h3 {
    margin: 0;
    color: #10233b;
    font-size: 16px;
    font-weight: 950;
}

.store-transfer-grid-wrap {
    max-height: calc(100vh - 405px);
}

.store-transfer-grid {
    min-width: 1120px;
}

.store-transfer-grid .grid-input {
    width: 100%;
    min-width: 96px;
    height: 32px;
    border: 1px solid #cdd9e6;
    border-radius: 6px;
    background: #fff;
    padding: 4px 8px;
    color: #10233b;
    font-size: 12px;
    font-weight: 800;
}

.store-transfer-grid .grid-input:focus {
    border-color: #14b8a6;
    box-shadow: 0 0 0 2px rgba(20, 184, 166, .14);
    outline: none;
}

.store-transfer-grid .danger {
    border-color: #fecaca;
    background: #fff1f2;
    color: #be123c;
}

.store-transfer-grid .danger:hover {
    background: #ffe4e6;
}

@media (max-width: 1000px) {
    .store-transfer-strip,
    .store-transfer-form {
        grid-template-columns: 1fr;
    }

    .store-transfer-note {
        grid-column: auto;
    }
}

/* ===== Compact daily invoice workspace ===== */
.bill-entry-page:not(.pos-entry-page) {
    --bill-head: #173a5e;
    --bill-line: #c9d6e4;
    --bill-focus: #0f8f78;
    padding: 0 4px 10px;
    background: #eef3f8;
}

.bill-entry-page:not(.pos-entry-page) .page-header-actions {
    min-height: 48px;
    margin: 0 0 6px;
    padding: 6px 10px;
    border: 1px solid #d6e1ec;
    background: #f7fbff;
}

.bill-entry-page:not(.pos-entry-page) .page-header-actions h2 {
    margin: 0;
    color: #10233b;
    font-size: 24px;
    font-weight: 950;
    line-height: 1.1;
}

.bill-entry-page:not(.pos-entry-page) .page-header-actions > div {
    gap: 6px !important;
}

.bill-entry-page:not(.pos-entry-page) .page-header-actions .save-btn,
.bill-entry-page:not(.pos-entry-page) .page-header-actions .collapse-btn {
    min-height: 34px;
    height: 34px;
    border-radius: 8px;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 900;
}

.bill-entry-page:not(.pos-entry-page) .page-header-actions .save-btn {
    width: 120px;
}

.bill-entry-page:not(.pos-entry-page) .bill-header-card,
.bill-entry-page:not(.pos-entry-page) .bill-grid-card,
.bill-entry-page:not(.pos-entry-page) .bill-total-card {
    margin: 0 0 6px;
    border: 1px solid #cbd9e8;
    border-radius: 6px;
    background: #fff;
    box-shadow: none;
}

.bill-entry-page:not(.pos-entry-page) .bill-header-card {
    padding: 8px 10px;
}

.bill-entry-page:not(.pos-entry-page) .bill-header-grid {
    direction: rtl;
    grid-template-columns: repeat(6, minmax(145px, 1fr));
    gap: 7px 10px;
    align-items: end;
}

.bill-entry-page:not(.pos-entry-page) .bill-header-grid > div:nth-child(n) {
    grid-column: auto;
    grid-row: auto;
    direction: rtl;
}

.bill-entry-page:not(.pos-entry-page) .bill-header-grid > div:nth-child(2),
.bill-entry-page:not(.pos-entry-page) .bill-header-grid > div:nth-child(7),
.bill-entry-page:not(.pos-entry-page) .bill-header-grid > div:nth-child(9),
.bill-entry-page:not(.pos-entry-page) .bill-header-grid > div:nth-child(11) {
    grid-column: span 2;
}

.bill-entry-page:not(.pos-entry-page) .bill-header-grid label,
.bill-entry-page:not(.pos-entry-page) .bill-totals-row label {
    display: block;
    margin: 0 0 3px;
    color: #26364b;
    font-size: 11px;
    font-weight: 900;
}

.bill-entry-page:not(.pos-entry-page) .bill-header-grid .form-control,
.bill-entry-page:not(.pos-entry-page) .bill-total-card .form-control {
    height: 34px;
    min-height: 34px;
    padding: 4px 10px;
    border: 1px solid #cdd9e6;
    border-radius: 8px;
    color: #10233b;
    font-size: 13px;
    font-weight: 750;
}

.bill-entry-page:not(.pos-entry-page) .bill-header-grid .form-control:focus,
.bill-entry-page:not(.pos-entry-page) .bill-total-card .form-control:focus,
.bill-entry-page:not(.pos-entry-page) .bill-items-grid .grid-input:focus {
    border-color: var(--bill-focus);
    box-shadow: 0 0 0 2px rgba(15, 143, 120, .12);
}

.bill-entry-page:not(.pos-entry-page) .bill-header-grid .collapse-btn,
.bill-entry-page:not(.pos-entry-page) .bill-header-grid .square-picker-btn {
    width: 34px;
    min-width: 34px;
    min-height: 34px;
    height: 34px;
    padding: 0;
    border-radius: 8px;
    font-size: 12px;
}

.bill-entry-page:not(.pos-entry-page) .bill-lookup-row {
    grid-template-columns: minmax(0, 1fr) 34px;
    gap: 6px;
}

.bill-entry-page:not(.pos-entry-page) .bill-currency-row {
    grid-template-columns: minmax(0, 1fr) 72px 34px;
    gap: 6px;
}

.bill-entry-page:not(.pos-entry-page) .bill-grid-card {
    padding: 6px 8px;
}

.bill-entry-page:not(.pos-entry-page) .bill-grid-actions {
    min-height: 34px;
    margin-bottom: 5px;
    gap: 8px;
}

.bill-entry-page:not(.pos-entry-page) .bill-grid-actions .collapse-btn {
    min-height: 34px;
    height: 34px;
    padding: 0 16px;
    border-radius: 8px;
    font-size: 13px;
}

.bill-entry-page:not(.pos-entry-page) .journal-grid-hint {
    margin-inline-start: auto;
    max-width: 520px;
    padding: 7px 10px;
    border: 1px solid #e0e8f1;
    background: #f8fbff;
    color: #5b6f86;
    font-size: 11px;
}

.bill-entry-page:not(.pos-entry-page) .journal-grid-wrap {
    border: 1px solid #cbd9e8;
    border-radius: 4px;
    background: #fff;
}

.bill-entry-page:not(.pos-entry-page) .bill-items-grid {
    min-width: 1220px;
}

.bill-entry-page:not(.pos-entry-page) .bill-items-grid th {
    height: 30px;
    padding: 5px 8px;
    border-color: #234a73;
    background: var(--bill-head);
    color: #fff;
    font-size: 12px;
    font-weight: 900;
}

.bill-entry-page:not(.pos-entry-page) .bill-items-grid td {
    min-width: 92px;
    padding: 4px 6px;
    border-color: #c9d6e4;
}

.bill-entry-page:not(.pos-entry-page) .bill-items-grid th:nth-child(2),
.bill-entry-page:not(.pos-entry-page) .bill-items-grid td:nth-child(2) {
    min-width: 135px;
}

.bill-entry-page:not(.pos-entry-page) .bill-items-grid th:nth-child(3),
.bill-entry-page:not(.pos-entry-page) .bill-items-grid td:nth-child(3) {
    min-width: 260px;
}

.bill-entry-page:not(.pos-entry-page) .bill-items-grid .grid-input {
    height: 32px;
    min-height: 32px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 800;
}

.bill-entry-page:not(.pos-entry-page) .delete-small-btn {
    width: 30px;
    height: 30px;
    border-radius: 8px;
}

.bill-entry-page:not(.pos-entry-page) .bill-total-card {
    padding: 6px 8px;
}

.bill-entry-page:not(.pos-entry-page) .bill-totals-row {
    grid-template-columns: repeat(4, minmax(190px, 1fr));
    gap: 8px;
    margin-bottom: 6px;
}

.bill-entry-page:not(.pos-entry-page) .bill-total-field {
    grid-template-columns: 78px minmax(0, 1fr);
    min-height: 46px;
    padding: 6px 8px;
    border-radius: 6px;
    background: #f8fbff;
}

.bill-entry-page:not(.pos-entry-page) .bill-total-field label {
    text-align: start;
}

.bill-entry-page:not(.pos-entry-page) .bill-total-field .total-input {
    border-color: #0f8f78;
    background: #0f8f78;
    color: #fff;
    font-weight: 950;
}

.bill-entry-page:not(.pos-entry-page) .discount-tools {
    grid-template-columns: minmax(0, 1fr) 34px 54px;
}

.bill-entry-page:not(.pos-entry-page) .discount-tools .mini-action {
    width: auto;
    min-width: 34px;
    height: 34px;
    min-height: 34px;
    padding: 0 8px;
    border-radius: 8px;
}

.bill-entry-page:not(.pos-entry-page) textarea.form-control {
    min-height: 38px;
    height: 38px;
    resize: vertical;
}

@media (max-width: 1500px) {
    .bill-entry-page:not(.pos-entry-page) .bill-header-grid {
        grid-template-columns: repeat(4, minmax(155px, 1fr));
    }
}

@media (max-width: 980px) {
    .bill-entry-page:not(.pos-entry-page) .bill-header-grid,
    .bill-entry-page:not(.pos-entry-page) .bill-totals-row {
        grid-template-columns: repeat(2, minmax(160px, 1fr));
    }

    .bill-entry-page:not(.pos-entry-page) .bill-header-grid > div:nth-child(2),
    .bill-entry-page:not(.pos-entry-page) .bill-header-grid > div:nth-child(7),
    .bill-entry-page:not(.pos-entry-page) .bill-header-grid > div:nth-child(9),
    .bill-entry-page:not(.pos-entry-page) .bill-header-grid > div:nth-child(11) {
        grid-column: span 1;
    }
}

.subscriptions-shell {
    margin-bottom: 12px;
}

.subscriptions-filter-grid {
    grid-template-columns: 220px minmax(260px, 1fr);
}

.subscription-search-box {
    min-width: 280px;
}

.subscriptions-summary {
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    margin-bottom: 12px;
}

.subscriptions-grid-wrap {
    max-height: calc(100vh - 345px);
}

.subscriptions-grid {
    min-width: 1320px;
}

.subscriptions-grid tr {
    cursor: pointer;
}

.subscriptions-grid tr.selected-row td {
    background: #dbeafe !important;
}

.subscriptions-grid tr.subscription-urgent-row td {
    background: #fed7aa;
}

.subscriptions-grid tr.subscription-warning-row td {
    background: #fef9c3;
}

.subscriptions-grid tr.subscription-expired-row td {
    background: #fee2e2;
}

.subscriptions-grid .services-cell {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.subscription-status {
    display: inline-flex;
    min-width: 58px;
    justify-content: center;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 900;
}

.subscription-status.is-active {
    color: #047857;
    background: #d1fae5;
}

.subscription-status.is-expired {
    color: #b91c1c;
    background: #fee2e2;
}

.subscription-status.is-stopped {
    color: #92400e;
    background: #fef3c7;
}

.subscription-status.is-draft {
    color: #334155;
    background: #e2e8f0;
}

.subscription-editor-layout {
    display: grid;
    grid-template-columns: 1.2fr .9fr;
    gap: 12px;
    margin-bottom: 12px;
}

.subscription-panel,
.subscription-lines-section,
.subscription-note-panel {
    border: 1px solid #dbe5f0;
    background: #fff;
    padding: 14px;
}

.subscription-panel-title,
.subscription-lines-head strong,
.subscription-note-panel label {
    color: #10233b;
    font-size: 14px;
    font-weight: 950;
}

.subscription-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.subscription-customer-name {
    grid-column: span 2;
}

.subscription-picker-line {
    display: flex;
    gap: 6px;
    align-items: center;
}

.subscription-picker-line .form-control,
.subscription-picker-line .grid-input {
    flex: 1;
}

.picker-icon-btn {
    min-width: 42px;
    height: 34px;
    padding: 0 10px;
}

.subscription-lines-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.subscription-lines-grid {
    min-width: 900px;
}

.subscription-lines-grid .grid-input {
    width: 100%;
    min-width: 90px;
    height: 32px;
    border: 1px solid #cdd9e6;
    border-radius: 6px;
    background: #fff;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 800;
}

.row-delete-btn {
    width: 30px;
    height: 30px;
    border: 1px solid #fecaca;
    border-radius: 6px;
    color: #be123c;
    background: #fff1f2;
    font-weight: 950;
}

.subscription-note-panel {
    margin-top: 12px;
    display: grid;
    gap: 8px;
}

.subscription-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 4000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, .38);
}

.subscription-modal-panel {
    direction: rtl;
    max-height: calc(100vh - 70px);
    overflow: hidden;
    border: 1px solid #d6e2ef;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .24);
}

.subscription-picker-modal {
    width: min(860px, calc(100vw - 40px));
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 10px;
    padding: 14px;
}

.subscription-picker-searches {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 8px;
    margin-bottom: 10px;
}

.picker-grid-wrap {
    max-height: 420px;
}

.primary-soft {
    border-color: #99f6e4;
    background: #ecfeff;
    color: #0f766e;
}

@media (max-width: 1000px) {
    .subscriptions-filter-grid,
    .subscriptions-summary,
    .subscription-editor-layout,
    .subscription-form-grid,
    .subscription-picker-searches {
        grid-template-columns: 1fr;
    }

    .subscription-customer-name {
        grid-column: auto;
    }
}

/* Report grids: fit normal screens, scroll inside the grid only on narrow screens. */
.account-statement-page,
.item-movement-page,
.all-item-movements-page,
.inventory-check-page,
.items-category-report-page,
.sales-category-report-page,
.purchase-cost-report-page,
.bill-details-report-page,
.status-bill-report-page,
.customer-item-report-page,
.account-balances-page,
.financial-report-page,
.trial-balance-page,
.receivables-report-page,
.salesman-account-page {
    max-width: 100%;
    overflow-x: hidden;
}

.account-statement-page .statement-grid-wrap,
.item-movement-page .table-wrap,
.all-item-movements-page .table-wrap,
.inventory-check-page .table-wrap,
.items-category-report-page .table-wrap,
.sales-category-report-page .table-wrap,
.purchase-cost-report-page .table-wrap,
.bill-details-report-page .table-wrap,
.status-bill-report-page .table-wrap,
.customer-item-report-page .table-wrap,
.account-balances-page .table-wrap,
.financial-report-page .table-wrap,
.trial-balance-page .table-wrap,
.receivables-report-page .table-wrap,
.salesman-account-page .table-wrap {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: auto;
}

@media (max-width: 980px) {
    .item-movement-page .data-table,
    .all-item-movements-page .data-table,
    .inventory-check-page .data-table,
    .items-category-report-page .data-table,
    .sales-category-report-page .data-table,
    .purchase-cost-report-page .data-table,
    .bill-details-report-page .data-table,
    .status-bill-report-page .data-table,
    .customer-item-report-page .data-table,
    .account-balances-page .data-table,
    .financial-report-page .data-table,
    .trial-balance-page .data-table,
    .receivables-report-page .data-table,
    .salesman-account-page .data-table {
        min-width: 960px;
    }
}

@media print {
    body:has(.cash-voucher-print) * {
        visibility: hidden !important;
    }

    body:has(.account-statement-print-area),
    body:has(.cash-voucher-print) {
        margin: 0 !important;
        padding: 0 !important;
        min-height: 0 !important;
        height: auto !important;
        overflow: visible !important;
        background: #fff !important;
    }

    body:has(.account-statement-print-area) .erp-shell,
    body:has(.account-statement-print-area) .erp-main-content,
    body:has(.account-statement-print-area) .erp-page-content,
    body:has(.account-statement-print-area) .tab-workspace,
    body:has(.account-statement-print-area) .tab-page-frame.active,
    body:has(.cash-voucher-print) .erp-shell,
    body:has(.cash-voucher-print) .erp-main-content,
    body:has(.cash-voucher-print) .erp-page-content,
    body:has(.cash-voucher-print) .tab-workspace,
    body:has(.cash-voucher-print) .tab-page-frame.active {
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        min-height: 0 !important;
        height: auto !important;
        width: 100% !important;
        overflow: visible !important;
        background: #fff !important;
    }

    body:has(.account-statement-print-area) .erp-desktop-frame,
    body:has(.cash-voucher-print) .erp-desktop-frame {
        display: none !important;
    }

    body:has(.account-statement-print-area) .tab-page-frame:not(.active),
    body:has(.cash-voucher-print) .tab-page-frame:not(.active) {
        display: none !important;
    }

    body:has(.cash-voucher-print) .cash-voucher-print,
    body:has(.cash-voucher-print) .cash-voucher-print * {
        visibility: visible !important;
    }

    body:has(.cash-voucher-print) .cash-voucher-print {
        display: block !important;
        position: static !important;
        width: 100% !important;
        min-height: auto !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        background: #fff !important;
        break-after: avoid !important;
        page-break-after: avoid !important;
    }

    body:has(.cash-voucher-print) .cash-voucher-entry-page {
        display: block !important;
        visibility: visible !important;
        padding: 0 !important;
        margin: 0 !important;
        min-height: 0 !important;
        height: auto !important;
        overflow: visible !important;
    }

    body:has(.cash-voucher-print) .cash-voucher-entry-page > :not(.cash-voucher-print) {
        display: none !important;
    }

    body:has(.cash-voucher-print) .trial-print-sheet,
    body:has(.cash-voucher-print) .financial-print-sheet,
    body:has(.cash-voucher-print) .account-statement-print-area,
    body:has(.cash-voucher-print) .income-print-sheet,
    body:has(.cash-voucher-print) .all-day-print-sheet,
    body:has(.cash-voucher-print) .item-movement-print-sheet {
        display: none !important;
        visibility: hidden !important;
    }
}

/* Responsive report grids: shrink on normal screens, scroll inside the grid on tight screens. */
:is([class*="-report-page"],
    .account-statement-page,
    .income-statement-page,
    .final-accounts-page,
    .account-balances-page,
    .receivables-page,
    .salesman-account-page,
    .financial-report-page,
    .trial-balance-page,
    .all-day-report-page) {
    --report-grid-min: 1040px;
    max-width: 100%;
    overflow-x: hidden;
}

:is(.income-statement-page, .final-accounts-page) {
    --report-grid-min: 960px;
}

:is(.account-balances-page, .receivables-page, .trial-balance-page) {
    --report-grid-min: 980px;
}

:is(.account-statement-page, .financial-report-page) {
    --report-grid-min: 1040px;
}

:is(.all-day-report-page, .salesman-account-page) {
    --report-grid-min: 1120px;
}

:is(.bill-details-report-page,
    .item-movement-page,
    .all-item-movements-page,
    .inventory-check-page,
    .items-category-report-page,
    .sales-category-report-page,
    .purchase-cost-report-page,
    .status-bill-report-page,
    .customer-item-report-page,
    .inventory-unit-balance-page,
    .inventory-store-balance-page,
    .inventory-cost-page,
    .stock-balance-page,
    .subscriptions-report-page) {
    --report-grid-min: 1080px;
}

:is([class*="-report-page"],
    .account-statement-page,
    .income-statement-page,
    .final-accounts-page,
    .account-balances-page,
    .receivables-page,
    .salesman-account-page,
    .financial-report-page,
    .trial-balance-page,
    .all-day-report-page)
:is(.statement-grid-wrap,
    .item-lookup-grid-wrap,
    .item-movement-grid-wrap,
    .table-wrap,
    .journal-grid-wrap,
    .erp-grid-wrap) {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: auto;
    overscroll-behavior-inline: contain;
}

:is([class*="-report-page"],
    .account-statement-page,
    .income-statement-page,
    .final-accounts-page,
    .account-balances-page,
    .receivables-page,
    .salesman-account-page,
    .financial-report-page,
    .trial-balance-page,
    .all-day-report-page)
:is(.statement-grid,
    .item-lookup-grid,
    .item-movement-grid,
    .journal-grid,
    .data-table,
    .erp-data-grid) {
    width: 100% !important;
    min-width: var(--report-grid-min) !important;
    table-layout: fixed !important;
}

:is([class*="-report-page"],
    .account-statement-page,
    .income-statement-page,
    .final-accounts-page,
    .account-balances-page,
    .receivables-page,
    .salesman-account-page,
    .financial-report-page,
    .trial-balance-page,
    .all-day-report-page)
:is(.statement-grid,
    .item-lookup-grid,
    .item-movement-grid,
    .journal-grid,
    .data-table,
    .erp-data-grid) th,
:is([class*="-report-page"],
    .account-statement-page,
    .income-statement-page,
    .final-accounts-page,
    .account-balances-page,
    .receivables-page,
    .salesman-account-page,
    .financial-report-page,
    .trial-balance-page,
    .all-day-report-page)
:is(.statement-grid,
    .item-lookup-grid,
    .item-movement-grid,
    .journal-grid,
    .data-table,
    .erp-data-grid) td {
    padding: 6px 8px;
    font-size: 12.75px;
    line-height: 1.3;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
}

:is([class*="-report-page"],
    .account-statement-page,
    .income-statement-page,
    .final-accounts-page,
    .account-balances-page,
    .receivables-page,
    .salesman-account-page,
    .financial-report-page,
    .trial-balance-page,
    .all-day-report-page)
:is(.statement-grid,
    .item-lookup-grid,
    .item-movement-grid,
    .journal-grid,
    .data-table,
    .erp-data-grid) .num-cell,
:is([class*="-report-page"],
    .account-statement-page,
    .income-statement-page,
    .final-accounts-page,
    .account-balances-page,
    .receivables-page,
    .salesman-account-page,
    .financial-report-page,
    .trial-balance-page,
    .all-day-report-page)
:is(.statement-grid,
    .item-lookup-grid,
    .item-movement-grid,
    .journal-grid,
    .data-table,
    .erp-data-grid) .ltr-cell {
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

@media (min-width: 1280px) {
    :is([class*="-report-page"],
        .account-statement-page,
        .income-statement-page,
        .final-accounts-page,
        .account-balances-page,
        .receivables-page,
        .salesman-account-page,
        .financial-report-page,
        .trial-balance-page,
        .all-day-report-page)
    :is(.statement-grid,
        .item-lookup-grid,
        .item-movement-grid,
        .journal-grid,
        .data-table,
        .erp-data-grid) th,
    :is([class*="-report-page"],
        .account-statement-page,
        .income-statement-page,
        .final-accounts-page,
        .account-balances-page,
        .receivables-page,
        .salesman-account-page,
        .financial-report-page,
        .trial-balance-page,
        .all-day-report-page)
    :is(.statement-grid,
        .item-lookup-grid,
        .item-movement-grid,
        .journal-grid,
        .data-table,
        .erp-data-grid) td {
        font-size: 13px;
        padding-inline: 8px;
    }
}

@media (max-width: 980px) {
    :is([class*="-report-page"],
        .account-statement-page,
        .income-statement-page,
        .final-accounts-page,
        .account-balances-page,
        .receivables-page,
        .salesman-account-page,
        .financial-report-page,
        .trial-balance-page,
        .all-day-report-page) {
        --report-grid-min: 940px;
    }

    :is(.all-day-report-page, .salesman-account-page, .bill-details-report-page) {
        --report-grid-min: 1040px;
    }

    :is([class*="-report-page"],
        .account-statement-page,
        .income-statement-page,
        .final-accounts-page,
        .account-balances-page,
        .receivables-page,
        .salesman-account-page,
        .financial-report-page,
        .trial-balance-page,
        .all-day-report-page)
    :is(.statement-grid,
        .item-lookup-grid,
        .item-movement-grid,
        .journal-grid,
        .data-table,
        .erp-data-grid) th,
    :is([class*="-report-page"],
        .account-statement-page,
        .income-statement-page,
        .final-accounts-page,
        .account-balances-page,
        .receivables-page,
        .salesman-account-page,
        .financial-report-page,
        .trial-balance-page,
        .all-day-report-page)
    :is(.statement-grid,
        .item-lookup-grid,
        .item-movement-grid,
        .journal-grid,
        .data-table,
        .erp-data-grid) td {
        font-size: 12.25px;
        padding: 5px 6px;
    }
}

.logout-chip {
    cursor: pointer;
    transition: background .15s, color .15s, box-shadow .15s;
}

.logout-chip:hover:not(:disabled) {
    background: #dc2626;
    color: #fff;
    box-shadow: 0 4px 14px rgba(220, 38, 38, .35);
}

.logout-chip:hover:not(:disabled) .user-avatar,
.logout-chip:hover:not(:disabled) .user-company {
    color: #fff;
}

.logout-chip:disabled {
    opacity: .6;
    cursor: default;
}
