/* General Table */
.tabulator {
  font-family: var(--font-body);
  background-color: var(--bg-content);
  color: var(--fg-default);
  border: 1px solid var(--fg-input-border);
  border-radius: 6px;
  overflow: hidden;
}

/* Header Styling */
.tabulator-header {
  background-color: var(--bg-header);
  color: var(--fg-default);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 14px;
  border-bottom: 1px solid var(--fg-input-border);
}

.tabulator .tabulator-header .tabulator-col {
  background: var(--bg-primary) !important;
}

.tabulator .tabulator-header {
  background: #fff !important;
}

.tabulator .tabulator-col-title {
  color: var(--fg-accent);
  font-weight: 600;
  font-family: var(--font-heading);
  font-size: 14px;
  padding: 0;
}

.tabulator .tabulator-col:hover,
.tabulator-col[aria-sort="ascending"],
.tabulator-col[aria-sort="descending"] {
  background-color: var(--bg-primary-dark);
  color: var(--fg-inverse);
}

/* Rows */
.tabulator-row {
  background-color: var(--bg-content);
  border-bottom: 1px solid var(--fg-input-border);
}

.tabulator-row:hover {
  background-color: var(--bg-default);
}

.tabulator-row.tabulator-selected {
  background-color: var(--bg-primary) !important;
  color: #000;
}

/* Pagination */
.tabulator-paginator {
  background-color: var(--bg-footer);
  border-top: 1px solid var(--fg-input-border);
}

.tabulator-page {
  background-color: var(--bg-primary);
  color: var(--fg-accent);
  border: none;
  border-radius: 4px;
  margin: 0 4px;
  padding: 6px 10px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.tabulator-page:hover,
.tabulator-page.active {
  background-color: var(--bg-primary-dark);
  color: var(--fg-inverse);
}

/* Inputs and Selects */
.tabulator input,
.tabulator select {
  font-family: var(--font-input);
  font-size: 100%;
  border: 1px solid var(--fg-input-border);
  border-radius: 4px;
  padding: 6px;
  color: var(--fg-default);
  background-color: var(--bg-content);
}

.tabulator input:focus,
.tabulator select:focus {
  border-color: var(--brand-primary);
  outline: none;
}

/* Action Buttons */
.tabulator .btn {
  display: inline-block;
  background-color: var(--brand-primary);
  color: var(--fg-inverse);
  border: none;
  padding: 6px 12px;
  font-family: var(--font-label);
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.2s ease;
}

.tabulator .btn:hover {
  background-color: var(--brand-accent-dark);
}

/* Scrollbar */
.tabulator::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.tabulator::-webkit-scrollbar-thumb {
  background-color: var(--fg-muted);
  border-radius: 4px;
}

.tabulator::-webkit-scrollbar-thumb:hover {
  background-color: var(--brand-primary);
}

/* Header Pop-up Css */

.tabulator-header
  .tabulator-col
  .tabulator-col-content
  .tabulator-header-popup-button {
  margin-left: 5px;
  opacity: 0.6;
  transition: opacity 0.3s;
  color: #4b6cb7;
}

.tabulator-header
  .tabulator-col
  .tabulator-col-content
  .tabulator-header-popup-button:hover {
  opacity: 1;
}

.header-filter-popup {
  padding: 15px;
  background: white;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  width: 300px;
  z-index: 10000;
}

.filter-list {
  max-height: 250px;
  overflow-y: auto;
  margin-bottom: 15px;
  border: 1px solid #eee;
  border-radius: 6px;
  padding: 5px;
}

.filter-item {
  padding: 8px 15px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #f5f5f5;
  transition: background 0.2s;
}

.filter-item:last-child {
  border-bottom: none;
}

.filter-item:hover {
  background: #f8f9ff;
}

.empty-message {
  text-align: center;
  padding: 20px;
  color: #7f8c8d;
  font-style: italic;
}

/* Red filter icon when filter is applied */
.tabulator-header-popup-button.filter-active-red {
  color: #dc3545 !important; /* Red color */
  opacity: 1 !important;
}

/* Original filter icon style (optional) */
.tabulator-header-popup-button.filter-active {
  color: #007bff !important; /* Blue color or your original active color */
  opacity: 1 !important;
}

.header-filter-icon {
  transition: color 0.3s ease;
}
.text-gray-400 {
  color: #9ca3af;
}
.text-red-500 {
  color: #ef4444;
}
