table.primary-datatable,
table.nested-datatable {
    thead {
        font-size: 0.7rem;
        text-transform: uppercase;

        th {
            color: var(--nedspice-text-grey);
            font-weight: normal !important;
            background-color: transparent !important;
            border: none !important;
        }
    }
    tr.primary-datatable-item,
    tr.nested-datatable-item {
        border-color: var(--nedspice-background-grey);
        td {
            padding-top: 0.7rem;
            padding-bottom: 0.7rem;
            color: var(--nedspice-text-grey);
            min-height: 44px;
            background-color: var(--bs-table-bg) !important;
        }
    }
}

tr.nested-datatable-item {
    font-size: 0.8rem;
}

tr.nested-datatable-item td {
    padding-top: 0.95rem !important;
    padding-bottom: 0.95rem !important;
}

table.table.dataTable {
    border-collapse: separate !important;
    border-spacing: 0 14px !important;
}

/* Rounded row corners for primary list datatables */
#productPortfolioDataTable tr.primary-datatable-item td:first-child,
#contractsDataTable tr.primary-datatable-item td:first-child,
#ordersDataTable tr.primary-datatable-item td:first-child,
#certificatesDataTable tr.primary-datatable-item td:first-child,
#invoicesDataTable tr.primary-datatable-item td:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

#productPortfolioDataTable tr.primary-datatable-item td.row-end-cell,
#contractsDataTable tr.primary-datatable-item td.row-end-cell,
#ordersDataTable tr.primary-datatable-item td.row-end-cell,
#certificatesDataTable tr.primary-datatable-item td.row-end-cell,
#invoicesDataTable tr.primary-datatable-item td.row-end-cell {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

[data-search-placeholder] {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1.25rem;
}

/* Floating fixed header (DataTables FixedHeader plugin) */
.dtfh-floatingparent-head {
    border-bottom: 1px solid var(--nedspice-light-grey);
    border-left: 1px solid var(--nedspice-light-grey);
    background: var(--nedspice-background-grey);
}

/* Export button (DataTables Buttons) */
.dt-buttons .dt-button.buttons-excel {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    min-width: 7.5rem;
    justify-content: center;
    font-size: var(--13px);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--white);
    background: var(--nedspice-dark-green);
    border: 1px solid var(--nedspice-dark-green);
    border-radius: 0.25rem;
    cursor: pointer;
}

.dt-buttons .dt-button.buttons-excel i {
    font-size: 0.9rem;
}

.primary-datatable .download {
    width: 100%;
    text-align: center !important;
}

.primary-datatable .download .dt-column-header {
    width: 100%;
}

.primary-datatable .download .dt-column-order {
    text-align: right;
}

.primary-datatable-header {
    font-size: 0.7rem;
    text-transform: uppercase;
}

.primary-datatable-header th {
    color: var(--nedspice-text-grey);
    font-weight: normal !important;
    background-color: transparent !important;
    border: none !important;
}

.primary-datatable-header .dt-column-header {
    width: 100%;
    text-align: center;
}

.primary-datatable-item,
.nested-datatable-item {
    border-color: var(--nedspice-background-grey);
}

.primary-datatable-item td,
.nested-datatable-item td {
    padding-top: 0.7rem;
    padding-bottom: 0.7rem;
    color: var(--nedspice-text-grey);
}

.primary-datatable tr[data-dt-row] td[colspan] {
    border: none;
}

.table {
    border: none !important;
}

.table.dataTable tr[data-dt-row] {
    transform: translateY(-8px);
}

.table.dataTable tr[data-dt-row] td {
    background-color: transparent;
}

/* Responsive "expand" row — the panel that slides open below the parent row */
.table.dataTable tr[data-dt-row] > td[colspan] > div:first-of-type {
    background-color: var(--white) !important;
    border-color: var(--white) !important;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    font-size: 0.8rem;
    margin-top: -14px;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.table.dataTable .dt-container .dt-layout-table {
    width: 100%;
}

.dt-container {
    font-size: smaller;
}

.page-link:hover {
    background-color: #f8f9fa;
    color: var(--nedspice-orange);
}

.dt-paging-button.active > .page-link {
    background-color: var(--nedspice-dark-grey);
    color: var(--nedspice-background-grey);
    border-color: var(--nedspice-dark-grey);
}

.dt-paging-button .page-link {
    color: var(--nedspice-dark-grey);
}

.dt-column-title {
    font-weight: bold;
}

/* Card view */
.table .child {
    border-color: var(--nedspice-background-grey);
}

@media (max-width: 767px) {
    .row-child-cell {
        white-space: normal;
        word-wrap: break-word;
        overflow-wrap: break-word;
        max-width: 100%;
    }
}

@media (min-width: 767px) {
    .row-child-content {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
    .row-child-cell {
        padding: 0 !important;
    }
}

.row-child-content {
    padding: 0.5rem;
}

.row-child-cell {
    padding: 0.6rem;
}

td.dt-control {
    cursor: pointer;
    width: 15px;
    text-align: center;
}

td.dt-control::before {
    margin-right: 0 !important;
}

.rounded-start-top {
    border-top-left-radius: 10px;
}

.rounded-start-bottom {
    border-bottom-left-radius: 10px;
}

.rounded-end-top {
    border-top-right-radius: 10px;
}

.rounded-end-bottom {
    border-bottom-right-radius: 10px;
}
