/* Shared presentation for the 44 column-and-row views. Business data and print layouts stay untouched. */
:root {
    --rsms-table-text: #193028;
    --rsms-table-muted: #62776d;
    --rsms-table-line: #dce8e0;
    --rsms-table-header: #f3f8f4;
    --rsms-table-hover: #f1f9f2;
    --rsms-table-focus: #177a28;
}

:is(.report-shell .report-table,
    .accounting-shell .trial-balance-table,
    .accounting-shell .accounting-data-table,
    .accounting-shell .dense-list-table,
    .accounting-shell .labour-line-table,
    .accounting-shell .opening-review-table,
    .accounting-shell .cash-bank-ledger-table,
    .stock-shell .ledger-table,
    .master-data-shell .party-table-shell,
    .master-data-shell .farmer-import-table-shell,
    .settings-module-shell .report-table,
    .excel-import-dialog .excel-import-table) {
    color: var(--rsms-table-text);
    background: #fff;
    border: 1px solid var(--rsms-table-line);
    border-radius: 6px;
    box-shadow: none;
    font-size: 13px;
    letter-spacing: 0;
    min-width: 0;
}

:is(.report-shell .report-table .table-head,
    .accounting-shell .trial-balance-table .table-head,
    .accounting-shell .accounting-data-head,
    .accounting-shell .dense-list-table .table-head,
    .accounting-shell .labour-line-table .table-head,
    .accounting-shell .opening-review-table thead,
    .accounting-shell .cash-bank-ledger-table thead,
    .stock-shell .ledger-row.heading,
    .master-data-shell .party-table-head,
    .master-data-shell .farmer-import-table-head,
    .settings-module-shell .report-table .table-head,
    .excel-import-dialog .excel-import-head) {
    background: var(--rsms-table-header);
    color: var(--rsms-table-muted);
    font-size: 12px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    border-bottom: 1px solid var(--rsms-table-line);
}

:is(.report-shell .report-table .table-row,
    .accounting-shell .trial-balance-table .table-row,
    .accounting-shell .accounting-data-row,
    .accounting-shell .dense-list-table .table-row,
    .accounting-shell .labour-line-table .table-row,
    .accounting-shell .opening-review-table tbody tr,
    .accounting-shell .cash-bank-ledger-table tbody tr,
    .stock-shell .ledger-row:not(.heading),
    .master-data-shell .party-table-row,
    .master-data-shell .farmer-import-table-row,
    .settings-module-shell .report-table .table-row,
    .excel-import-dialog .excel-import-row) {
    color: var(--rsms-table-text);
    background: #fff;
    border-top: 0;
    border-bottom: 1px solid var(--rsms-table-line);
    border-radius: 0;
    box-shadow: none;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0;
}

:is(.report-shell .report-table .table-row,
    .accounting-shell .trial-balance-table .table-row,
    .accounting-shell .accounting-data-row,
    .accounting-shell .dense-list-table .table-row,
    .accounting-shell .labour-line-table .table-row,
    .accounting-shell .opening-review-table tbody tr,
    .accounting-shell .cash-bank-ledger-table tbody tr,
    .stock-shell .ledger-row:not(.heading),
    .master-data-shell .party-table-row,
    .master-data-shell .farmer-import-table-row,
    .settings-module-shell .report-table .table-row,
    .excel-import-dialog .excel-import-row):hover {
    background: var(--rsms-table-hover);
}

:is(.report-shell .report-table,
    .accounting-shell .trial-balance-table,
    .accounting-shell .accounting-data-table,
    .accounting-shell .dense-list-table,
    .accounting-shell .labour-line-table,
    .accounting-shell .opening-review-table,
    .accounting-shell .cash-bank-ledger-table,
    .stock-shell .ledger-table,
    .master-data-shell .party-table-shell,
    .master-data-shell .farmer-import-table-shell,
    .settings-module-shell .report-table,
    .excel-import-dialog .excel-import-table) :is(button, a, select, input):focus-visible {
    outline: 2px solid var(--rsms-table-focus);
    outline-offset: -2px;
}

