/* Valuate gold/navy theme — overrides theme.css palette + adds dashboard components */

:root {
    --gold: #c9a227;
    --gold-bright: #e8bc3a;
    --border-soft: #1b243b;
    --font-heading: 'Fraunces', serif;
    --font-mono: 'IBM Plex Mono', monospace;
}

body[data-theme="dark"],
html[data-theme="dark"],
html:not([data-theme]) {
    --primary-color: #c9a227;
    --secondary-color: #8b93a7;
    --tertiary-color: #c0c6d4;
    --dark-color: #eef0f4;

    --bg-primary: #0a0e17;
    --bg-secondary: #0d1220;
    --bg-tertiary: #121a2b;
    --bg-additional: #1a2338;

    --text-primary: #eef0f4;
    --text-secondary: #8b93a7;
    --text-tertiary: #56607a;
    --text-inverse: #14100a;

    --border-color: #232d45;
    --border-soft: #1b243b;
    --shadow-light: rgba(0, 0, 0, 0.3);
    --shadow-medium: rgba(0, 0, 0, 0.45);
    --shadow-dark: rgba(0, 0, 0, 0.65);

    --color-danger: #e0806b;
    --color-danger-light: rgba(224, 128, 107, 0.15);
    --color-success: #6fcf97;
    --color-success-light: rgba(111, 207, 151, 0.15);
    --color-warning: #e8bc3a;
    --color-warning-light: rgba(232, 188, 58, 0.15);

    --gold: #c9a227;
    --gold-bright: #e8bc3a;

    --font-body: 'Inter', sans-serif;
}

body[data-theme="light"],
html[data-theme="light"] {
    --primary-color: #8a6a1f;
    --secondary-color: #6b7488;
    --tertiary-color: #3a4256;
    --dark-color: #171b26;

    --bg-primary: #f7f5ee;
    --bg-secondary: #f0ede2;
    --bg-tertiary: #ffffff;
    --bg-additional: #ece6d4;

    --text-primary: #1b2233;
    --text-secondary: #5b6478;
    --text-tertiary: #8992a6;
    --text-inverse: #ffffff;

    --border-color: #e6dfc9;
    --border-soft: #ece6d4;
    --shadow-light: rgba(20, 20, 10, 0.06);
    --shadow-medium: rgba(20, 20, 10, 0.12);
    --shadow-dark: rgba(20, 20, 10, 0.18);

    --color-danger: #b6432c;
    --color-danger-light: #f8e2db;
    --color-success: #22824f;
    --color-success-light: #dff3e7;
    --color-warning: #8a6a1f;
    --color-warning-light: #f3e8cc;

    --gold: #8a6a1f;
    --gold-bright: #b4881f;

    --font-body: 'Inter', sans-serif;
}

body,
html {
    font-family: var(--font-body);
}

body {
    background-image:
        linear-gradient(var(--border-soft) 1px, transparent 1px),
        linear-gradient(90deg, var(--border-soft) 1px, transparent 1px);
    background-size: 48px 48px;
    background-position: -1px -1px;
}

h1, h2, h3,
.dashboard-title h2,
.hdr-profile-info strong {
    font-family: var(--font-heading);
    font-weight: 500;
}

/* ---------- Sidebar brand ---------- */
.sidebar-brand {
    background: transparent;
    box-shadow: none;
    border-bottom: 1px solid var(--border-soft);
    padding: 0 20px 8px;
    margin: 12px 6px 8px;
    height: auto;
}

.dashboard-inner .sidebar {
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    border-inline-end: 1px solid var(--border-soft);
    display: flex;
    flex-direction: column;
}

/* The nav list's max-height used to be a hardcoded calc() guessing the brand
   header's height, which no longer matches now that the logo is bigger — it
   capped the list shorter than the space actually available, forcing a
   scroll to reach Sign out. Let it flex to fill whatever room is left instead. */
