.table-wrapper {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 15px;
}

/* Header spacing */
.table-header {
  margin-bottom: 15px;
}

/* Table scroll container */
.table-content {
  width: 100%;
  overflow-x: auto;
}

/* Table styles */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
  color: var(--body-text);
  border: 1px solid var(--border-color);
  border-radius: 10px;
}

/* Table head */
table thead th {
  background: var(--card-header-bg);
  font-weight: 600;
  font-size: 13px;
  color: var(--muted-text);
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

[data-bs-theme="dark"] .table-light th {
  background-color: var(--card-header-bg);
  color: var(--muted-text);
  border-color: var(--border-color);
}

table thead th:first-child {
  width: 32px;
}

/* Table body */
table tbody tr {
  transition: background 0.15s ease-in-out;
  background-color: var(--card-bg);
  color: var(--body-text);
}

table tbody tr:hover {
  background: var(--hover-bg);
}

table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
  white-space: nowrap;
  color: var(--body-text);
}

table tbody tr:last-child td {
  border-bottom: none;
}

/* Footer spacing */
.table-footer {
  margin-top: 10px;
}

/* Column alignment */
table .right {
  text-align: right;
}

table .center {
  text-align: center;
}

table .left {
  text-align: left;
}

.workflow-item--open {
  background-color: #e8f2ff;
  border-color: #b6d6ff !important;
}

.workflow-item--in_progress {
  background-color: #fff5e6;
  border-color: #f3d39b !important;
}

.workflow-item--completed {
  background-color: #eafaf0;
  border-color: #aee7c4 !important;
}

.workflow-item--canceled {
  background-color: #f3f4f6;
  border-color: #d1d5db !important;
}

.workflow-item--overdue {
  background-color: #fdecec;
  border-color: #f5b5b5 !important;
}

[data-bs-theme="dark"] .workflow-item--open {
  background-color: rgba(59, 130, 246, 0.18);
  border-color: rgba(59, 130, 246, 0.35) !important;
}

[data-bs-theme="dark"] .workflow-item--in_progress {
  background-color: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.35) !important;
}

[data-bs-theme="dark"] .workflow-item--completed {
  background-color: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.35) !important;
}

[data-bs-theme="dark"] .workflow-item--canceled {
  background-color: rgba(148, 163, 184, 0.14);
  border-color: rgba(148, 163, 184, 0.28) !important;
}

[data-bs-theme="dark"] .workflow-item--overdue {
  background-color: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.35) !important;
}

/* ===== Checkbox ===== */
table input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary-color, #7c5cff);
  cursor: pointer;
}

.email-template-table {
  table-layout: fixed;
}

.email-template-table td {
  overflow: hidden;
}

.email-template-table .cell-ellipsis {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.email-template-table thead th:first-child {
  width: 120px;
}

.email-template-table .col-code {
  width: 120px;
}

.email-template-table .col-target {
  width: 110px;
}

.email-template-table .col-version {
  width: 90px;
}

.email-template-table .col-active {
  width: 90px;
}

.email-template-table .col-updated {
  width: 170px;
}

.email-template-table .col-actions {
  width: 190px;
}

.email-template-table .subject-text {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.email-template-table th.actions-col {
  position: sticky;
  right: 0;
  z-index: 3;
  background: var(--card-header-bg);
  box-shadow: -10px 0 10px -10px rgba(0, 0, 0, 0.25);
}

.email-template-table td.actions-col {
  position: sticky;
  right: 0;
  z-index: 2;
  background: var(--card-bg);
  box-shadow: -10px 0 10px -10px rgba(0, 0, 0, 0.18);
}

/* ===== Avatar + Name ===== */
.cell-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e5e7eb;
  object-fit: cover;
}

/* ===== Activity / Subtle text ===== */
.text-muted {
  color: #9ca3af;
  font-size: 13px;
}

/* ===== Badges (Tags) ===== */
.badges {
  display: flex;
  gap: 6px;
  align-items: center;
}

.badge {
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  line-height: 1;
}

/* Badge color variants */
.badge-purple {
  background: #f3f0ff;
  color: #7c5cff;
  border-color: #e0d7ff;
}

.badge-red {
  background: #fff1f2;
  color: #e11d48;
  border-color: #fecdd3;
}

.badge-green {
  background: #ecfdf5;
  color: #10b981;
  border-color: #bbf7d0;
}

.badge-gray {
  background: #f3f4f6;
  color: #6b7280;
  border-color: #e5e7eb;
}

/* "+2" more badge */
.badge-more {
  background: #f9fafb;
  border: 1px dashed #e5e7eb;
  color: #6b7280;
}

/* ===== Pagination Dropdown (bottom popup) ===== */
.page-size {
  position: relative;
  display: inline-block;
}

.page-size-menu {
  position: absolute;
  bottom: 120%;
  right: 0;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  padding: 8px;
  min-width: 160px;
}

.page-size-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  font-size: 13px;
  color: #374151;
  border-radius: 8px;
  cursor: pointer;
}

.page-size-option:hover {
  background: #f3f4f6;
}

.page-size-option input[type="checkbox"] {
  accent-color: #7c5cff;
}

/* ===== Column Alignment ===== */
table .right {
  text-align: right;
}

table .center {
  text-align: center;
}

table .left {
  text-align: left;
}