:is(.report-shell .report-table,
    .accounting-shell .trial-balance-table,
    .accounting-shell .accounting-data-table,
    .accounting-shell .dense-list-table,
    .accounting-shell .labour-line-table,
    .accounting-shell .opening-review-table,
    .accounting-shell .cash-bank-ledger-table,
    .stock-shell .ledger-table,
    .master-data-shell .party-table-shell,
    .master-data-shell .farmer-import-table-shell,
    .settings-module-shell .report-table,
    .excel-import-dialog .excel-import-table) :is(strong, b) {
    color: var(--rsms-table-text);
    font-weight: 600;
}

:is(.accounting-shell .accounting-data-table,
    .accounting-shell .dense-list-table,
    .master-data-shell .party-table-shell,
    .excel-import-dialog .excel-import-table) :is(small, em) {
    color: var(--rsms-table-muted);
    font-size: 11px;
    font-style: normal;
    font-weight: 400;
    line-height: 1.35;
}

:is(.report-shell .report-table,
    .accounting-shell .trial-balance-table,
    .accounting-shell .opening-review-table,
    .accounting-shell .cash-bank-ledger-table,
    .stock-shell .ledger-table,
    .settings-module-shell .report-table,
    .excel-import-dialog .excel-import-table) :is(.right, .numeric, td:nth-last-child(1)) {
    font-variant-numeric: tabular-nums;
}