.dashboard-inner .sidebar .categories {
    max-height: none;
    flex: 1 1 auto;
    min-height: 0;
}

/* ---------- Sidebar brand mark (same design as the login/register page) ---------- */
.sidebar-brand .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-start;
    margin-inline-start: 8px;
}

.sidebar-brand .brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 9px;
    background: linear-gradient(135deg, #e8bc3a, #c9a227 70%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.sidebar-brand .brand-word {
    font-family: 'Fraunces', serif;
    font-weight: 700;
    font-size: 35px;
    letter-spacing: 0.2px;
    color: var(--text-primary) !important;
    overflow: visible;
    white-space: nowrap;
}

.sidebar-brand .brand-word span {
    color: var(--gold) !important;
    display: inline !important;
}

.sidebar-brand .brand-word .gold-chars {
    color: var(--gold) !important;
    display: inline !important;
    background: linear-gradient(to right, var(--text-primary) 8%, var(--gold) 28%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar.collapsed .sidebar-brand .brand {
    gap: 0;
}

/* ---------- DataTable search input ---------- */
div.dt-container .dt-search {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    margin: 0 !important;
    margin-inline-end: 32px !important;
}
div.dt-container .dt-search::before {
    content: '';
    position: absolute;
    inset-inline-start: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4.3-4.3'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
    pointer-events: none;
    z-index: 1;
}
div.dt-container .dt-search input {
    width: 200px !important;
    height: 34px !important;
    background: var(--bg-tertiary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px !important;
    padding-block: 6px !important;
    padding-inline: 46px 12px !important;
    color: var(--text-primary) !important;
    font-size: 13px !important;
    font-family: 'Inter', sans-serif !important;
    outline: none !important;
    transition: border-color 0.15s ease, background 0.15s ease !important;
    text-align: start !important;
}
div.dt-container .dt-search input:focus {
    border-color: var(--gold) !important;
    background: var(--bg-tertiary) !important;
}
div.dt-container .dt-search input::placeholder {
    color: var(--text-tertiary) !important;
    text-align: start !important;
}

/* ---------- Sidebar nav ---------- */
.nav-label {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: var(--text-tertiary);
    padding: 6px 21px 8px;
    margin-top: 14px;
    margin-inline-end: 12px;
    font-weight: 600;
}

.nav-label:first-child {
    margin-top: 0;
}

.sidebar.collapsed .nav-label {
    display: none;
}

.dashboard-inner .sidebar .categories li a {
    border-radius: 8px;
    margin-inline: 8px;
    margin-bottom: 2px;
    font-size: 14px;
    font-weight: 500;
}

.dashboard-inner .sidebar .categories li a:hover {
    background: var(--bg-additional) !important;
}

.dashboard-inner .sidebar .categories li.active a {
    background: linear-gradient(90deg, rgba(201, 162, 39, 0.14), rgba(201, 162, 39, 0.02)) !important;
    border-inline-start-color: var(--gold-bright);
    color: var(--gold-bright) !important;
}



/* ---------- Buttons ---------- */
.btn:not(.btn-danger):not(.btn-default):not(.btn-border) {
    background: linear-gradient(135deg, var(--gold-bright), var(--gold)) !important;
    box-shadow: 0 6px 20px -6px rgba(201, 162, 39, 0.5) !important;
}

.btn:not(.btn-danger):not(.btn-default):not(.btn-border):hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px -6px rgba(201, 162, 39, 0.65) !important;
}

/* ---------- Dashboard: stat cards ---------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 22px;
}

.stat-card {
    background: linear-gradient(160deg, var(--bg-tertiary), var(--bg-secondary));
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 16px 12px;
    transition: border-color .2s ease, transform .2s ease;
}

.stat-card:hover {
    border-color: var(--gold);
    transform: translateY(-2px);
}

.stat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.stat-icon {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(201, 162, 39, 0.1);
    border: 1px solid rgba(201, 162, 39, 0.25);
    color: var(--gold);
    font-size: 13px;
}

.stat-trend {
    font-size: 10.5px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--color-success);
    font-family: var(--font-mono);
}

.stat-trend.flat {
    color: var(--text-tertiary);
}

.stat-label {
    font-size: 11.5px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    font-weight: 500;
}

.stat-value {
    font-family: var(--font-mono);
    font-size: 28px;
    font-weight: 500;
    letter-spacing: -1px;
    line-height: 1;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.sparkline {
    width: 100%;
    height: 22px;
    display: block;
    opacity: .9;
}

/* ---------- Dashboard: lower panels ---------- */
.lower-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 18px;
}

.v-panel {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 22px 24px;
}

.v-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.v-panel-head h3 {
    font-size: 17px;
    margin: 0;
    color: var(--text-primary);
}

.v-panel-head .view-all {
    font-size: 12.5px;
    color: var(--gold);
    text-decoration: none;
    font-weight: 500;
}

.v-table {
    width: 100%;
    border-collapse: collapse;
}

.v-table th {
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-tertiary);
    font-weight: 600;
    padding: 0 10px 10px;
    border-bottom: 1px solid var(--border-soft);
}

