/* Scope to DataTables containers (you only use them for this plugin) */
.dt-container {
    font-size: 14px;
    margin: 1.5rem 0;
}

/* ---- Top controls: buttons + search ---- */

.dt-container .dt-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

/* DataTables buttons (CSV / Print) */
.dt-container .dt-buttons .dt-button {
    border-radius: 4px;
    padding: 6px 14px;
    border: 1px solid #d0d4dc;
    background: #f4f5f7;
    color: #333;
    font-size: 13px;
    line-height: 1.4;
    cursor: pointer;
    transition: background 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.dt-container .dt-buttons .dt-button:hover {
    background: #e5e7eb;
    border-color: #c0c4ce;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

.dt-container .dt-buttons .dt-button:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.35);
}

/* Search box */
.dt-container .dt-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.dt-container .dt-search label {
    font-weight: 500;
    font-size: 13px;
    color: #4b5563;
    margin: 0;
}

.dt-container .dt-search input.dt-input {
    padding: 6px 10px;
    border-radius: 4px;
    border: 1px solid #d1d5db;
    min-width: 220px;
    font-size: 13px;
}

/* Entries per page dropdown */
.dt-container .dt-length {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.dt-container .dt-length select.dt-input {
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #d1d5db;
    font-size: 13px;
}

.dt-container .dt-length label {
    font-size: 13px;
    color: #4b5563;
    margin: 0;
}

/* ---- Table styling tweaks ---- */

table.cca-client-data-dt {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

table.cca-client-data-dt thead th {
    background: #f3f4f6;
    border-bottom: 1px solid #e5e7eb;
    padding: 8px 10px;
    font-weight: 600;
    font-size: 16px;
    white-space: nowrap;
}

table.cca-client-data-dt tbody td {
    padding: 7px 10px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 16px;
}

/* Zebra striping & hover already handled by .stripe + .hover,
   but you can tweak if you like: */
table.cca-client-data-dt tbody tr:nth-child(even) {
    background-color: #fafafa;
}

/* ---- Bottom: info + pagination ---- */

.dt-container .dt-info {
    font-size: 13px;
    color: #4b5563;
    margin-top: 0.5rem;
}

.dt-container .dt-paging {
    margin-top: 0.5rem;
}

/* Pagination buttons */
.dt-container .dt-paging .dt-paging-button {
    border-radius: 4px;
    border: 1px solid transparent;
    padding: 4px 9px;
    margin: 0 1px;
    font-size: 13px;
    color: #374151;
    background: #f9fafb;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.dt-container .dt-paging .dt-paging-button:hover:not(.disabled) {
    background: #e5e7eb;
}

.dt-container .dt-paging .dt-paging-button.current {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

.dt-container .dt-paging .dt-paging-button.disabled {
    opacity: 0.4;
    cursor: default;
}

/* ---- Layout: desktop vs mobile ---- */

/* Desktop: buttons + search on top row, table in middle, info left / paging right at bottom */
@media (min-width: 768px) {
    .dt-container {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "buttons search"
            "length  length"
            "table   table"
            "info    paging";
        row-gap: 0.5rem;
        column-gap: 0.5rem;
    }

    .dt-container .dt-buttons   { grid-area: buttons; justify-self: flex-start; }
    .dt-container .dt-search    { grid-area: search;  justify-self: flex-end; }
    .dt-container .dt-length    { grid-area: length;  justify-self: flex-start; }
    .dt-container .dt-scroll    { grid-area: table; }
    .dt-container .dt-info      { grid-area: info;    align-self: center; }
    .dt-container .dt-paging    { grid-area: paging; justify-self: flex-end; }
}

/* Mobile: everything stacked neatly */
@media (max-width: 767px) {
    .dt-container {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

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