/* Shared web data-table presentation. Column widths follow their content role; visibility and business behavior are preserved. */
table.app-system-table {
    --app-table-header: var(--app-shell-color, #222D32);
    --app-table-line: #e8edf2;
    --app-table-text: #34465b;
    border-color: var(--app-table-line) !important;
    font-family: 'Titillium Web', Arial, sans-serif;
    color: var(--app-table-text);
    background-color: #fff;
}
table.app-system-table.app-system-table > thead,
table.app-system-table.app-system-table > thead > tr,
table.app-system-table.app-system-table > thead > tr > :is(th,td) {
    background: var(--app-table-header) !important;
    color: #fff !important;
    border: 0 !important;
    border-radius: 0 !important;
}
table.app-system-table.app-system-table > thead > tr > :is(th,td) {
    padding: 12px 14px;
    font-weight: 700 !important;
    font-family: inherit !important;
    font-size: 13px;
    line-height: 1.4;
    vertical-align: middle;
    border-top: 0 !important;
    border-bottom: 0 !important;
}
table.app-system-table > thead :is(a,span,i,small,strong,:is(label,span:where(.ef24-form-caption))) { color: inherit !important; }
table.app-system-table > thead :is(input,select,textarea) { color: #34465b; }
table.app-system-table > thead > tr > :is(.sorting,.sorting_asc,.sorting_desc) { padding-right: 32px !important; }
table.app-system-table > thead > tr > th:is(.sorting,.sorting_asc,.sorting_desc)::after { color: #fff; }
table.app-system-table.app-system-table > tbody > tr > :is(td,th) {
    padding: 10px 12px;
    border-color: var(--app-table-line) !important;
    border-top-width: 0;
    border-bottom: 1px solid var(--app-table-line);
    line-height: 1.5;
    vertical-align: middle;
}
/* Preserve explicit business highlights (stock, warnings, totals) and plugin selection. */
table.app-system-table > tbody > tr:not(.selected):not(.active):not(.success):not(.warning):not(.danger):not(.info):not([style*="background"]):nth-of-type(odd) { background-color: #fff; }
table.app-system-table > tbody > tr:not(.selected):not(.active):not(.success):not(.warning):not(.danger):not(.info):not([style*="background"]):nth-of-type(even) { background-color: #f8fafc; }
table.app-system-table > tbody > tr:not(.selected):not(.active):not(.success):not(.warning):not(.danger):not(.info):not([style*="background"]):hover { background-color: #edf5fa; }
table.app-system-table > tbody > tr.selected,
table.app-system-table > tbody > tr.selected > :is(td,th) { background-color: #dceefa !important; color: #1c445e; }
table.app-system-table > tfoot > tr > :is(td,th) { border-color: var(--app-table-line); }
table.app-system-table :is(td,th) > :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=button]):not([type=submit]):not([type=image]),select,textarea) {
    border-color: #ccd8e4;
    border-radius: 6px;
    box-sizing: border-box;
}
table.app-system-table :is(input,select,textarea):focus-visible { outline: 2px solid #4fa4dc; outline-offset: 1px; }
table.app-system-table [data-table-emphasis],
table.app-system-table [data-table-emphasis] > :is(input,textarea),
.app-product-picker-priced > tbody > tr > td:first-child:not([colspan]),
.app-product-picker-priced[data-product-price-column="4"] > tbody > tr > td:nth-child(4):not([colspan]),
.app-product-picker-priced[data-product-price-column="5"] > tbody > tr > td:nth-child(5):not([colspan]),
.app-product-picker-priced[data-product-price-column="6"] > tbody > tr > td:nth-child(6):not([colspan]) { font-weight: 700 !important; }
/* Badges are painted behind the original text, keeping cell DOM/export data untouched. */
table.app-system-table [data-table-status] {
    --state-bg: #edf1f5; --state-fg: #526174;
    position: relative; isolation: isolate;
    color: var(--state-fg) !important;
    font-weight: 700; text-align: center; white-space: nowrap;
}
table.app-system-table [data-table-status="success"] { --state-bg: #e4f8ec; --state-fg: #087b38; }
table.app-system-table [data-table-status="danger"] { --state-bg: #ffebee; --state-fg: #c82b3d; }
table.app-system-table [data-table-status="warning"] { --state-bg: #fff3d6; --state-fg: #875d00; }
table.app-system-table [data-table-status="info"] { --state-bg: #e4f2fd; --state-fg: #116c9d; }
table.app-system-table [data-table-status]::before {
    content: ""; position: absolute; z-index: -1; pointer-events: none;
    width: min(150px, calc(100% - 14px)); height: 28px; left: 50%; top: 50%;
    transform: translate(-50%, -50%); border-radius: 999px; background: var(--state-bg);
}
table.app-system-table [data-table-status] > :is(.label,.badge) { background: transparent !important; color: inherit !important; padding: 0; box-shadow: none; font: inherit; }
table.app-system-table .dtr-data[data-table-status] { display: inline-block; min-width: 110px; padding: 8px 12px; }
/* Sizing headers are structural DataTables clones, not another visible header. */
.dataTables_scrollBody > table.app-system-table > :is(thead,tfoot) > tr > :is(th,td) {
    padding-top: 0 !important; padding-bottom: 0 !important; height: 0 !important;
    border-top: 0 !important; border-bottom: 0 !important; line-height: 0 !important;
}
@media print { table.app-system-table > thead { print-color-adjust: exact; } }
/* Content-aware widths override legacy percentage allocations, never hide columns.
   Existing responsive wrappers keep horizontal scrolling on narrow screens. */
table.app-system-table:not(.dataTables_scrollHead table):not(.dataTables_scrollFoot table):has(> thead [data-table-column]) { table-layout: auto !important; }
table.app-system-table:not(.dataTables_scrollHead table):not(.dataTables_scrollFoot table).app-system-table > :is(thead,tbody) > tr > [data-table-column="description"] {
    width: auto !important; min-width: clamp(240px, 26vw, 380px);
    white-space: normal !important; overflow-wrap: break-word; text-align: left !important;
}
table.app-system-table:not(.dataTables_scrollHead table):not(.dataTables_scrollFoot table).app-system-table > :is(thead,tbody) > tr > [data-table-column="name"] {
    width: auto !important; min-width: 180px; white-space: normal !important; overflow-wrap: break-word;
}
table.app-system-table:not(.dataTables_scrollHead table):not(.dataTables_scrollFoot table).app-system-table > :is(thead,tbody) > tr > [data-table-column="code"] {
    width: 120px !important; min-width: 120px; white-space: normal !important; overflow-wrap: anywhere;
}
table.app-system-table:not(.dataTables_scrollHead table):not(.dataTables_scrollFoot table).app-system-table > :is(thead,tbody) > tr > :is([data-table-column="action"],[data-table-column="compact"],[data-table-column="number"]) {
    width: 1% !important; min-width: 64px;
}
table.app-system-table:not(.dataTables_scrollHead table):not(.dataTables_scrollFoot table).app-system-table > tbody > tr > [data-table-column="number"] { white-space: nowrap; }
table.app-system-table:not(.dataTables_scrollHead table):not(.dataTables_scrollFoot table).app-system-table > thead > tr > [data-table-column] { white-space: normal !important; }

/* Multiple native icon actions remain in their original cells, in one horizontal row. */
table.app-system-table.app-system-table > :is(thead,tbody) > tr > [data-table-actions-count]{width:1%!important;white-space:nowrap!important;text-align:center;vertical-align:middle}
table.app-system-table.app-system-table > :is(thead,tbody) > tr > [data-table-actions-count="2"]{min-width:104px!important}
table.app-system-table.app-system-table > :is(thead,tbody) > tr > [data-table-actions-count="3"]{min-width:146px!important}
table.app-system-table.app-system-table > :is(thead,tbody) > tr > [data-table-actions-count="4"]{min-width:188px!important}
table.app-system-table.app-system-table > :is(thead,tbody) > tr > [data-table-actions-count="5"]{min-width:230px!important}
table.app-system-table.app-system-table > :is(thead,tbody) > tr > [data-table-actions-count="6"]{min-width:272px!important}
table.app-system-table [data-table-actions-count] [data-table-action-slot]{display:inline-flex!important;align-items:center;justify-content:center;vertical-align:middle;min-width:32px;margin:0 3px;float:none}
table.app-system-table [data-table-actions-count] [data-table-action-wrap]{display:inline-flex;align-items:center;vertical-align:middle;gap:2px;margin:0;padding:0}
table.app-system-table [data-table-actions-count] > br{display:none}
table.app-system-table [data-table-actions-count] :is(a,button,input)[data-table-action-slot]{min-height:36px}

/* Empty state is outside the table: no synthetic records, cells or export content. */
table.app-system-table > tbody > tr.app-table-empty-row { display: none !important; }
.app-table-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; min-height: 172px; padding: 24px 18px; box-sizing: border-box; text-align: center; background: #f8fafc; color: #71869a; }
.app-table-empty__icon { display: block; flex: none; width: 58px; height: 58px; margin-bottom: 4px; }
.app-table-empty__disc { fill: #eaf3f9; stroke: #85b2ce; }
.app-table-empty__title { display: block; color: #344e63; font-size: 15px; font-weight: 600; line-height: 1.5; }
.app-table-empty__hint { margin: 0; max-width: 420px; color: #617589; font-size: 13px; line-height: 1.6; }
.app-table-empty__search-mark { display: none; }
.app-table-empty[data-empty-kind="search"] .app-table-empty__search-mark { display: block; }
.app-table-empty[data-empty-kind="search"] .app-table-empty__empty-mark { display: none; }
@media (max-width: 480px) { .app-table-empty { min-height: 152px; padding: 20px 14px; } .app-table-empty__hint { font-size: 12px; } }
@media print { .app-table-empty { display: none; } }

/* Issued-voucher mail and history keep independent, compact action columns. */
#tablaCombRecibidos.app-system-table > :is(thead,tbody) > tr > [data-issued-action] { width: 1% !important; min-width: 64px; text-align: center; vertical-align: middle; white-space: nowrap; }
