/*
 * Evohus DataTables bridge
 * -----------------------------------------------------------------------------
 * Gives every DataTables instance in the legacy (`_Layout.cshtml`) line the
 * visual language of the Evohus reference table (Admin/src/apps-contact-requests.html):
 * flat surface, `bg-light` header row, 14px/.75rem cell rhythm, muted info text
 * and square 2.25rem pagination chips.
 *
 * The portal ships the *Bootstrap 5* styling build of DataTables 2.3.7, so the
 * generated markup is Bootstrap-flavoured and Evohus styles most of it natively:
 *   div.dt-container.dt-bootstrap5
 *     div.dt-layout-row.row > div.dt-layout-cell.dt-layout-start|end.col-md-auto
 *       div.dt-length   > label > select.form-select.form-select-sm
 *       div.dt-search   > label + input.form-control.form-control-sm
 *       div.dt-info
 *       div.dt-paging   > ul.pagination > li.page-item.dt-paging-button > button.page-link
 *     table.dataTable (+ the view's own `ui celled table` classes, still Fomantic
 *     markup on unmigrated views — the surface rules below neutralise that skin)
 *
 * Everything below therefore neutralises the Fomantic skin first, then repaints
 * with Evohus `--dx-*` tokens. Because only tokens are used, dark mode follows
 * `data-bs-theme` on <html> automatically — no per-theme literals here.
 *
 * Scope: `div.dt-container` only, so non-DataTables `.ui.table` markup on legacy
 * pages is left untouched. Load order matters — this file must come after
 * semantic.min.css, site.css, main.css and evohus-legacy-bridge.css.
 */

/* ---------------------------------------------------------------------------
 * 1. Container + layout rows
 * ------------------------------------------------------------------------ */

div.dt-container {
    width: 100%;
    color: var(--dx-body-color);
    /* The portal root font-size is 14px, so 1rem is the Evohus table text size. */
    font-size: 1rem;
}

/* The Bootstrap 5 build tags layout rows/cells with grid classes
   (`row mt-2`, `col-md-auto`, `col-12`). We lay these out with flex instead, so the
   grid's negative gutters and column padding are neutralised here — left in place
   they push the toolbar rows outside the card, exactly like `.table-card` did. */
div.dt-container div.dt-layout-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin: 0;
    --bs-gutter-x: 0;
    --bs-gutter-y: 0;
}

div.dt-container div.dt-layout-cell {
    padding-left: 0;
    padding-right: 0;
    flex: 0 0 auto;
    width: auto;
    max-width: none;
}

div.dt-container div.dt-layout-row:first-child {
    margin-bottom: 1rem;
}

div.dt-container div.dt-layout-row:last-child {
    margin-top: 1rem;
}

div.dt-container div.dt-layout-cell {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: 0;
    margin: 0;
}

div.dt-container div.dt-layout-cell.dt-layout-start {
    justify-content: flex-start;
}

div.dt-container div.dt-layout-cell.dt-layout-end {
    justify-content: flex-end;
    margin-left: auto;
}

div.dt-container div.dt-layout-cell.dt-layout-full {
    width: 100%;
    justify-content: flex-start;
}

div.dt-container div.dt-layout-cell:empty {
    display: none;
}

/* ---------------------------------------------------------------------------
 * 2. Table surface — strip the Fomantic card look
 * ------------------------------------------------------------------------ */

.portal-legacy-content table.dataTable,
.portal-legacy-content table.ui.table {
    /* Defined on the table itself so the skin works both inside a DataTables
       wrapper and on plain server-rendered Fomantic tables. */
    --dt-evohus-cell-x: .75rem;
    --dt-evohus-cell-y: .875rem;
    --dt-evohus-edge: 1.25rem;

    width: 100%;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: var(--dx-body-color);
    font-family: inherit;
    font-size: 1rem;
    vertical-align: middle;
    border-collapse: collapse;
    border-spacing: 0;
}

/* Fomantic draws vertical rules for `celled` and an outer frame for every
   `ui table`; the Evohus reference table has neither. */
