/* Grid.js theme aligned with app design tokens */

.app-grid-table.gridjs-container {
  font-family: inherit;
  color: inherit;
  padding: 0;
}

.app-grid-table .gridjs-wrapper {
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0.75rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.app-grid-table .gridjs-head {
  padding-bottom: 0.75rem;
}

.app-grid-table .gridjs-search {
  float: none;
  width: 100%;
  max-width: 20rem;
}

.app-grid-table .gridjs-search-input {
  width: 100%;
  border-radius: 0.5rem;
  border: 1px solid rgb(209 213 219);
  background: rgb(255 255 255);
  color: rgb(17 24 39);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.app-grid-table .gridjs-search-input:focus {
  border-color: rgb(99 102 241);
  box-shadow: 0 0 0 2px rgb(99 102 241 / 0.25);
}

.dark .app-grid-table .gridjs-search-input {
  background: rgb(31 41 55);
  border-color: rgb(75 85 99);
  color: rgb(243 244 246);
}

.app-grid-table .gridjs-table {
  width: 100%;
  min-width: 40rem;
  table-layout: auto;
  border-collapse: separate;
  border-spacing: 0;
}

.app-grid-table .gridjs-thead .gridjs-tr {
  background: rgb(249 250 251);
}

.dark .app-grid-table .gridjs-thead .gridjs-tr {
  background: rgb(17 24 39);
}

.app-grid-table .gridjs-th {
  background: transparent !important;
  border: 0 !important;
  border-bottom: 1px solid rgb(229 231 235) !important;
  padding: 0.75rem 1rem !important;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgb(107 114 128) !important;
  white-space: nowrap;
}

.dark .app-grid-table .gridjs-th {
  border-bottom-color: rgb(55 65 81) !important;
  color: rgb(156 163 175) !important;
}

.app-grid-table .gridjs-th-content {
  overflow: visible;
  text-overflow: unset;
  white-space: nowrap;
}

.app-grid-table .gridjs-th .gridjs-th-content {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.app-grid-table .gridjs-tbody .gridjs-tr {
  background: rgb(255 255 255);
  transition: background-color 0.15s ease;
}

.dark .app-grid-table .gridjs-tbody .gridjs-tr {
  background: rgb(31 41 55);
}

.app-grid-table .gridjs-tbody .gridjs-tr:hover {
  background: rgb(249 250 251);
}

.dark .app-grid-table .gridjs-tbody .gridjs-tr:hover {
  background: rgb(55 65 81);
}

.app-grid-table .gridjs-td {
  background: transparent !important;
  border: 0 !important;
  border-bottom: 1px solid rgb(229 231 235) !important;
  padding: 0.875rem 1rem !important;
  font-size: 0.875rem;
  color: rgb(31 41 55);
  vertical-align: middle;
}

.dark .app-grid-table .gridjs-td {
  border-bottom-color: rgb(55 65 81) !important;
  color: rgb(229 231 235);
}

.app-grid-table .gridjs-tbody .gridjs-tr:last-child .gridjs-td {
  border-bottom: 0 !important;
}

.app-grid-table .gridjs-td:first-child {
  font-weight: 500;
  color: rgb(17 24 39);
}

.dark .app-grid-table .gridjs-td:first-child {
  color: rgb(243 244 246);
}

.app-grid-table .gridjs-footer {
  border-top: 1px solid rgb(229 231 235);
  padding-top: 0.75rem;
  margin-top: 0.25rem;
  box-shadow: none !important;
  background-color: transparent !important;
}

.dark .app-grid-table .gridjs-footer {
  border-top-color: rgb(55 65 81);
  background-color: rgb(31 41 55) !important;
}

.app-grid-table .gridjs-summary {
  font-size: 0.8125rem;
  color: rgb(107 114 128);
}

.dark .app-grid-table .gridjs-summary {
  color: rgb(156 163 175);
}

.dark .app-grid-table .gridjs-pagination {
  color: rgb(209 213 219);
}

.app-grid-table .gridjs-pagination .gridjs-pages button {
  border-radius: 0.5rem;
  border: 1px solid rgb(229 231 235);
  background: rgb(255 255 255);
  color: rgb(55 65 81);
  font-size: 0.8125rem;
  padding: 0.35rem 0.65rem;
  margin: 0 0.125rem;
}

.dark .app-grid-table .gridjs-pagination .gridjs-pages button {
  border-color: rgb(75 85 99);
  background: rgb(31 41 55) !important;
  color: rgb(209 213 219);
}

.app-grid-table .gridjs-pagination .gridjs-pages button:hover:not(:disabled) {
  background: rgb(243 244 246);
}

.dark .app-grid-table .gridjs-pagination .gridjs-pages button:hover:not(:disabled) {
  background: rgb(55 65 81) !important;
  color: rgb(243 244 246);
}

.app-grid-table .gridjs-pagination .gridjs-pages button.gridjs-currentPage {
  background: rgb(79 70 229);
  border-color: rgb(79 70 229);
  color: rgb(255 255 255);
  font-weight: 600;
}

.dark .app-grid-table .gridjs-pagination .gridjs-pages button.gridjs-currentPage {
  background: rgb(79 70 229) !important;
  border-color: rgb(79 70 229);
  color: rgb(255 255 255);
}

.app-grid-table .gridjs-pagination .gridjs-pages button:disabled,
.app-grid-table .gridjs-pagination .gridjs-pages button:hover:disabled,
.app-grid-table .gridjs-pagination .gridjs-pages button[disabled] {
  opacity: 0.45;
}

.dark .app-grid-table .gridjs-pagination .gridjs-pages button:disabled,
.dark .app-grid-table .gridjs-pagination .gridjs-pages button:hover:disabled,
.dark .app-grid-table .gridjs-pagination .gridjs-pages button[disabled] {
  background: rgb(31 41 55) !important;
  color: rgb(107 114 128);
}

/* Status badges */
.grid-table-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  padding: 0.2rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.25rem;
}

.grid-table-badge-success {
  background: rgb(220 252 231);
  color: rgb(21 128 61);
}

.dark .grid-table-badge-success {
  background: rgb(20 83 45 / 0.45);
  color: rgb(134 239 172);
}

.grid-table-badge-danger {
  background: rgb(254 226 226);
  color: rgb(185 28 28);
}

.dark .grid-table-badge-danger {
  background: rgb(127 29 29 / 0.45);
  color: rgb(252 165 165);
}

.grid-table-badge-warning {
  background: rgb(254 243 199);
  color: rgb(146 64 14);
}

.dark .grid-table-badge-warning {
  background: rgb(120 53 15 / 0.45);
  color: rgb(253 230 138);
}

/* Action buttons inside table */
.app-grid-table .grid-table-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.375rem;
  flex-wrap: nowrap;
}

.app-grid-table .grid-table-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border-radius: 0.5rem;
  border: 1px solid rgb(229 231 235);
  background: rgb(243 244 246);
  color: rgb(55 65 81);
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.app-grid-table .grid-table-icon-btn:hover {
  background: rgb(229 231 235);
  color: rgb(17 24 39);
}

.dark .app-grid-table .grid-table-icon-btn {
  border-color: rgb(75 85 99);
  background: rgb(55 65 81);
  color: rgb(209 213 219);
}

.dark .app-grid-table .grid-table-icon-btn:hover {
  background: rgb(75 85 99);
  color: rgb(243 244 246);
}

.app-grid-table .grid-table-icon-btn-danger {
  border-color: rgb(252 165 165);
  background: rgb(254 226 226);
  color: rgb(185 28 28);
}

.app-grid-table .grid-table-icon-btn-danger:hover {
  background: rgb(252 165 165);
  color: rgb(127 29 29);
}

.app-grid-table .grid-table-icon-btn-success {
  border-color: rgb(134 239 172);
  background: rgb(220 252 231);
  color: rgb(21 128 61);
}

.app-grid-table .grid-table-icon-btn-success:hover {
  background: rgb(134 239 172);
  color: rgb(20 83 45);
}

.dark .app-grid-table .grid-table-icon-btn-success {
  border-color: rgb(22 101 52);
  background: rgb(20 83 45 / 0.55);
  color: rgb(134 239 172);
}

.dark .app-grid-table .grid-table-icon-btn-success:hover {
  background: rgb(22 101 52);
  color: rgb(220 252 231);
}

.dark .app-grid-table .grid-table-icon-btn-danger {
  border-color: rgb(153 27 27);
  background: rgb(127 29 29 / 0.55);
  color: rgb(252 165 165);
}

.dark .app-grid-table .grid-table-icon-btn-danger:hover {
  background: rgb(153 27 27);
  color: rgb(254 226 226);
}

.app-grid-table .grid-table-muted {
  color: rgb(107 114 128);
}

.dark .app-grid-table .grid-table-muted {
  color: rgb(156 163 175);
}
