.table-wrap {
  overflow: auto;
}

.table-card {
  padding: 0;
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-wrap table {
  width: 100%;
  min-width: 1200px;
  border-collapse: collapse;
  font-size: 12px;
}

.table-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
}

.table-toolbar h3 {
  margin: 0;
}

.search-input {
  max-width: 280px;
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid #d5deea;
  background: #fff;
}

.bulk-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  background: #fbfdff;
}

.bulk-actions .actions-wrap {
  justify-content: flex-end;
  margin-right: -8px;
}

.bulk-search-input {
  width: 280px;
  min-width: 240px;
  height: 34px;
}

.bulk-action-btn {
  min-width: 132px;
  height: 34px;
  border-radius: 10px;
  font-weight: 400;
  font-size: 14px;
}

.bulk-action-add {
  background: #0ea5a4;
  color: #ffffff;
}

.bulk-action-export {
  background: #e5eef9;
  color: #1e3a8a;
}

.bulk-action-delete {
  background: #ef4444;
  color: #ffffff;
}

.bulk-action-add:disabled {
  background: #cfeeed;
  color: #0f766e;
  opacity: 1;
}

.bulk-action-export:disabled {
  background: #edf2fb;
  color: #475569;
  opacity: 1;
}

.bulk-action-delete:disabled {
  background: #fee2e2;
  color: #b91c1c;
  opacity: 1;
}

.bulk-action-clear {
  background: #f3f4f6;
  color: #334155;
}

.bulk-action-clear:disabled {
  background: #f8fafc;
  color: #9ca3af;
  opacity: 1;
}

.bulk-selection-summary {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.bulk-selection-label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}

.bulk-selection-count {
  font-size: 14px;
  color: #0f172a;
  font-weight: 800;
}

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 10px;
  border-top: 1px solid var(--line);
  background: #fbfdff;
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
}

.pagination-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.pagination-size {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #6b7280;
}

.pagination-size span {
  font-weight: 500;
  white-space: nowrap;
}

.pagination-size select {
  width: auto;
  min-width: 60px;
  padding: 5px 6px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  color: #0f172a;
  font-size: 12px;
  cursor: pointer;
}

.pagination-info {
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
}

.pagination-center {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.pagination-page-info {
  font-size: 12px;
  color: #6b7280;
  font-weight: 500;
  min-width: 40px;
  text-align: center;
}

.pagination-btn {
  border: 1px solid #d1d5db;
  background: #fff;
  color: #374151;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pagination-btn:hover:not(:disabled) {
  border-color: #9ca3af;
  background: #f3f4f6;
  color: #111827;
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Make booking table responsive: allow wrapping and avoid forced horizontal scroll */
.booking-table table {
  /* allow the booking table to shrink to parent's width instead of forcing 1200px */
  min-width: 0;
  table-layout: auto;
}

.booking-table th,
.booking-table td {
  white-space: normal;
}

.table-wrap th,
.table-wrap td {
  padding: 10px 9px;
  border-bottom: 1px solid #edf2f7;
  text-align: left;
  vertical-align: top;
}

.table-wrap thead th {
  position: sticky;
  top: 0;
  background: var(--panel-soft);
  z-index: 1;
  font-size: 11px;
  text-transform: uppercase;
  color: #111827;
  letter-spacing: 0.01em;
  white-space: normal;
  line-height: 1.2;
  padding: 10px 9px;
}


.table-wrap tbody tr:hover {
  background: #fafcff;
}

thead th {
  background: #f9fbfd;
  font-size: 12px;
  text-transform: uppercase;
  color: #111827;
  letter-spacing: 0.03em;
}

tbody tr:hover {
  background: #fafcff;
}

/* Table cell types for booking table */
.name-cell {
  min-width: 150px;
}

.link-cell {
  min-width: 90px;
}

.links-wrap {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.link-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 30px;
  border-radius: 8px;
  background: #f0f7ff;
  color: #0b4f9f;
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid rgba(11, 79, 159, 0.15);
  transition: all 0.2s ease;
}

.link-icon:hover {
  background: #0369a1;
  color: #fff;
}

.contact-cell {
  min-width: 130px;
}

.contact-badges {
  display: flex;
  gap: 6px;
}

.contact-lines {
  display: grid;
  gap: 4px;
}

.contact-line {
  font-size: 12px;
  color: #334155;
}

.contact-label {
  font-weight: 700;
  color: #1f2937;
}

.number-cell {
  text-align: right;
  min-width: 80px;
  font-variant-numeric: tabular-nums;
}

.currency-cell {
  text-align: right;
  min-width: 90px;
  font-variant-numeric: tabular-nums;
}

.text-cell {
  min-width: 80px;
  word-break: break-word;
}

.note-cell {
  min-width: 100px;
}

.note-truncate {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #6b7280;
}

.action-cell {
  text-align: left;
  min-width: 80px;
  display: flex;
  gap: 8px;
  justify-content: flex-start;
  align-items: center;
}

.btn-icon {
  background: none;
  border: none;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 14px;
  border-radius: 4px;
  transition: background 0.2s ease;
}

.btn-icon:hover {
  background: #f0f9ff;
}

.btn-icon-danger {
  color: #dc2626;
}

.btn-icon-danger:hover {
  background: #fee2e2;
}

/* ============================================================================
   SORTABLE TABLE HEADERS
   Reusable component for any sortable column
   ============================================================================ */

.sortable-header {
  display: inline-flex;
  align-items: center;
  gap: 2px; /* tightened gap to bring icon very close to label */
  cursor: pointer;
  user-select: none;
  padding: 2px 4px;
  margin: -2px -4px;
  border-radius: 3px;
  transition: background-color 0.12s ease;
  /* allow inner label to wrap when needed */
  white-space: normal;
}

.sortable-header:hover {
  background-color: rgba(15, 23, 42, 0.08);
}

.sort-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 12px;
  height: 12px;
  font-size: 11px;
  color: #cbd5e1;
  transition: color 0.12s ease, transform 0.12s ease;
  margin-left: 0; /* icon sits immediately after label */
}

/* Inner label for sortable headers: allow wrapping and constrain width */
.sortable-header .label {
  display: inline-block;
  white-space: normal;
  max-width: 60px; /* further tightened width so indicator stays very near label */
  line-height: 1.05;
  font-weight: 600;
  vertical-align: top;
}

/* Slight transform to make current sort direction clearer */
.sortable-header.sort-asc .sort-indicator { transform: translateY(-1px); }
.sortable-header.sort-desc .sort-indicator { transform: translateY(1px); }

.sortable-header.sort-asc .sort-indicator {
  color: #0f766e;
}

.sortable-header.sort-desc .sort-indicator {
  color: #0f766e;
}

.sortable-header.sort-asc .sort-indicator::before {
  content: '▲';
}

.sortable-header.sort-desc .sort-indicator::before {
  content: '▼';
}