.v-table td {
    padding: 13px 10px;
    font-size: 13.5px;
    border-bottom: 1px solid var(--border-soft);
    color: var(--text-primary);
}

.v-table tr:last-child td {
    border-bottom: none;
}

.proj-name {
    font-weight: 600;
}

.proj-region {
    color: var(--text-secondary);
    font-size: 12px;
}

.v-status-pill {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    font-family: var(--font-mono);
}

.v-status-active {
    background: var(--color-success-light);
    color: var(--color-success);
    border: 1px solid var(--color-success);
}

.v-status-draft {
    background: var(--bg-additional);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.v-updated {
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 12px;
}

.region-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-soft);
}

.region-row:last-child {
    border-bottom: none;
}

.region-flag {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--bg-additional);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
}

.region-flag img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.region-info {
    flex: 1;
    min-width: 0;
}

.region-name {
    font-size: 13.5px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.region-bar-track {
    height: 5px;
    background: var(--border-soft);
    border-radius: 4px;
    overflow: hidden;
}

.region-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--gold), var(--gold-bright));
}

.region-count {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

@media (max-width: 980px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .lower-grid {
        grid-template-columns: 1fr;
    }
}

/* ---------- Data table card (Projects / Countries / Currencies) ----------
   Scoped to .dt-card (added only on those 3 index pages) + .dt-container
   (only rendered by Yajra DataTables, i.e. exactly these 3 pages) so nothing
   else that shares .dashboard-content — profile, currency create/edit, the
   project wizard — is touched. Pure CSS: layout keys (topStart/topEnd/
   bottomStart/bottomEnd), the AJAX endpoint, search/sort/paginate JS are all
   untouched, so functionality is unaffected. */
.dt-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
}

/* style.css hides the "start" cell outright (pageLength on the top row,
   info-text on the bottom row) — bring both back. */
div.dt-container div.dt-layout-row .dt-layout-cell.dt-layout-start {
    display: block;
}

/* Top toolbar row: "Show 10 Projects" (start) + search (end) */
div.dt-container > div.dt-layout-row:first-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0;
    padding: 26px 80px;
    border-bottom: 1px solid var(--border-color);
}

div.dt-container > div.dt-layout-row:first-child .dt-layout-cell.dt-layout-start {
    display: flex;
    align-items: center;
    margin-inline-end: auto;
}

div.dt-container > div.dt-layout-row:first-child .dt-layout-cell.dt-layout-end {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-inline-start: auto;
}

.dt-length label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding-inline-start: 16px;
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.dt-length select {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 7px;
    padding-block: 5px;
    padding-inline: 8px 22px;
    font-size: 13px;
    font-family: var(--font-mono);
    -moz-appearance: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
    background-size: 12px;
}