.portal-legacy-content table.ui.celled.table > tbody > tr > td,
.portal-legacy-content table.ui.celled.table > tbody > tr > th,
.portal-legacy-content table.ui.celled.table > thead > tr > th,
.portal-legacy-content table.ui.celled.table > tfoot > tr > th,
.portal-legacy-content table.ui.table > tbody > tr > td,
.portal-legacy-content table.ui.table > thead > tr > th {
    border-left: 0;
    border-right: 0;
    box-shadow: none;
}

.portal-legacy-content table.ui.table > tbody > tr:first-child > td {
    border-top: 0;
}

/* ---------------------------------------------------------------------------
 * 3. Header row — `bg-light border-bottom` in the reference
 * ------------------------------------------------------------------------ */

.portal-legacy-content table.dataTable > thead > tr > th,
.portal-legacy-content table.ui.table > thead > tr > th {
    padding: var(--dt-evohus-cell-y) var(--dt-evohus-cell-x);
    background-color: var(--dx-tertiary-bg);
    border-top: 0;
    border-bottom: var(--dx-border-width, 1px) solid var(--dx-border-color);
    color: var(--dx-emphasis-color);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.25rem;
    text-transform: none;
    letter-spacing: 0;
    white-space: nowrap;
    vertical-align: middle;
    border-radius: 0;
}

.portal-legacy-content table.dataTable > tfoot > tr > th,
.portal-legacy-content table.ui.table > tfoot > tr > th {
    padding: var(--dt-evohus-cell-y) var(--dt-evohus-cell-x);
    background-color: var(--dx-tertiary-bg);
    border-top: var(--dx-border-width, 1px) solid var(--dx-border-color);
    color: var(--dx-emphasis-color);
    font-weight: 500;
}

/* Edge padding mirrors Evohus `.table-card`, which pulls the first/last column
   out to the card gutter. */
.portal-legacy-content table.dataTable > thead > tr > th:first-child,
.portal-legacy-content table.dataTable > tbody > tr > td:first-child,
.portal-legacy-content table.dataTable > tfoot > tr > th:first-child,
.portal-legacy-content table.ui.table > thead > tr > th:first-child,
.portal-legacy-content table.ui.table > tbody > tr > td:first-child {
    padding-left: var(--dt-evohus-edge);
}

.portal-legacy-content table.dataTable > thead > tr > th:last-child,
.portal-legacy-content table.dataTable > tbody > tr > td:last-child,
.portal-legacy-content table.dataTable > tfoot > tr > th:last-child,
.portal-legacy-content table.ui.table > thead > tr > th:last-child,
.portal-legacy-content table.ui.table > tbody > tr > td:last-child {
    padding-right: var(--dt-evohus-edge);
}

/* ---------------------------------------------------------------------------
 * 4. Body cells
 * ------------------------------------------------------------------------ */

.portal-legacy-content table.dataTable > tbody > tr > td,
.portal-legacy-content table.dataTable > tbody > tr > th,
.portal-legacy-content table.ui.table > tbody > tr > td {
    padding: var(--dt-evohus-cell-y) var(--dt-evohus-cell-x);
    background-color: transparent;
    border-top: 0;
    border-bottom: var(--dx-border-width, 1px) solid var(--dx-border-color);
    color: var(--dx-body-color);
    vertical-align: middle;
    line-height: 1.375rem;
}

.portal-legacy-content table.dataTable > tbody > tr:last-child > td,
.portal-legacy-content table.ui.table > tbody > tr:last-child > td {
    border-bottom: 0;
}

.portal-legacy-content table.dataTable > tbody > tr,
.portal-legacy-content table.ui.table > tbody > tr {
    background-color: transparent;
}

/* Hover / stripe / selection all resolve through Evohus table tokens. */
.portal-legacy-content table.dataTable.ui.selectable > tbody > tr:hover,
.portal-legacy-content table.ui.selectable.table > tbody > tr:hover,
.portal-legacy-content table.dataTable > tbody > tr:hover {
    background-color: var(--dx-table-hover-bg, var(--dx-tertiary-bg));
    color: var(--dx-table-hover-color, var(--dx-body-color));
}

