/*! NDIT CMS – © 2026 NdIT22 Kft. Minden jog fenntartva. Zárt licenc (docs/LICENSE.hu.txt). */
/* NDIT CMS – Táblázat elem. A beállítások CSS változókként érkeznek (render.php); üresen a stílus (preset) alapértéke. */
.nd-table {
    --tb-line: var(--nd-line, #e3e6ec);
    --tb-bw: 1px;
    --tb-bs: solid;
    --tb-py: 12px;
    --tb-px: 16px;
    --tb-fs: inherit;
    --tb-head-fs: inherit;
    --tb-head-w: 600;
    --tb-head-bg: transparent;
    --tb-head-ink: var(--nd-ink, inherit);
    --tb-stripe: color-mix(in srgb, var(--nd-ink, #111) 4%, transparent);
    --tb-hover: color-mix(in srgb, var(--nd-accent, #2563eb) 7%, transparent);
    --tb-foot-bg: color-mix(in srgb, var(--nd-ink, #111) 5%, transparent);
    --tb-col1-bg: transparent;
    width: 100%;
    color: var(--tb-ink, inherit);
}
.nd-table .nd-tb-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--tb-radius, 0); box-shadow: var(--tb-shadow, none); background: var(--tb-bg, transparent); }
.nd-table table { width: 100%; min-width: var(--tb-minw, 0); border-collapse: separate; border-spacing: 0; font-size: var(--tb-fs); line-height: 1.5; margin: 0; background: transparent; color: inherit; }
.nd-tb-fixed table { table-layout: fixed; }
.nd-table tr[hidden] { display: none !important; }
.nd-tb-auto { width: auto; display: flex; }
.nd-tb-auto .nd-tb-scroll { max-width: 100%; }
.nd-tb-auto table { width: auto; }
.nd-tb-at-center { justify-content: center; } .nd-tb-at-right { justify-content: flex-end; }
.nd-tb-auto.nd-tb-at-center, .nd-tb-auto.nd-tb-at-right, .nd-tb-auto.nd-tb-at-left { flex-direction: column; }
.nd-tb-auto.nd-tb-at-center { align-items: center; } .nd-tb-auto.nd-tb-at-right { align-items: flex-end; } .nd-tb-auto.nd-tb-at-left { align-items: flex-start; }
.nd-table th, .nd-table td { padding: var(--tb-py) var(--tb-px); text-align: left; vertical-align: middle; border: 0 var(--tb-bs) var(--tb-line); }
.nd-tb-va-top th, .nd-tb-va-top td { vertical-align: top; }
.nd-tb-va-bottom th, .nd-tb-va-bottom td { vertical-align: bottom; }
.nd-table .nd-ta-center { text-align: center; } .nd-table .nd-ta-right { text-align: right; }
.nd-tb-nowrap th, .nd-tb-nowrap td { white-space: nowrap; }
.nd-table thead th { background: var(--tb-head-bg); color: var(--tb-head-ink); font-weight: var(--tb-head-w); font-size: var(--tb-head-fs); letter-spacing: var(--tb-head-ls, normal); }
.nd-tb-upper thead th { text-transform: uppercase; font-size: calc(var(--tb-head-fs, 1em) * .92); }
.nd-table tbody th { font-weight: var(--tb-col1-w); background: var(--tb-col1-bg); color: var(--tb-col1-ink, inherit); }
.nd-table tfoot td, .nd-table tfoot th { background: var(--tb-foot-bg); color: var(--tb-foot-ink, inherit); font-weight: var(--tb-foot-w); }
.nd-table a { color: var(--nd-link, var(--nd-accent)); }
.nd-tb-striped tbody tr:nth-child(even of :not([hidden])) > * { background-color: var(--tb-stripe); }
@supports not selector(:nth-child(even of :not([hidden]))) { .nd-tb-striped tbody tr:nth-child(even) > * { background-color: var(--tb-stripe); } }
.nd-tb-hover tbody tr:hover > * { background-color: var(--tb-hover); }
.nd-tb-sticky thead th { position: sticky; top: var(--head-h, 0px); z-index: 2; background: var(--tb-head-bg-solid, var(--tb-head-bg)); }
.nd-tb-sticky .nd-tb-scroll { overflow: visible; }

/* ---------- stílusok (színek); a vonalakat a nd-tb-l-* osztály adja: a stílus alapértéke, vagy a „Vonalak” beállítás ---------- */
.nd-tb-grid { --tb-head-bg: color-mix(in srgb, var(--nd-ink, #111) 5%, transparent); }
.nd-tb-boxed { --tb-radius: 12px; --tb-head-bg: var(--nd-accent, #2563eb); --tb-head-ink: #fff; --tb-head-bg-solid: var(--nd-accent, #2563eb); }
.nd-tb-boxed .nd-tb-scroll { box-shadow: var(--tb-shadow, 0 6px 20px rgb(15 23 42 / .08)); background: var(--tb-bg, var(--nd-bg, #fff)); }
.nd-tb-minimal { --tb-head-ink: var(--nd-muted, inherit); }
.nd-tb-minimal thead th { font-size: calc(var(--tb-head-fs, 1em) * .9); }
.nd-tb-dark { --tb-line: rgb(255 255 255 / .12); --tb-ink: #e8ecf3; --tb-head-ink: #fff; --tb-head-bg: rgb(255 255 255 / .06); --tb-stripe: rgb(255 255 255 / .04); --tb-hover: rgb(255 255 255 / .08); --tb-foot-bg: rgb(255 255 255 / .08); --tb-radius: 12px; }
.nd-tb-dark .nd-tb-scroll { background: var(--tb-bg, #141a26); }
.nd-tb-dark a { color: #9cc3ff; }

/* ---------- vonalak ---------- */
/* clean: vízszintes vonalak a sorok között, a fejléc alatt és az összesítő fölött vastagabb */
.nd-tb-l-clean tbody tr:not(:first-child) > *, .nd-tb-l-clean tfoot tr > * { border-top-width: var(--tb-bw); }
.nd-tb-l-clean thead th { border-bottom: var(--tb-head-bw, calc(var(--tb-bw) * 2)) var(--tb-bs) var(--tb-head-line, var(--tb-line)); }
.nd-tb-l-clean tfoot tr > * { border-top-width: calc(var(--tb-bw) * 2); }
/* all: minden cella körül */
.nd-tb-l-all .nd-tb-scroll, .nd-tb-l-outer .nd-tb-scroll, .nd-tb-l-outer_h .nd-tb-scroll { border: var(--tb-bw) var(--tb-bs) var(--tb-line); }
.nd-tb-l-all th, .nd-tb-l-all td { border-width: 0 var(--tb-bw) var(--tb-bw) 0; }
.nd-tb-l-all tr > :last-child { border-right-width: 0; }
.nd-tb-l-all tbody tr:last-child > *, .nd-tb-l-all tfoot tr:last-child > * { border-bottom-width: 0; }
.nd-tb-l-all:has(tfoot) tbody tr:last-child > * { border-bottom-width: var(--tb-bw); }
/* horizontal: csak sorok között (alul is), outer_h: külső keret + sorok között */
.nd-tb-l-horizontal tbody tr > *, .nd-tb-l-horizontal tfoot tr > * { border-bottom-width: var(--tb-bw); }
.nd-tb-l-outer_h tbody tr:not(:first-child) > *, .nd-tb-l-outer_h tfoot tr > * { border-top-width: var(--tb-bw); }
.nd-tb-l-vertical th:not(:last-child), .nd-tb-l-vertical td:not(:last-child) { border-right-width: var(--tb-bw); }
.nd-tb-l-all thead th, .nd-tb-l-horizontal thead th, .nd-tb-l-outer_h thead th { border-bottom: var(--tb-head-bw, var(--tb-bw)) var(--tb-bs) var(--tb-head-line, var(--tb-line)); }
.nd-tb-l-outer thead th, .nd-tb-l-vertical thead th, .nd-tb-l-none thead th { border-bottom: var(--tb-head-bw, 0px) var(--tb-bs) var(--tb-head-line, var(--tb-line)); }

/* felirat a táblázat fölött / alatt (a dobozon kívül) */
.nd-tb-caption { margin: 0 0 10px; color: var(--tb-cap, var(--nd-muted, inherit)); font-size: .95em; font-weight: 600; }
.nd-tb-caption.is-bottom { margin: 10px 0 0; font-weight: 400; }

/* ---------- keresés, rendezés, lapozás ---------- */
.nd-tb-tools { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.nd-tb-search { width: min(100%, 320px); padding: 9px 14px; border: 1px solid var(--tb-line); border-radius: 999px; font: inherit; font-size: .95em; background: var(--nd-bg, #fff); color: inherit; }
.nd-tb-search:focus { outline: 2px solid color-mix(in srgb, var(--nd-accent, #2563eb) 45%, transparent); outline-offset: 1px; }
.nd-tb-sortable thead th { cursor: pointer; user-select: none; position: relative; padding-right: calc(var(--tb-px) + 16px); }
.nd-tb-sortable thead th::after { content: ""; position: absolute; right: calc(var(--tb-px) - 4px); top: 50%; margin-top: -6px; width: 9px; height: 13px; opacity: .35;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 13'%3E%3Cpath d='M4.5 0 9 5H0zM4.5 13 0 8h9z' fill='%23000'/%3E%3C/svg%3E"); background-size: contain; background-repeat: no-repeat; }
.nd-tb-sortable thead th[aria-sort="ascending"]::after { opacity: .9; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 13'%3E%3Cpath d='M4.5 0 9 5H0z' fill='%23000'/%3E%3C/svg%3E"); }
.nd-tb-sortable thead th[aria-sort="descending"]::after { opacity: .9; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 13'%3E%3Cpath d='M4.5 13 0 8h9z' fill='%23000'/%3E%3C/svg%3E"); }
.nd-tb-boxed.nd-tb-sortable thead th::after, .nd-tb-dark.nd-tb-sortable thead th::after { filter: invert(1); }
.nd-tb-sortable thead th:focus-visible { outline: 2px solid var(--nd-accent, #2563eb); outline-offset: -2px; }
.nd-tb-empty td { text-align: center !important; color: var(--nd-muted, inherit); padding-block: calc(var(--tb-py) * 2); }
.nd-tb-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; font-size: .9em; color: var(--nd-muted, inherit); }
.nd-tb-foot:empty, .nd-tb-foot:not(:has(*:not(:empty))) { display: none; }
.nd-tb-pages { display: flex; flex-wrap: wrap; gap: 4px; }
.nd-tb-pages button { min-width: 34px; height: 34px; padding: 0 10px; border: 1px solid var(--tb-line); border-radius: 8px; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.nd-tb-pages button:hover:not(:disabled) { border-color: var(--nd-accent, #2563eb); color: var(--nd-accent, #2563eb); }
.nd-tb-pages button[aria-current="page"] { background: var(--nd-accent, #2563eb); border-color: var(--nd-accent, #2563eb); color: #fff; }
.nd-tb-pages button:disabled:not([aria-current]) { opacity: .4; cursor: default; }
.nd-tb-pages button[aria-current] { cursor: default; }
@media (max-width: 640px) {
    .nd-tb-tools { justify-content: stretch; }
    .nd-tb-search { width: 100%; }
}