/* background-position has no logical (inline-start/end) form, so the
   dropdown-arrow's side needs an explicit flip for Arabic. */
[dir="rtl"] .dt-length select {
    background-position: left 6px center;
}

/* Arabic mode: push search further right, "Show X Projects" further left —
   directly on the two controls themselves (not their wrapping cells), with
   plain physical left/right so nothing about direction/logical-property
   resolution can get in the way. */
[dir="rtl"] div.dt-container .dt-search {
    margin-right: 25px !important;
}

[dir="rtl"] div.dt-container .dt-length {
    margin-left: 25px !important;
}

/* Search: bring the box back into normal flow in the toolbar row (was
   position:absolute; top:-75px; left:16px relative to #wrapper). The label
   keeps its original position:absolute + margin:15px 22px (now relative to
   .dt-search itself, which is the same size as before — just position:
   relative instead of static) so the search icon still overlays the input's
   reserved left padding at the same spot — only the outer float is removed. */
div.dt-container div.dt-layout-row div.dt-layout-cell.dt-layout-end .dt-search {
    position: relative !important;
    left: auto !important;
    top: auto !important;
}

div.dt-container div.dt-layout-row div.dt-layout-cell.dt-layout-end {
    margin-inline-end: 24px !important;
}

/* pageLength ("Show X Projects") had no equivalent margin at all — unlike
   the search cell above — so it sat flush against the card border. */
div.dt-container div.dt-layout-row div.dt-layout-cell.dt-layout-start {
    margin-inline-start: 24px !important;
}

/* Arabic mode: extra breathing room beyond the base 24px, on whichever
   physical side each control actually renders on (search ends up on the
   right, pageLength on the left) — physical, not logical, so it can't be
   silently reinterpreted by a forced-direction ancestor. */
[dir="rtl"] div.dt-container div.dt-layout-row div.dt-layout-cell.dt-layout-end {
    margin-right: 176px !important;
}

[dir="rtl"] div.dt-container div.dt-layout-row div.dt-layout-cell.dt-layout-start {
    margin-left: 176px !important;
}

/* Table header polish. Also neutralizes style.css's
   `.dt-layout-row.dt-layout-table { margin-top: -24px !important; }`, a hack
   that compensated for the old hidden-pageLength/floated-search toolbar —
   now that the toolbar has real height again, that negative margin would
   pull the table up to overlap it. */
div.dt-container .dt-layout-row.dt-layout-table {
    margin-top: 0 !important;
}

div.dt-container table.dataTable {
    margin: 0 !important;
    background: transparent !important;
}

div.dt-container table.dataTable tbody {
    background: transparent !important;
}

div.dt-container table.dataTable thead th {
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.8px;
    font-weight: 600 !important;
    padding: 12px 18px !important;
    white-space: nowrap;
    color: var(--text-tertiary);
    border-bottom: 1px solid var(--border-soft);
    background: transparent !important;
    text-align: start !important;
}

div.dt-container table.dataTable thead th:first-child {
    padding-inline-start: 80px !important;
}

div.dt-container table.dataTable thead th:last-child {
    padding-inline-end: 80px !important;
}

div.dt-container table.dataTable thead th .dt-column-title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

div.dt-container table.dataTable tbody td {
    padding: 10px 18px !important;
    font-size: 13px;
    white-space: nowrap;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-soft);
    background: transparent !important;
    text-align: start !important;
}

div.dt-container table.dataTable tbody td:first-child {
    padding-inline-start: 80px !important;
}

div.dt-container table.dataTable tbody td:last-child {
    padding-inline-end: 80px !important;
}

div.dt-container table.dataTable tbody td:first-child {
    color: var(--text-tertiary);
}

div.dt-container table.dataTable tbody td:nth-child(2) {
    color: var(--text-primary);
    font-weight: 600;
}

div.dt-container table.dataTable tbody tr:last-child td {
    border-bottom: none;
}