.portal-legacy-content table.dataTable.ui.striped > tbody > tr:nth-child(2n),
.portal-legacy-content table.ui.striped.table > tbody > tr:nth-child(2n) {
    background-color: var(--dx-table-striped-bg, var(--dx-tertiary-bg));
}

.portal-legacy-content table.dataTable > tbody > tr.selected > td,
.portal-legacy-content table.dataTable > tbody > tr.active > td {
    background-color: var(--dx-primary-bg-subtle);
    color: var(--dx-emphasis-color);
    box-shadow: none;
}

/* `compact` / `very compact` Fomantic variants keep their tighter rhythm. */
.portal-legacy-content table.ui.compact.table {
    --dt-evohus-cell-y: .625rem;
}

.portal-legacy-content table.ui.very.compact.table {
    --dt-evohus-cell-y: .5rem;
}

/* ---------------------------------------------------------------------------
 * 5. Sort indicators
 * ------------------------------------------------------------------------ */

.portal-legacy-content table.dataTable > thead > tr > th.dt-orderable-asc,
.portal-legacy-content table.dataTable > thead > tr > th.dt-orderable-desc {
    cursor: pointer;
}

.portal-legacy-content table.dataTable > thead > tr > th.dt-orderable-asc:hover,
.portal-legacy-content table.dataTable > thead > tr > th.dt-orderable-desc:hover {
    background-color: var(--dx-secondary-bg);
    color: var(--dx-primary);
}

.portal-legacy-content table.dataTable span.dt-column-order:before,
.portal-legacy-content table.dataTable span.dt-column-order:after {
    color: var(--dx-secondary-color);
    opacity: .5;
}

/* Only the arrow carries the accent — the reference table keeps header text in
   the plain emphasis colour even on the sorted column. */
.portal-legacy-content table.dataTable > thead > tr > th.dt-ordering-asc,
.portal-legacy-content table.dataTable > thead > tr > th.dt-ordering-desc {
    color: var(--dx-emphasis-color);
}

.portal-legacy-content table.dataTable > thead > tr > th.dt-ordering-asc span.dt-column-order:before,
.portal-legacy-content table.dataTable > thead > tr > th.dt-ordering-desc span.dt-column-order:after {
    color: var(--dx-primary);
    opacity: 1;
}

/* ---------------------------------------------------------------------------
 * 6. Search box — Evohus `.form-control` with a leading icon well
 * ------------------------------------------------------------------------ */

div.dt-container div.dt-search {
    display: flex;
    align-items: center;
    gap: .5rem;
}

div.dt-container div.dt-search label {
    margin: 0;
    color: var(--dx-secondary-color);
    font-size: .8125rem;
    font-weight: 400;
    white-space: nowrap;
}

/* The Bootstrap 5 build renders the input directly as `.form-control.form-control-sm`,
   which Evohus already styles — only the height needs aligning with the rest of the
   toolbar. */
div.dt-container div.dt-search input {
    height: 2.5rem;
    min-width: 14rem;
}

div.dt-container div.dt-search input::placeholder {
    color: var(--dx-secondary-color);
}

div.dt-container div.dt-search input:focus {
    border-color: var(--dx-primary);
    box-shadow: none;
    outline: 0;
}

/* ---------------------------------------------------------------------------
 * 7. Page-length select
 * ------------------------------------------------------------------------ */

div.dt-container div.dt-length {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: var(--dx-secondary-color);
    font-size: .8125rem;
}

/* DataTables renders the whole control as one label with the select inline in
   the middle of the sentence ("Sayfada [25] kayıt göster"), so the label itself
   has to be the flex row — otherwise the words break around the select. */
div.dt-container div.dt-length label {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    margin: 0;
    color: var(--dx-secondary-color);
    font-weight: 400;
    white-space: nowrap;
}

/* Bootstrap 5 build: a native `select.form-select.form-select-sm`, styled by Evohus.
   It is no longer wrapped by Fomantic's dropdown widget, so the whole
   `.ui.selection.dropdown` override — including its own menu skin — is gone. Only the
   sizing needs to match the toolbar; `width: auto` keeps it from filling the label. */
div.dt-container div.dt-length select {
    display: inline-flex;
    flex: 0 0 auto;
    width: auto;
    min-width: 4.75rem;
    height: 2.5rem;
}

