/* Custom table normalization for Scanners and Users
   Ensures identical borders, paddings, and rounded clipping
*/
.table.table-hover.align-middle.mb-0 {
  border-collapse: separate; /* ensure spacing controlled */
  border-spacing: 0;
}

.table thead th {
  border-bottom: 1px solid #e9ecef;
  background: #fff;
  vertical-align: middle;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
}

.table tbody tr {
  border-bottom: 1px solid rgba(0,0,0,0.04);
}

.table tbody tr:last-child {
  border-bottom: 0;
}

.table td, .table th {
  padding: .55rem .75rem; /* approx px-3 py-2 */
}

/* Card wrapper helpers (used by TableModule) */
.card.table-card {
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(16,24,40,0.04);
  border: 0; /* remove default card border */
  position: relative;
  background: #fff; /* ensure no transparency */
}

/* ensure table does not draw a bottom line or leave margin that shows as a dark strip */
.card.table-card .table {
  margin-bottom: 0;
  border-bottom: 0;
  background: #fff;
}

/* remove any stray outline/shadow at bottom from responsive wrapper */
.card.table-card .table-responsive {
  overflow: hidden;
  border: 0; /* remove wrapper border entirely */
  background: #fff;
}

/* Override any rogue border from Bootstrap .table-responsive */
.table-responsive {
  border: 0 !important;
}

/* ensure very last table row has no bottom border */
.table tbody tr:last-child {
  border-bottom: 0 !important;
}

.table tbody tr:last-child td {
  border-bottom: 0 !important;
}

.table td.action-cell, .table th.action-cell {
  width: 56px;
  text-align: center;
  white-space: nowrap;
}

.table td.chev-cell, .table th.chev-cell {
  width: 36px;
  text-align: center;
}

.role-badge, .status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: .15rem .35rem;
  height: 20px;
}

.table thead th:first-child { border-top-left-radius: 8px; }
.table thead th:last-child { border-top-right-radius: 8px; }
.table tbody tr:last-child td:first-child { border-bottom-left-radius: 8px; }
.table tbody tr:last-child td:last-child { border-bottom-right-radius: 8px; }

/* sortable header cursor and subtle indicator */
.table thead th.sortable {
  cursor: pointer;
  position: relative;
}
.table thead th.sortable::after {
  content: '\25B2';
  font-size: 0.6rem;
  opacity: 0.15;
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
}
.table thead th.sortable.sorted-desc::after {
  content: '\25BC';
  opacity: 0.35;
}
.table thead th.sortable.sorted-asc::after {
  content: '\25B2';
  opacity: 0.6;
}

/* Copy toast */
.copy-toast {
  position: absolute;
  z-index: 3000;
  background: rgba(0,0,0,0.85);
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.85rem;
  opacity: 0;
  transform: translateY(0);
  transition: transform 220ms ease, opacity 220ms ease;
  pointer-events: none;
}
.copy-toast.visible {
  opacity: 1;
}

/* Scanner cards styling (3 per row) */
.scanner-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.scanner-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.12) !important;
}

.scanner-card .card-header {
  padding: 1rem;
  background: #fff;
  flex-shrink: 0;
}

.scanner-card .card-body {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.scanner-card .card-body > div:not(.border-top) {
  margin-bottom: 0.75rem;
}

.scanner-card .card-body > div.border-top {
  margin-top: auto;
  padding-top: 0.75rem;
  margin-bottom: 0;
}

.scanner-card .card-title {
  font-size: 1rem;
  line-height: 1.4;
}

/* Clear search button styling */
.position-relative input.ps-5 {
  padding-left: 2.5rem !important;
}

.position-relative .btn-link {
  text-decoration: none;
  padding: 0;
  border: 0;
  background: transparent;
}

.position-relative .btn-link:hover {
  color: #dc3545 !important;
}

.position-relative .btn-link i {
  font-size: 0.875rem;
}