.report-shell .report-table { gap: 0; }
.report-shell .report-table .table-head,
.report-shell .report-table .table-row { padding: 10px 12px; gap: 12px; }
.report-shell .report-table .table-head { border-bottom: 1px solid var(--rsms-table-line); }
.report-shell .report-table .table-row:first-child > span:first-child { font-weight: 600; }
.report-shell .report-table .table-row > span:first-child { font-weight: 600; }
.report-shell .report-table .table-row > span { min-width: 0; }
.report-shell .report-table .table-row > span:not(:first-child) { font-variant-numeric: tabular-nums; }
.report-shell .report-table .table-row.total { font-weight: 700; background: #f7faf7; }
.report-shell :is(.report-tab-pl, .report-tab-balance) .table-row > span:first-child { font-weight: 400; }
.report-shell :is(.report-tab-pl, .report-tab-balance) .table-row > span:nth-child(3) { font-weight: 600; }
.report-shell :is(.print-area, .report-table) { min-width: 0; }
.report-shell .print-area { overflow-x: auto; }
.report-shell .report-table :is(.table-head, .table-row) { grid-template-columns: var(--rsms-report-columns); }
.report-shell .report-tab-stock { --rsms-report-columns: minmax(145px, 1.3fr) minmax(90px, 1fr) minmax(95px, 1fr) repeat(3, minmax(85px, .7fr)); }
.report-shell .report-tab-farmers { --rsms-report-columns: minmax(160px, 1.4fr) repeat(5, minmax(90px, .75fr)); }
.report-shell .report-tab-rental { --rsms-report-columns: minmax(145px, 1fr) minmax(90px, .7fr) minmax(165px, 1.4fr) minmax(110px, 1fr) minmax(100px, .7fr) minmax(95px, .7fr); }
.report-shell :is(.report-tab-receivables, .report-tab-payables) { --rsms-report-columns: minmax(85px, .65fr) minmax(120px, 1fr) minmax(95px, .7fr) minmax(155px, 1.3fr) repeat(3, minmax(95px, .8fr)); }
.report-shell :is(.report-tab-pl, .report-tab-balance, .report-tab-partner-capital, .report-tab-partner-current) { --rsms-report-columns: minmax(90px, .7fr) minmax(105px, .7fr) minmax(180px, 1.5fr) minmax(125px, .9fr); }
.report-shell .report-tab-cash { --rsms-report-columns: minmax(95px, .7fr) minmax(185px, 1.5fr) repeat(3, minmax(120px, .9fr)); }
.report-shell .report-tab-ledger { --rsms-report-columns: minmax(95px, .7fr) minmax(115px, .8fr) minmax(165px, 1.3fr) minmax(190px, 1.5fr) repeat(3, minmax(115px, .8fr)); }
.report-shell .report-tab-journal { --rsms-report-columns: minmax(95px, .7fr) minmax(115px, .8fr) minmax(120px, .9fr) minmax(190px, 1.5fr) repeat(2, minmax(120px, .8fr)); }
.report-shell :is(.report-tab-cashbook, .report-tab-bankbook) { --rsms-report-columns: minmax(95px, .7fr) minmax(115px, .8fr) minmax(155px, 1.1fr) minmax(190px, 1.4fr) repeat(3, minmax(110px, .8fr)); }
.report-shell .report-tab-partner-profit { --rsms-report-columns: minmax(105px, .7fr) minmax(160px, 1.2fr) minmax(165px, 1.2fr) repeat(3, minmax(110px, .8fr)); }
.report-shell :is(.report-tab-valuation, .report-tab-assets, .report-tab-energy) { --rsms-report-columns: minmax(110px, .8fr) minmax(160px, 1.3fr) minmax(125px, 1fr) repeat(3, minmax(105px, .8fr)); }
.report-shell :is(.report-tab-stock, .report-tab-valuation, .report-tab-assets, .report-tab-energy) :is(.table-head, .table-row) > span:nth-child(n+4),
.report-shell .report-tab-farmers :is(.table-head, .table-row) > span:nth-child(n+2),
.report-shell .report-tab-rental :is(.table-head, .table-row) > span:nth-child(5),
.report-shell .report-tab-receivables :is(.table-head, .table-row) > span:nth-child(n+5),
.report-shell .report-tab-payables :is(.table-head, .table-row) > span:nth-child(n+4):nth-child(-n+6),
.report-shell :is(.report-tab-pl, .report-tab-balance, .report-tab-partner-capital, .report-tab-partner-current) :is(.table-head, .table-row) > span:last-child,
.report-shell .report-tab-cash :is(.table-head, .table-row) > span:nth-child(n+3),
.report-shell :is(.report-tab-ledger, .report-tab-journal, .report-tab-cashbook, .report-tab-bankbook) :is(.table-head, .table-row) > span:nth-child(n+5),
.report-shell .report-tab-partner-profit :is(.table-head, .table-row) > span:nth-child(n+4) {
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.report-shell .report-table .rsms-table-status {
    justify-self: start;
    overflow: visible;
    white-space: normal;
    text-overflow: clip;
    font-weight: 600;
}

.accounting-shell .trial-balance-table .table-head,
.accounting-shell .trial-balance-table .table-row { padding: 10px 12px; }
.accounting-shell .trial-balance-table .table-row.total { background: #f7faf7; font-weight: 700; }
.accounting-shell .trial-balance-table .table-row span:not(:first-child),
.accounting-shell .opening-review-table :is(th, td):not(:first-child) {
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.accounting-shell .accounting-data-head,
.accounting-shell .accounting-data-row { padding-inline: 12px; }
.accounting-shell .dense-list-table .table-head,
.accounting-shell .dense-list-table .table-row { padding-inline: 12px; }
.accounting-shell .dense-list-table { gap: 0; }
.accounting-shell .dense-list-table .table-row .right { font-variant-numeric: tabular-nums; font-weight: 600; }
.accounting-shell .opening-review-table { border-collapse: separate; border-spacing: 0; }
.accounting-shell .opening-review-table :is(th, td) { padding: 10px 12px; }
.accounting-shell .cash-bank-ledger-table { border-collapse: separate; border-spacing: 0; }
.accounting-shell .cash-bank-ledger-table :is(th, td) { padding: 10px 12px; }

.stock-shell .ledger-table { gap: 0; }
.stock-shell .operations-table-panel .ledger-table { overflow-x: auto; }
.stock-shell .ledger-table .ledger-row,
.stock-shell .ledger-table .operations-table-scroll { min-width: var(--rsms-stock-min-width); }
.stock-shell .ledger-table .ledger-row {
    grid-template-columns: var(--rsms-stock-columns);
    gap: 12px;
    padding-inline: 12px;
}
.stock-shell .rsms-stock-ledger { --rsms-stock-min-width: 980px; --rsms-stock-columns: 95px 125px 100px minmax(150px, 1fr) minmax(120px, .8fr) 115px 75px 95px; }
.stock-shell .rsms-stock-gross-profit { --rsms-stock-min-width: 980px; --rsms-stock-columns: 95px 120px minmax(155px, 1fr) repeat(4, minmax(105px, .7fr)) 50px; }
.stock-shell .rsms-stock-batch-profit { --rsms-stock-min-width: 1030px; --rsms-stock-columns: 120px 95px minmax(155px, 1fr) 125px 95px repeat(3, minmax(105px, .7fr)); }
.stock-shell .rsms-stock-processing { --rsms-stock-min-width: 800px; --rsms-stock-columns: 135px minmax(160px, 1fr) 120px 90px 110px 130px; }
.stock-shell .rsms-stock-own-stock { --rsms-stock-min-width: 1000px; --rsms-stock-columns: 125px 110px minmax(135px, 1fr) 115px 115px 80px 100px 125px; }
.stock-shell .rsms-stock-valuation { --rsms-stock-min-width: 1000px; --rsms-stock-columns: 125px 95px minmax(135px, 1fr) 110px 75px 105px 105px 125px; }
.stock-shell .ledger-row.heading { padding-block: 9px; }
.stock-shell .ledger-row:not(.heading) { height: 44px; min-height: 44px; max-height: 44px; }
.stock-shell .ledger-row:not(.heading) :is(strong, span:last-child) {
    font-variant-numeric: tabular-nums;
}
.stock-shell .ledger-row.button-row:hover { box-shadow: none; }
.stock-shell .ledger-row .rsms-table-status { justify-self: start; overflow: visible; font-weight: 600; }
.stock-shell :is(.rsms-stock-ledger, .rsms-stock-own-stock, .rsms-stock-valuation) .ledger-row > :nth-last-child(-n+2),
.stock-shell :is(.rsms-stock-gross-profit, .rsms-stock-batch-profit) .ledger-row > :nth-last-child(-n+3),
.stock-shell .rsms-stock-processing .ledger-row > :nth-child(n+4) {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.master-data-shell .party-table-head,
.master-data-shell .party-table-row,
.master-data-shell .farmer-import-table-head,
.master-data-shell .farmer-import-table-row,
.excel-import-dialog .excel-import-head,
.excel-import-dialog .excel-import-row { padding-block: 9px; padding-inline: 12px; }
.excel-import-dialog .excel-import-head { z-index: 2; }
.excel-import-dialog .excel-import-row :is(button.icon-danger, select) { align-self: center; }
.excel-import-dialog .excel-import-row :is(span, strong) { overflow-wrap: anywhere; }

.settings-module-shell .report-table { gap: 0; }
.settings-module-shell .report-table .table-head,
.settings-module-shell .report-table .table-row { padding: 10px 12px; }

.rsms-table-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    min-height: 22px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    white-space: normal;
}
.rsms-table-status.success { color: #176b32; background: #e4f5e9; }
.rsms-table-status.warning { color: #76510b; background: #fff1d0; }
.rsms-table-status.danger { color: #9d3036; background: #fdecef; }
.rsms-table-status.info { color: #155d8c; background: #e6f3fd; }
.rsms-table-status.neutral { color: #4f625c; background: #edf1ef; }

@media (max-width: 760px) {
    .report-shell .report-table { min-width: 760px; }
    .report-shell .print-area { overscroll-behavior-x: contain; }
    .accounting-shell .opening-review-table { min-width: 580px; }
    .accounting-shell .cash-bank-ledger-table { min-width: 820px; }
    .accounting-shell .operations-table-panel .trial-balance-table { min-width: 0; overflow-x: auto; }
    .accounting-shell .operations-table-panel .trial-balance-table :is(.table-head, .table-row),
    .accounting-shell .operations-table-panel .operations-table-scroll { min-width: 570px; }
    .stock-shell .operations-table-panel .ledger-table { min-width: 0; }
}

@media print {
    .report-shell .print-area { overflow: visible; }
    .report-shell .report-table { min-width: 0; }
    .rsms-table-status { border: 1px solid currentColor; }
}