div.dt-container div.dt-length select:focus {
    border-color: var(--dx-primary);
    box-shadow: none;
}

/* ---------------------------------------------------------------------------
 * 8. Info line — "Showing 1-25 of 120 Results"
 * ------------------------------------------------------------------------ */

div.dt-container div.dt-info {
    padding: 0;
    color: var(--dx-secondary-color);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.25rem;
}

div.dt-container div.dt-info b {
    color: var(--dx-emphasis-color);
    font-weight: 600;
}

/* ---------------------------------------------------------------------------
 * 9. Pagination
 * -----------------------------------------------------------------------------
 * The Bootstrap 5 build renders `ul.pagination > li.page-item > button.page-link`,
 * which Evohus already styles natively (2.25rem chips, .5rem gap, primary active).
 * Only the alignment and the button reset are ours — the Semantic build's
 * `.ui.pagination.menu` skin that used to live here is gone with it.
 * ------------------------------------------------------------------------ */

div.dt-container div.dt-paging {
    display: flex;
    justify-content: flex-end;
    margin: 0;
}

div.dt-container div.dt-paging ul.pagination {
    margin: 0;
}

/* DataTables uses a real <button> for the page link; strip the UA button look so
   Evohus' `.page-link` styling reads exactly as it does elsewhere. */
div.dt-container div.dt-paging button.page-link {
    appearance: none;
    font-family: inherit;
    cursor: pointer;
}

/* Evohus' bootstrap.css declares `--dx-pagination-disabled-bg: var(--dx-)`, which is
   malformed and resolves to nothing — disabled chips end up with no fill at all.
   Supply the intended surface here. */
div.dt-container div.dt-paging .page-item.disabled button.page-link {
    background-color: var(--dx-tertiary-bg);
    color: var(--dx-secondary-color);
    cursor: default;
    pointer-events: none;
}

div.dt-container div.dt-paging button.page-link:focus-visible {
    outline: 2px solid var(--dx-primary);
    outline-offset: 2px;
}

/* ---------------------------------------------------------------------------
 * 10. Empty state + processing overlay
 * ------------------------------------------------------------------------ */

.portal-legacy-content table.dataTable > tbody > tr > td.dt-empty {
    padding: 2.5rem var(--dt-evohus-edge);
    color: var(--dx-secondary-color);
    font-size: 1rem;
    text-align: center;
}

div.dt-container div.dt-processing {
    background-color: var(--dx-secondary-bg);
    border: var(--dx-border-width, 1px) solid var(--dx-border-color);
    border-radius: var(--dx-border-radius, .375rem);
    box-shadow: var(--dx-box-shadow, 0 .5rem 1rem rgba(0, 0, 0, .15));
    color: var(--dx-body-color);
    font-size: .8125rem;
}

/* ---------------------------------------------------------------------------
 * 11. Small screens — stack the control rows
 * ------------------------------------------------------------------------ */

@media (max-width: 767.98px) {
    div.dt-container div.dt-layout-row {
        flex-direction: column;
        align-items: stretch;
    }

    div.dt-container div.dt-layout-cell.dt-layout-start,
    div.dt-container div.dt-layout-cell.dt-layout-end {
        justify-content: flex-start;
        margin-left: 0;
    }

    div.dt-container div.dt-paging {
        justify-content: flex-start;
    }

    div.dt-container div.dt-search input {
        min-width: 0;
        width: 100%;
    }

    .portal-legacy-content table.dataTable,
    .portal-legacy-content table.ui.table {
        --dt-evohus-edge: .875rem;
    }
}

/* ---------------------------------------------------------------------------
 * 12. Opt-in horizontal scroll
 * -----------------------------------------------------------------------------
 * Not applied globally: many portal tables render Fomantic action dropdowns
 * inside cells, and an `overflow-x` ancestor would clip those popups. Add
 * `dt-evohus-responsive` to the table element on pages that have no in-cell
 * popups but do need the Evohus `.table-responsive` behaviour.
 * ------------------------------------------------------------------------ */

