/* =========================================================
   DataTables — SalesWiz house style
   Brings the index tables into line with the frosted-glass
   design language shared by the sidebar, toasts and login:
   soft neutral surfaces, hairline borders, small-caps column
   labels, a primary→azure gradient "current page" that mirrors
   the active sidebar item, and a frosted loading veil.
   Rules are written to win over Tabler's table / pagination /
   form defaults, which load *after* this file.
   ========================================================= */

.dt-container {
  --dt-line: rgba(31, 41, 55, 0.07);        /* hairline row separators */
  --dt-line-strong: rgba(31, 41, 55, 0.12); /* header underline / controls */
  --dt-hover: rgba(var(--tblr-primary-rgb), 0.05);
  --dt-radius: 0.7rem;
}

/* =========================================================
   Toolbar — page length + search
   ========================================================= */
.dt-length,
.dt-search {
  display: inline-flex !important;
  align-items: center;
}
.dt-layout-row:first-child { margin-bottom: 0.35rem; }

/* page-length select — soft pill with a primary focus ring */
.dt-length select,
.dt-length select.dt-input {
  padding: 0.42rem 2rem 0.42rem 0.85rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--tblr-dark);
  border-radius: var(--dt-radius) !important;
  border: 1px solid var(--dt-line-strong) !important;
  background-color: rgba(255, 255, 255, 0.9) !important;
  box-shadow: 0 1px 2px rgba(31, 41, 55, 0.04);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.dt-length select:focus,
.dt-length select.dt-input:focus {
  border-color: rgba(var(--tblr-primary-rgb), 0.55) !important;
  box-shadow: 0 0 0 0.2rem rgba(var(--tblr-primary-rgb), 0.15);
  outline: none;
}

/* search — frosted flat input group */
.dt-search .input-group {
  border-radius: var(--dt-radius);
  border: 1px solid var(--dt-line-strong);
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  backdrop-filter: blur(10px) saturate(140%);
  box-shadow: 0 1px 2px rgba(31, 41, 55, 0.04);
  overflow: hidden;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.dt-search .input-group:focus-within {
  border-color: rgba(var(--tblr-primary-rgb), 0.55);
  box-shadow: 0 0 0 0.2rem rgba(var(--tblr-primary-rgb), 0.15);
}
.dt-search span.input-group-text {
  background: transparent !important;
  border: 0 !important;
  color: var(--tblr-secondary);
}
.dt-search .input-group-text .material-symbols-outlined { font-size: 20px; }
.dt-search input[type="search"],
.dt-search input.dt-input {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0.45rem 0.55rem;
  font-family: var(--tblr-body-font-face);
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.4285714286;
  color: var(--tblr-body-color);
}
.dt-search input[type="search"]:focus { outline: none; }
.dt-search kbd {
  font-size: 0.6875rem;
  color: var(--tblr-secondary);
  background: rgba(31, 41, 55, 0.06);
  border: 0;
  border-radius: 0.4rem;
  padding: 0.15rem 0.4rem;
}

/* =========================================================
   Table
   ========================================================= */
table.dataTable {
  margin-top: 1rem !important;
  border-color: var(--dt-line);
}

/* header — small-caps muted labels on a faint primary band */
table.dataTable thead th {
  position: relative;
  padding: 0.75rem 1.75rem 0.75rem 0.85rem;   /* room for the sort glyph */
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  color: var(--tblr-secondary) !important;
  background: linear-gradient(180deg,
    rgba(var(--tblr-primary-rgb), 0.05),
    rgba(var(--tblr-primary-rgb), 0.015));
  border-bottom: 1.5px solid var(--dt-line-strong) !important;
  white-space: nowrap;
}

/* body — comfortable rows with a whisper-soft primary hover */
table.dataTable tbody td {
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--dt-line);
  color: var(--tblr-body-color);
  vertical-align: middle;
}
table.dataTable tbody tr:last-child td { border-bottom: 0; }
table.dataTable tbody tr { transition: background-color 0.14s ease; }
table.dataTable tbody tr:hover td { background-color: var(--dt-hover); }
.dataTable tbody tr td:first-child { font-size: unset !important; }

/* sort glyphs (Material Symbols) — muted when idle, primary when active */
table.dataTable thead th.dt-orderable-asc::after,
table.dataTable thead th.dt-orderable-desc::after {
  font-family: 'Material Symbols Outlined';
  content: 'unfold_more';
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: rgba(31, 41, 55, 0.32);
  transition: color 0.16s ease;
}
table.dataTable thead th.dt-orderable-asc:hover::after,
table.dataTable thead th.dt-orderable-desc:hover::after {
  color: var(--tblr-primary);
}
table.dataTable thead th.dt-ordering-asc::after {
  content: 'keyboard_arrow_up';
  color: var(--tblr-primary);
}
table.dataTable thead th.dt-ordering-desc::after {
  content: 'keyboard_arrow_down';
  color: var(--tblr-primary);
}
th.dt-orderable-none { padding-right: 0.85rem !important; }
th.dt-orderable-none::after { content: none !important; }

/* empty state */
.dt-empty {
  text-align: center;
  font-weight: 500;
  color: var(--tblr-secondary);
  padding: 2rem 1rem !important;
}

/* =========================================================
   Footer — info + pagination
   ========================================================= */
.dt-layout-row:last-child { margin-top: 0.9rem; }

.dt-info {
  font-size: 0.8rem;
  color: var(--tblr-secondary);
  padding-top: 0 !important;
}

/* pagination — pill buttons; the current page borrows the
   primary→azure gradient + glow from the active sidebar item */
.dt-paging .pagination { gap: 0.2rem; margin: 0; }

.dt-paging .page-item .page-link {
  min-width: 2rem;
  padding: 0.35rem 0.6rem;
  border: 0 !important;
  border-radius: 0.6rem !important;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--tblr-secondary) !important;
  background: transparent !important;
  box-shadow: none !important;
  transition: color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}
.dt-paging .page-item:not(.disabled):not(.active) .page-link:hover {
  color: var(--tblr-primary) !important;
  background: rgba(var(--tblr-primary-rgb), 0.09) !important;
}
.dt-paging .page-item:not(.disabled):not(.active) .page-link:focus-visible {
  box-shadow: 0 0 0 0.2rem rgba(var(--tblr-primary-rgb), 0.18) !important;
}
.dt-paging .page-item.active .page-link {
  color: #fff !important;
  background: linear-gradient(135deg,
    rgba(var(--tblr-primary-rgb), 0.95),
    rgba(var(--tblr-azure-rgb), 0.85)) !important;
  box-shadow:
    inset 0 0 0 1px rgba(var(--tblr-primary-rgb), 0.35),
    0 0.5rem 1.1rem -0.55rem rgba(var(--tblr-primary-rgb), 0.9) !important;
}
.dt-paging .page-item.disabled .page-link {
  color: rgba(31, 41, 55, 0.28) !important;
  background: transparent !important;
}

/* =========================================================
   Processing veil — frosted card instead of a black block
   ========================================================= */
.dt-processing {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%);
  width: auto !important;
  margin: 0 !important;
  padding: 1rem 1.6rem !important;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  color: var(--tblr-dark);
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.75);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  box-shadow: 0 1.25rem 2.5rem -1rem rgba(31, 41, 55, 0.35);
}
.dt-processing .spinner-border { color: var(--tblr-primary); }
