﻿/* DataTables brand integration (agent: datatables).
   Loaded AFTER admin.css/styles.css and the DataTables + Responsive CDN css.
   Scoped to the DataTables wrapper (div.dt-container, legacy
   .dataTables_wrapper) so admin.css .data-table base borders stay intact.
   Brand pink: #ff2f92. */

/* ---- Wrapper spacing: fits .panel-body (16px pad) and .form-card (20px pad) ---- */
div.dt-container,
.dataTables_wrapper { margin: 0; font-size: .85rem; }
div.dt-container .dt-layout-row { margin: 10px 0; gap: 10px; flex-wrap: wrap; align-items: center; }
div.dt-container .dt-layout-row:first-child { margin-top: 0; }
div.dt-container .dt-layout-row:last-child { margin-bottom: 0; }
div.dt-container .dt-layout-cell { padding: 0; }
.panel-body > div.dt-container,
.form-card > div.dt-container { margin: 2px 0; }

/* ---- Controls: rounded 10px, pink focus, 40px filter input ---- */
div.dt-container .dt-search,
div.dt-container .dt-length { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
div.dt-container .dt-search label,
div.dt-container .dt-length label { font-size: .78rem; font-weight: 700; color: #6d6d70; margin: 0; }
div.dt-container .dt-search input,
.dataTables_wrapper .dataTables_filter input {
  min-height: 40px; width: min(240px, 100%); margin: 0;
  border: 1px solid #d9d0c8; border-radius: 10px; padding: 8px 12px;
  background: #fffdf9; color: #191919; font: inherit; font-size: .85rem;
  outline: none; transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
div.dt-container .dt-length select,
.dataTables_wrapper .dataTables_length select {
  min-height: 40px; border: 1px solid #d9d0c8; border-radius: 10px;
  padding: 6px 10px; background: #fffdf9; color: #191919;
  font: inherit; font-size: .85rem; outline: none; margin: 0 4px;
  transition: border-color .15s, box-shadow .15s;
}
div.dt-container .dt-search input:focus,
div.dt-container .dt-length select:focus,
.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dataTables_length select:focus {
  border-color: #ff2f92; box-shadow: 0 0 0 3px rgba(255, 47, 146, .15);
}
div.dt-container .dt-info { font-size: .78rem; color: #6d6d70; padding: 6px 0; }

/* ---- Paging: >=36px tap targets, pink current page ---- */
div.dt-container .dt-paging { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 4px 0; }
div.dt-container .dt-paging .dt-paging-button,
.dataTables_wrapper .dataTables_paginate .paginate_button {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; min-height: 36px; padding: 4px 10px; margin: 0;
  border: 1px solid #dedbd6; border-radius: 10px;
  background: #fff; color: #191919; font-size: .85rem; font-weight: 700;
  cursor: pointer; text-decoration: none;
  transition: border-color .15s, color .15s, background .15s;
}
div.dt-container .dt-paging .dt-paging-button:hover,
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  border: 1px solid #ff2f92; background: #fff; color: #ff2f92 !important;
}
div.dt-container .dt-paging .dt-paging-button.current,
div.dt-container .dt-paging .dt-paging-button.current:hover,
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  border: 1px solid #ff2f92; background: #ff2f92; color: #fff !important;
}
div.dt-container .dt-paging .dt-paging-button.disabled,
div.dt-container .dt-paging .dt-paging-button.disabled:hover,
div.dt-container .dt-paging .dt-paging-button.disabled:active,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
  border: 1px solid #e4e1dd; background: #fff; color: #6d6d70 !important;
  opacity: .45; cursor: default;
}
div.dt-container .dt-paging .dt-paging-button:focus-visible {
  outline: 2px solid #ff2f92; outline-offset: 2px;
}
/* ---- Table: keep admin.css base borders; Responsive owns overflow now ---- */
/* admin.css sets min-width:720px (and some tables inline min-width) — release
   it inside the wrapper so Responsive can collapse columns instead. */
div.dt-container table.data-table,
.dataTables_wrapper table.data-table { min-width: 0 !important; width: 100%; margin: 0; }
div.dt-container table.data-table > thead > tr > th,
div.dt-container table.data-table > thead > tr > td { border-bottom: 1px solid #eeeae6; }
div.dt-container.dt-empty-footer table.data-table > tbody > tr:last-child > * { border-bottom-color: #eeeae6; }
/* Horizontal-scroll fallback removed for enhanced tables; .table-wrap stays
   harmless (and still scrolls for any non-enhanced table). */
.table-wrap:has(> div.dt-container),
.table-wrap:has(> div.dataTables_wrapper) { overflow: visible; }

/* Sorting accents (brand pink) */
div.dt-container table.data-table thead th.dt-orderable-asc,
div.dt-container table.data-table thead th.dt-orderable-desc { cursor: pointer; }
div.dt-container table.data-table thead th.dt-orderable-asc:hover,
div.dt-container table.data-table thead th.dt-orderable-desc:hover { color: #ff2f92; }
div.dt-container table.data-table thead th.dt-ordering-asc span.dt-column-order,
div.dt-container table.data-table thead th.dt-ordering-desc span.dt-column-order { color: #ff2f92; }

/* Friendly empty state */
div.dt-container table.data-table td.dt-empty,
.dataTables_wrapper table.data-table td.dataTables_empty {
  text-align: center; color: #6d6d70; padding: 26px 12px; font-size: .85rem;
}

/* ---- Responsive collapse: control column + child rows ---- */
div.dt-container table.data-table.dtr-inline.collapsed > tbody > tr > td.dtr-control::before,
div.dt-container table.data-table.dtr-inline.collapsed > tbody > tr > th.dtr-control::before { border-left-color: #ff2f92; }
div.dt-container table.data-table.dtr-inline.collapsed > tbody > tr.dtr-expanded > td.dtr-control::before,
div.dt-container table.data-table.dtr-inline.collapsed > tbody > tr.dtr-expanded > th.dtr-control::before { border-top-color: #ff2f92; }
div.dt-container table.data-table > tbody > tr.dtr-expanded { background: #fff0f7; }
div.dt-container table.data-table > tbody > tr.child,
div.dt-container table.data-table > tbody > tr.dt-child { background: #fff5fa; }
div.dt-container table.data-table > tbody > tr.child:hover,
div.dt-container table.data-table > tbody > tr.dt-child:hover { background: #fff5fa !important; }
div.dt-container table.data-table > tbody > tr.child > td,
div.dt-container table.data-table > tbody > tr.dt-child > td { padding: 10px 14px; }
div.dt-container table.data-table > tbody > tr.child ul.dtr-details,
div.dt-container table.data-table > tbody > tr.dt-child ul.dtr-details { display: block; width: 100%; }
div.dt-container table.data-table > tbody > tr.child ul.dtr-details > li,
div.dt-container table.data-table > tbody > tr.dt-child ul.dtr-details > li {
  border-bottom: 1px solid #f6e2ee; padding: 6px 0; font-size: .82rem;
}
div.dt-container table.data-table > tbody > tr.child ul.dtr-details > li:last-child,
div.dt-container table.data-table > tbody > tr.dt-child ul.dtr-details > li:last-child { border-bottom: none; }
div.dt-container table.data-table > tbody > tr.child span.dtr-title,
div.dt-container table.data-table > tbody > tr.dt-child span.dtr-title {
  min-width: 96px; font-weight: 800; color: #7c7672;
  text-transform: uppercase; letter-spacing: .05em; font-size: .66rem;
}
/* Action buttons/links inside child rows keep their delegated handlers. */
div.dt-container table.data-table > tbody > tr.child a,
div.dt-container table.data-table > tbody > tr.dt-child a { color: #ff2f92; }

/* ---- Mobile (<600px): compact type, stacked controls ---- */
@media (max-width: 599px) {
  div.dt-container table.data-table,
  .dataTables_wrapper table.data-table { font-size: .85rem; }
  div.dt-container table.data-table > tbody > tr > td { font-size: .85rem; padding: 9px 10px; }
  div.dt-container .dt-layout-row { flex-direction: column; align-items: stretch; gap: 8px; }
  div.dt-container div.dt-layout-cell.dt-start,
  div.dt-container div.dt-layout-cell.dt-end { text-align: left; width: 100%; }
  div.dt-container .dt-search input { width: 100%; }
  div.dt-container .dt-paging { justify-content: center; }
  div.dt-container .dt-info { text-align: center; }
  div.dt-container table.data-table > tbody > tr.child span.dtr-title,
  div.dt-container table.data-table > tbody > tr.dt-child span.dtr-title { min-width: 80px; }
}