.portal-legacy-content table.dt-evohus-responsive {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ---------------------------------------------------------------------------
 * 13. Portal table card — the standard list-screen chrome
 * -----------------------------------------------------------------------------
 * Title, result count, search, filters, primary action and row actions, so
 * every list screen in the portal reads the same. Mirrors the Evohus reference
 * card-header geometry: identity on the left, tools on the right.
 * ------------------------------------------------------------------------ */

.portal-table-card {
    border: var(--dx-border-width, 1px) solid var(--dx-border-color);
    border-radius: var(--dx-border-radius-lg, .5rem);
    background-color: var(--dx-secondary-bg);
}

.portal-table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    padding: 1rem 1.25rem;
    background-color: transparent;
    border-bottom: var(--dx-border-width, 1px) solid var(--dx-border-color);
}

.portal-table-titlebar {
    display: flex;
    align-items: center;
    gap: .625rem;
    min-width: 0;
}

.portal-table-title {
    margin: 0;
    color: var(--dx-emphasis-color);
    font-size: 1.0625rem;
    font-weight: 600;
    line-height: 1.5;
}

/* Result count — the standard replacement for ad hoc "N kayıt" labels. */
.portal-table-count {
    display: inline-flex;
    align-items: center;
    height: 1.5rem;
    padding: 0 .5rem;
    background-color: var(--dx-tertiary-bg);
    border-radius: 50rem;
    color: var(--dx-secondary-color);
    font-size: .8125rem;
    font-weight: 500;
    white-space: nowrap;
}

.portal-table-tools {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
}

/* Search — leading icon well, matching the reference `.form-control.ps-9`. */
.portal-table-search {
    position: relative;
    display: flex;
    align-items: center;
}

.portal-table-search > input {
    height: 2.5rem;
    min-width: 15rem;
    padding: .375rem .75rem .375rem 2.25rem;
    background-color: var(--dx-secondary-bg);
    border: var(--dx-border-width, 1px) solid var(--dx-border-color);
    border-radius: var(--dx-border-radius, .375rem);
    color: var(--dx-body-color);
    font-family: inherit;
    font-size: var(--dx-body-font-size, .9063rem);
}

.portal-table-search > input::placeholder {
    color: var(--dx-secondary-color);
}

.portal-table-search > input:focus {
    border-color: var(--dx-primary);
    outline: 0;
    box-shadow: none;
}

.portal-table-search > [data-lucide],
.portal-table-search > svg,
.portal-table-search > iconify-icon {
    position: absolute;
    left: .75rem;
    width: 1rem;
    height: 1rem;
    color: var(--dx-secondary-color);
    pointer-events: none;
}

/* Filter selects sit next to search and share its geometry. */
.portal-table-filter,
.portal-table-tools select {
    height: 2.5rem;
    min-width: 9rem;
    padding: .375rem 2rem .375rem .75rem;
    background-color: var(--dx-secondary-bg);
    border: var(--dx-border-width, 1px) solid var(--dx-border-color);
    border-radius: var(--dx-border-radius, .375rem);
    color: var(--dx-body-color);
    font-family: inherit;
    font-size: var(--dx-body-font-size, .9063rem);
}

.portal-table-filter:focus,
.portal-table-tools select:focus {
    border-color: var(--dx-primary);
    outline: 0;
    box-shadow: none;
}

/* Primary action ("Yeni Kayıt") — one look for every list screen. */
.portal-table-action {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    height: 2.5rem;
    padding: 0 .875rem;
    background-color: var(--dx-primary);
    border: var(--dx-border-width, 1px) solid var(--dx-primary);
    border-radius: var(--dx-border-radius, .375rem);
    color: #fff;
    font-family: inherit;
    font-size: var(--dx-body-font-size, .9063rem);
    font-weight: 500;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition: filter .15s ease-in-out;
}

.portal-table-action:hover,
.portal-table-action:focus {
    color: #fff;
    text-decoration: none;
    filter: brightness(.94);
}

.portal-table-action--ghost {
    background-color: transparent;
    border-color: var(--dx-border-color);
    color: var(--dx-body-color);
}

