/* ============================================================================
   SOCIOMONKEY DESIGN SYSTEM — Table System
   ============================================================================
   Used by: Leads, Team, Projects, Reports, Activity Logs, Export, and all
   future product list views.
   Same spacing, row height, typography, pagination everywhere.
   ============================================================================ */

/* ── Scroll wrapper (enables horizontal scroll on small screens) ─────────── */
.sm-table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md, 10px);
  border: 1px solid var(--sm-divider, #e4e4e4);
  background: #ffffff;
  -webkit-overflow-scrolling: touch;
}

/* ── Table base ─────────────────────────────────────────────────────────── */
.sm-table {
  width: 100%;
  border-collapse: collapse;
}

/* Header cells */
.sm-table th {
  padding: 10px 14px;
  background: #fafafa;
  border-bottom: 1.5px solid var(--sm-divider, #e4e4e4);
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--sm-muted, #888888);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Data cells */
.sm-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--sm-divider-soft, #f0f0ee);
  font-size: 14px;
  color: var(--sm-body, #444444);
  vertical-align: middle;
}

.sm-table tr:last-child td {
  border-bottom: none;
}

.sm-table tbody tr {
  transition: background 80ms ease;
}

.sm-table tbody tr:hover td {
  background: #fafafa;
}

/* ── Selected row ────────────────────────────────────────────────────────── */
.sm-table tr.selected td {
  background: rgba(222, 46, 46, .04);
  border-color: rgba(222, 46, 46, .12);
}

/* ── Status / tag badges ────────────────────────────────────────────────── */
.sm-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.sm-badge-green  { background: #dcfce7; color: #15803d; }
.sm-badge-red    { background: #fee2e2; color: #dc2626; }
.sm-badge-amber  { background: #fef9c3; color: #a16207; }
.sm-badge-blue   { background: #dbeafe; color: #1d4ed8; }
.sm-badge-purple { background: #f3e8ff; color: #7e22ce; }
.sm-badge-gray   { background: #f3f4f6; color: #6b7280; }

/* ── Pagination bar ─────────────────────────────────────────────────────── */
.sm-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-top: 1px solid var(--sm-divider, #e4e4e4);
  flex-wrap: wrap;
  gap: 8px;
}

.sm-pagination-info {
  font-size: 12px;
  color: var(--sm-muted, #888888);
}

.sm-pagination-controls {
  display: flex;
  gap: 4px;
  align-items: center;
}

.sm-pagination-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--sm-divider, #e4e4e4);
  border-radius: 7px;
  background: #ffffff;
  color: var(--sm-body, #444444);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 100ms ease;
}

.sm-pagination-btn:hover {
  background: #f5f5f3;
}

.sm-pagination-btn.active {
  background: var(--sm-brand, #de2e2e);
  color: #ffffff;
  border-color: var(--sm-brand, #de2e2e);
}

.sm-pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Mobile ─────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sm-table th,
  .sm-table td {
    padding: 10px 8px;
    font-size: 13px;
  }
}