div.dt-container table.dataTable tbody tr:hover td {
    background-color: var(--bg-additional) !important;
}

/* Kill DataTables default table borders/backgrounds */
table.dataTable,
table.dataTable th,
table.dataTable td {
    box-sizing: border-box !important;
}
table.dataTable.table-striped > tbody > tr:nth-of-type(odd) > * {
    box-shadow: none !important;
    background: transparent !important;
}
table.dataTable.table-striped > tbody > tr:nth-of-type(even) > * {
    box-shadow: none !important;
    background: transparent !important;
}

/* ---------- Data table cell styles (id / name / secondary / date) ---------- */
.id-cell {
    font-family: var(--font-mono);
    color: var(--text-secondary);
    font-size: 13px;
}

.proj-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13px;
}

.dev-name {
    color: var(--text-tertiary);
    font-size: 12.5px;
}

.year-cell {
    font-family: var(--font-mono);
    color: var(--text-secondary);
    font-size: 13px;
}

/* ---------- Status / active pills ---------- */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 10.5px;
    font-weight: 600;
    font-family: var(--font-mono);
    background: rgba(139, 147, 167, 0.1);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    text-transform: capitalize;
}

.status-pill::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.active-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 10.5px;
    font-weight: 700;
    font-family: var(--font-mono);
    letter-spacing: 0.3px;
}

.active-pill.inactive {
    background: var(--color-danger-light);
    color: var(--color-danger);
    border: 1px solid rgba(224, 128, 107, 0.32);
}

.active-pill.active {
    background: var(--color-success-light);
    color: var(--color-success);
    border: 1px solid rgba(111, 207, 151, 0.32);
}

/* ---------- Action button (dropdown trigger) ---------- */
.dt-card .action-btn {
    width: 28px;
    height: 28px;
    padding: 0 !important;
    min-width: 0;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    border: 1px solid transparent !important;
    color: var(--text-tertiary) !important;
    font-size: 12px;
}

.dt-card .action-btn:hover {
    background: var(--bg-additional) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

/* ---------- Action dropdown menu (Show / Edit / Metrics / Delete) ---------- */
.dt-card .dropdown-menu {
    background: var(--bg-tertiary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px !important;
    box-shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.35), 0 4px 16px rgba(0, 0, 0, 0.2) !important;
    padding: 6px !important;
    min-width: 170px;
}

.dt-card .dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary) !important;
    text-decoration: none;
    background: transparent;
    border: none;
    width: 100%;
    text-align: start;
    transition: background 0.12s ease, color 0.12s ease;
}

.dt-card .dropdown-item i {
    width: 16px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 12.5px;
    transition: color 0.12s ease;
}

.dt-card .dropdown-item:hover,
.dt-card .dropdown-item:focus {
    background: var(--bg-additional) !important;
    color: var(--text-primary) !important;
}

.dt-card .dropdown-item:hover i {
    color: var(--gold-bright);
}

/* Delete is the only <button> item (the rest are links) — style it as a
   destructive action, matching the header user-menu's sign-out row. */
.dt-card button.dropdown-item {
    color: var(--color-danger) !important;
}

.dt-card button.dropdown-item i {
    color: var(--color-danger);
}

.dt-card button.dropdown-item:hover {
    background: var(--color-danger-light) !important;
    color: var(--color-danger) !important;
}

.dt-card button.dropdown-item:hover i {
    color: var(--color-danger);
}

/* ---------- Footer row — centered pagination ---------- */
div.dt-container .dt-layout-row.dt-layout-table + .dt-layout-row {
    display: flex !important;
    align-items: center;
    justify-content: center !important;
    width: 100%;
    margin: 0;
    padding: 16px 64px;
    border-top: 1px solid var(--border-soft);
}

div.dt-container .dt-layout-row.dt-layout-table + .dt-layout-row .dt-layout-cell.dt-layout-start {
    display: none !important;
}