.portal-table-action--ghost:hover,
.portal-table-action--ghost:focus {
    color: var(--dx-emphasis-color);
    background-color: var(--dx-tertiary-bg);
}

/* ---------------------------------------------------------------------------
 * 14. Row actions — standard edit / delete controls
 * ------------------------------------------------------------------------ */

.portal-col-actions {
    width: 1%;
    white-space: nowrap;
}

.portal-row-actions {
    display: flex;
    align-items: center;
    gap: .375rem;
}

/* Inline delete is usually a POST form; it must not break the button row. */
.portal-row-actions form {
    display: inline-flex;
    margin: 0;
}

.portal-row-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .375rem;
    height: 2rem;
    min-width: 2rem;
    padding: 0 .5rem;
    background-color: var(--dx-tertiary-bg);
    border: var(--dx-border-width, 1px) solid transparent;
    border-radius: var(--dx-border-radius, .375rem);
    color: var(--dx-body-color);
    font-family: inherit;
    font-size: .8125rem;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s ease-in-out, color .15s ease-in-out;
}

.portal-row-btn:hover,
.portal-row-btn:focus {
    background-color: var(--dx-primary);
    border-color: var(--dx-primary);
    color: #fff;
    text-decoration: none;
}

.portal-row-btn--danger:hover,
.portal-row-btn--danger:focus {
    background-color: var(--dx-danger);
    border-color: var(--dx-danger);
    color: #fff;
}

.portal-row-btn[disabled],
.portal-row-btn.disabled {
    opacity: .55;
    pointer-events: none;
}

.portal-row-btn > svg,
.portal-row-btn > [data-lucide],
.portal-row-btn > iconify-icon {
    width: .9375rem;
    height: .9375rem;
}

/* The table sits flush inside the card body; the skin already supplies the
   first/last column gutter, so the body adds no extra horizontal padding. */
.portal-table-card > .card-body {
    padding: 0;
}

/* Evohus `.table-card` carries `margin: 0 -1.25rem` to cancel the default
   card-body padding. This card zeroes that padding and supplies the inset through
   the table's own first/last-cell gutter, so the negative margins would otherwise
   push the whole table outside the card. */
.portal-table-card .table-card {
    margin-left: 0;
    margin-right: 0;
}

/* DataTables wraps the table *inside* `.table-card`, so `.dt-container` is not a
   direct child of `.card-body` — these have to be descendant selectors. */
/* No top padding: Evohus app.css already sets `.dt-container .dt-layout-table
   { margin-top: 20px !important }`, and stacking our own padding on top of it
   left a visible empty band under the card header. */
.portal-table-card .dt-container {
    padding: 0 0 1rem;
}

/* The table row spans edge to edge; every other row (info, paging) is inset to
   line up with the card header. */
.portal-table-card .dt-container > .dt-layout-row:not(.dt-layout-table) {
    padding: 0 1.25rem;
}

/* `nowrap` tables are wider than the card on narrow viewports and would push the
   whole page into horizontal scroll. Scroll the table row itself, so the info and
   paging row stays anchored. Scoped to the standard card on purpose: row actions
   here are plain buttons, never popup dropdowns that an overflow ancestor
   would clip. */
.portal-table-card .dt-container > .dt-layout-row.dt-layout-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.portal-table-card .dt-container > .dt-layout-row.dt-layout-table > .dt-layout-cell {
    display: block;
    min-width: 0;
}

@media (max-width: 767.98px) {
    .portal-table-header {
        align-items: stretch;
        flex-direction: column;
        padding: .875rem;
    }

    .portal-table-tools {
        flex-direction: column;
        align-items: stretch;
    }

    .portal-table-search > input,
    .portal-table-filter,
    .portal-table-tools select,
    .portal-table-action {
        width: 100%;
        min-width: 0;
    }

    .portal-table-action {
        justify-content: center;
    }
}

/* ---------------------------------------------------------------------------
 * 15. Legacy `k-dt-*` row actions → standard row actions
 * -----------------------------------------------------------------------------
 * 20 ajax-driven views build their action cell inside a DataTables `render()`
 * callback using the older KDS classes. Those rules live in main.css under
 * `body.caku-shell`, a class the Evohus shell no longer emits, so they render
 * unstyled. Aliasing here fixes every one of those views without touching their
 * render functions — and keeps a single row-action look portal-wide.
 * ------------------------------------------------------------------------ */

