.booking-table,
.customer-table,
.quote-table,
.ledger-table,
.wallet-table,
.finance-detail-table,
.passport-table,
.team-table {
  max-height: calc(100vh - 255px);
  overflow: auto;
}

.booking-table thead th,
.customer-table thead th,
.quote-table thead th,
.ledger-table thead th,
.wallet-table thead th,
.finance-detail-table thead th,
.passport-table thead th,
.team-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
  box-shadow: 0 1px 0 var(--line);
}

.booking-table th,
.booking-table td,
.customer-table th,
.customer-table td,
.quote-table th,
.quote-table td,
.ledger-table th,
.ledger-table td,
.wallet-table th,
.wallet-table td,
.finance-detail-table th,
.finance-detail-table td,
.passport-table th,
.passport-table td,
.team-table th,
.team-table td {
  border-right: 1px solid var(--line);
}

.booking-table th:last-child,
.booking-table td:last-child,
.customer-table th:last-child,
.customer-table td:last-child,
.quote-table th:last-child,
.quote-table td:last-child,
.ledger-table th:last-child,
.ledger-table td:last-child,
.wallet-table th:last-child,
.wallet-table td:last-child,
.finance-detail-table th:last-child,
.finance-detail-table td:last-child,
.passport-table th:last-child,
.passport-table td:last-child,
.team-table th:last-child,
.team-table td:last-child {
  border-right: 0;
}

.booking-search {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.booking-search input {
  width: min(520px, 100%);
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
}

.booking-search input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal2);
}

.booking-search small {
  color: var(--muted);
  white-space: nowrap;
}

.finance-search {
  margin-top: 16px;
}

.finance-filter {
  display: flex;
  align-items: end;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.finance-filter label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.finance-filter input,
.finance-filter select {
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.finance-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
  overflow-x: auto;
}

.finance-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.finance-section {
  margin-top: 18px;
}

.finance-report table {
  width: 100%;
  min-width: 0;
  margin-bottom: 20px;
}

.finance-report th,
.finance-report td {
  border: 1px solid var(--line);
}


@media (max-width: 760px) {
  .finance-filter > * {
    width: 100%;
  }

  .finance-stats {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }
}

.team-filters {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) repeat(3, minmax(140px, 190px)) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.team-filters input,
.team-filters select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.team-filters small {
  color: var(--muted);
  white-space: nowrap;
}

.employee-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.employee-initial,
.photo-button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--teal2);
  color: var(--teal);
  font-weight: 800;
}

.permission-matrix {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 14px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
}

.permission-matrix label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  text-transform: capitalize;
}

.permission-matrix input {
  width: auto;
}

.account-security {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 18px;
}

.account-security h3 {
  margin: 0;
}

.account-security > div,
.document-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.session-list {
  margin-top: 18px;
}

.session-list > div {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.two-factor-secret {
  padding: 14px;
  border: 1px dashed var(--teal);
  border-radius: 8px;
  text-align: center;
  font: 700 18px monospace;
  letter-spacing: 2px;
  word-break: break-all;
}

.danger {
  color: var(--red);
  border-color: #efbcbc;
}

@media (max-width: 900px) {
  .team-filters {
    grid-template-columns: 1fr 1fr;
  }

  .permission-matrix {
    grid-template-columns: 1fr 1fr;
  }
}