div.dt-container .dt-layout-row.dt-layout-table + .dt-layout-row .dt-layout-cell.dt-layout-end {
    display: flex !important;
    align-items: center;
    justify-content: center !important;
    width: auto !important;
    margin: 0 !important;
}

/* ---------- Pagination ---------- */
div.dt-container .dt-paging {
    display: flex !important;
    align-items: center;
    justify-content: center !important;
    width: 100% !important;
    margin: 0 auto !important;
    text-align: center;
}

/* Blunt direct push while the real centering above gets verified — applied
   straight to the control itself so nothing about the wrapping row/cell
   structure can swallow it. */
div.dt-container .dt-paging,
div.dt-container .dt-paging nav {
    margin-right: 310px !important;
}

.dt-paging nav {
    display: flex !important;
    margin: 0 auto !important;
    align-items: center;
    gap: 6px;
}

/* The bs5 renderer wraps everything in <ul class="pagination"> — reset
   default/Bootstrap list styling regardless of whether Bootstrap's own
   CSS is loaded. */
.dt-paging ul.pagination {
    display: flex !important;
    align-items: center !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 8px !important;
}

/* ---------- Button base ----------
   The datatables.net-bs5 renderer puts active/disabled on the outer <li
   class="dt-paging-button page-item">, and previous/next on the INNER
   <button class="page-link">. Style the <li> as the visual box, and make
   the <button> inside it transparent and fill it completely. */
.dt-paging-button {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    padding: 0 !important;
    margin: 0 !important;
    margin-bottom: 12px !important;
    border-radius: 6px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    list-style: none !important;
    overflow: hidden;
    box-sizing: border-box !important;
}

.dt-paging-button .page-link {
    all: unset;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    color: var(--text-secondary) !important;
    cursor: pointer;
    font-size: 13px !important;
    font-family: var(--font-mono) !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    box-sizing: border-box !important;
}

.dt-paging-button:hover:not(.disabled):not(.active) {
    background: var(--bg-additional) !important;
    border-color: var(--text-tertiary) !important;
}

.dt-paging-button:hover:not(.disabled):not(.active) .page-link {
    color: var(--text-primary) !important;
}

/* ---------- Active page — solid gold (theme-aware) ---------- */
.dt-paging-button.active {
    background: linear-gradient(135deg, var(--gold-bright), var(--gold)) !important;
    border-color: transparent !important;
    box-shadow: 0 2px 8px -2px rgba(201, 162, 39, 0.5);
}

.dt-paging-button.active .page-link {
    color: var(--text-primary) !important;
    font-weight: 700 !important;
}

/* ---------- Disabled ---------- */
.dt-paging-button.disabled {
    opacity: 0.55;
    pointer-events: none;
}

/* Hide extra page-number buttons, keep only previous/next/active/disabled.
   A plain number button is a <li> that isn't active and whose <button>
   isn't a previous/next control. */
.dt-paging-button:not(.active):has(.page-link:not(.previous):not(.next)) {
    display: none !important;
}

/* ---------- Nav icons (previous / next) — on the inner <button> ---------- */
.dt-paging-button .page-link.previous,
.dt-paging-button .page-link.next {
    font-size: 0 !important;
    position: relative;
}

.dt-paging-button .page-link.previous::before,
.dt-paging-button .page-link.next::before {
    content: '';
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.dt-paging-button .page-link.previous::before {
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 17l-5-5 5-5M18 17l-5-5 5-5'/%3E%3C/svg%3E");
}

.dt-paging-button .page-link.next::before {
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M13 17l5-5-5-5M6 17l5-5-5-5'/%3E%3C/svg%3E");
}

.dt-paging-button:hover:not(.disabled) .page-link.previous::before,
.dt-paging-button:hover:not(.disabled) .page-link.next::before {
    filter: brightness(1.6);
}

/* ---------- Table header sort icons hidden ---------- */
div.dt-container table.dataTable thead th .dt-column-order {
    display: none !important;
}