.portal-legacy-content .k-dt-actions-col {
    width: 1%;
    white-space: nowrap;
}

.portal-legacy-content .k-dt-actions {
    display: flex;
    align-items: center;
    gap: .375rem;
}

.portal-legacy-content .k-dt-actions form {
    display: inline-flex;
    margin: 0;
}

/* `ui button` is in the same class list, so Fomantic has to be out-specified. */
.portal-legacy-content .k-dt-action,
.portal-legacy-content .k-dt-action.ui.button,
.portal-legacy-content .k-dt-action.ui.mini.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .375rem;
    height: 2rem;
    min-width: 2rem;
    padding: 0 .5rem;
    margin: 0;
    background-color: var(--dx-tertiary-bg);
    border: var(--dx-border-width, 1px) solid transparent;
    border-radius: var(--dx-border-radius, .375rem);
    color: var(--dx-body-color);
    font-family: inherit;
    font-size: .8125rem;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    box-shadow: none;
    transition: background-color .15s ease-in-out, color .15s ease-in-out;
}

.portal-legacy-content .k-dt-action.ui.button:hover,
.portal-legacy-content .k-dt-action.ui.button:focus,
.portal-legacy-content .k-dt-action:hover,
.portal-legacy-content .k-dt-action:focus {
    background-color: var(--dx-primary);
    border-color: var(--dx-primary);
    color: #fff;
    text-decoration: none;
}

.portal-legacy-content .k-dt-action--danger.ui.button:hover,
.portal-legacy-content .k-dt-action--danger.ui.button:focus,
.portal-legacy-content .k-dt-action--danger:hover,
.portal-legacy-content .k-dt-action--danger:focus {
    background-color: var(--dx-danger);
    border-color: var(--dx-danger);
    color: #fff;
}

.portal-legacy-content .k-dt-action iconify-icon,
.portal-legacy-content .k-dt-action svg {
    width: .9375rem;
    height: .9375rem;
    font-size: .9375rem;
}

/* ---------------------------------------------------------------------------
 * 16. Clickable rows
 * -----------------------------------------------------------------------------
 * Nine views shipped the same page-local <style> block to make whole rows
 * clickable. DESIGN.md forbids page-local styles, so the pattern lives here:
 * mark the table `portal-table--clickable` and drop the block.
 * ------------------------------------------------------------------------ */

.portal-legacy-content table.portal-table--clickable > tbody > tr {
    cursor: pointer;
}

.portal-legacy-content table.portal-table--clickable > tbody > tr:hover {
    background-color: var(--dx-table-hover-bg, var(--dx-tertiary-bg));
}

/* ---------------------------------------------------------------------------
 * 17. portal-surface — Fomantic `.ui.segment` yerine geçen kart yüzeyi
 * -----------------------------------------------------------------------------
 * Evohus' `.card` carries no padding of its own; the spacing lives in `.card-body`.
 * A plain class swap would therefore collapse every converted surface, and wrapping
 * ~220 occurrences in a new `.card-body` element means editing closing tags inside
 * Razor blocks at scale — the exact operation that has already produced stray-`</div>`
 * bugs in far smaller batches this cycle.
 *
 * `.portal-surface` applies the card-body spacing directly to the card element, so
 * migrating a segment is a single-token edit with no structural change. It is a real
 * Evohus `.card` (tokens, radius, border, dark mode); only the padding is inlined.
 * Screens that later need a real header/footer split can be upgraded to
 * `.card > .card-header/.card-body` individually.
 * ------------------------------------------------------------------------ */

.portal-surface {
    padding: var(--dx-card-spacer-y, 1.25rem) var(--dx-card-spacer-x, 1.25rem);
    /* `.ui.segment` shipped `margin: 1rem 0`; keep the vertical rhythm of the pages
       that are being converted. */
    margin: 1rem 0;
}

.portal-surface:first-child {
    margin-top: 0;
}

.portal-surface > :last-child {
    margin-bottom: 0;
}
