.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.button-group {
  display: flex;
  gap: 10px;
  padding: 4px;
  flex-wrap: wrap;
}

.nav-button,
.action-button,
.row-action {
  display: inline-block;
  text-decoration: none;
  border-radius: 6px;
  transition: 0.15s ease;
}

.nav-button {
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #222;
}

.nav-button:hover {
  background: #f8fafc;
}

.nav-button.active {
  background: #e5e7eb;
  border-color: #94a3b8;
  font-weight: 600;
}

.action-button {
  padding: 10px 16px;
  border: 1px solid #2563eb;
  background: #2563eb;
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
}

.action-button:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

.danger-button {
  display: inline-block;
  padding: 10px 16px;
  border: 1px solid #dc2626;
  background: #dc2626;
  color: #fff;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
}

.danger-button:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}

.high-danger-button {
  display: inline-block;
  padding: 10px 16px;
  border: 1px solid #b915da;
  background: #b915da;
  color: #fff;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
}

.high-danger-button:hover {
  background: #8d17a4;
  border-color: #8d17a4;
}

.row-action {
  padding: 6px 10px;
  margin-right: 8px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #222;
  font-size: 13px;
}

.row-action:hover {
  background: #f8fafc;
}

.row-action.delete {
  border-color: #ef4444;
  color: #b91c1c;
}

.row-action.delete:hover {
  background: #fef2f2;
}

.row-action.activate {
  border-color: #10b981;
  color: #047857;
}

.row-action.activate:hover {
  background: #ecfdf5;
}

.row-action.deactivate {
  border-color: #f59e0b;
  color: #92400e;
}

.row-action.deactivate:hover {
  background: #fffbeb;
}

.table-card {
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  overflow: hidden;
}

.table-wrapper {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
  vertical-align: middle;
}

th {
  background: #f9fafb;
  font-size: 14px;
  font-weight: 700;
}

td {
  font-size: 14px;
}

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

.actions-cell {
  white-space: nowrap;
}

.empty-state {
  padding: 24px;
  background: #fff;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  color: #475569;
}

.form-card {
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 24px;
  max-width: 700px;
}

.form-row {
  margin-bottom: 18px;
}

.form-row label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}

.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  font: inherit;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: none;
  border-color: #2563eb;
}

.help-text {
  margin-top: 6px;
  font-size: 13px;
  color: #64748b;
}

.field-errors,
.form-errors {
  margin-top: 6px;
  color: #b91c1c;
  font-size: 14px;
}

.form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 24px;
}

.detail-card {
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  overflow: hidden;
  max-width: 800px;
}

.detail-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  border-bottom: 1px solid #e5e7eb;
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  padding: 14px 16px;
  background: #f9fafb;
  font-weight: 600;
}

.detail-value {
  padding: 14px 16px;
  background: #fff;
}

.accordion-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.accordion-item {
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  overflow: hidden;
}

.accordion-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  cursor: pointer;
  font-weight: 600;
  background: #f9fafb;
}

.accordion-summary:hover {
  background: #f3f4f6;
}

.accordion-summary::-webkit-details-marker {
  display: none;
}

.accordion-content {
  padding: 16px;
}

.accordion-meta {
  font-size: 13px;
  color: #64748b;
  font-weight: 400;
}

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
  margin-bottom: 18px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  flex-wrap: wrap;
}

.pagination-summary {
  color: #475569;
  font-size: 14px;
  font-weight: 600;
}

.pagination-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pagination-current {
  display: inline-block;
  padding: 6px 10px;
  color: #475569;
  font-size: 13px;
  white-space: nowrap;
}

.pagination .row-action {
  margin-right: 0;
}

.inactive-row td {
  background: #e5e7eb;
  color: #000000;
}

.inline-action-form {
  display: inline;
  margin: 0;
  padding: 0;
}

.toggle-active-button {
  cursor: pointer;
  font: inherit;
}

.muted-zero {
  color: #94a3b8;
  background: #f8fafc;
}

/* Reusable dropdown menu component */

.dropdown-menu {
  position: relative;
}

.dropdown-menu-button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
  min-width: 150px;
  padding: 9px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  user-select: none;
  white-space: nowrap;
}

.dropdown-menu-button::-webkit-details-marker {
  display: none;
}

.dropdown-menu-button::after {
  content: "▾";
  flex: 0 0 auto;
  color: #64748b;
  font-size: 12px;
}

.dropdown-menu[open] .dropdown-menu-button {
  background: #eff6ff;
  border-color: #2563eb;
  color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.dropdown-menu-button.icon-only {
  justify-content: center;
  width: 38px;
  min-width: 38px;
  height: 38px;
  padding: 0;
}

.dropdown-menu-button.icon-only::after {
  display: none;
}

.dropdown-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: auto;
  width: 260px;
  padding: 6px;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16);
  z-index: 50;
}

.dropdown-menu-panel.align-right {
  left: auto;
  right: 0;
}

.dropdown-menu-panel.scrollable {
  max-height: 320px;
  overflow-y: auto;
}

.dropdown-menu-heading {
  padding: 8px 10px 6px;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dropdown-menu-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  color: #111827;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.dropdown-menu-option:hover {
  background: #f1f5f9;
}

.dropdown-menu-option.active {
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 800;
}

.dropdown-menu-option.disabled {
  color: #94a3b8;
  background: #f8fafc;
  cursor: not-allowed;
}

.dropdown-menu-option.stacked {
  align-items: stretch;
  flex-direction: column;
  justify-content: flex-start;
  gap: 3px;
}

.dropdown-menu-title {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
}

.dropdown-menu-meta {
  color: #64748b;
  font-size: 12px;
  line-height: 1.3;
}

.dropdown-menu-option.disabled .dropdown-menu-meta {
  color: #94a3b8;
}

.dropdown-menu-divider {
  height: 1px;
  margin: 6px 4px;
  background: #e5e7eb;
}

.dropdown-menu-check {
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 800;
}

.dropdown-menu-empty {
  padding: 12px 10px;
  color: #64748b;
  font-size: 13px;
}

/* Reusable searchable select component */

.searchable-select {
  position: relative;
  width: 100%;
}

.searchable-select-source {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  border: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
}

.searchable-select-button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #111827;
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.searchable-select-button:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.searchable-select-button:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.searchable-select.open .searchable-select-button {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.searchable-select.disabled .searchable-select-button,
.searchable-select-button:disabled {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #64748b;
  cursor: not-allowed;
  box-shadow: none;
}

.searchable-select.disabled .searchable-select-button:hover,
.searchable-select-button:disabled:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.searchable-select-button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.searchable-select-button strong {
  flex: 0 0 auto;
  color: #64748b;
  font-size: 12px;
  line-height: 1;
}

.searchable-select-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 60;
  min-width: 100%;
  max-height: 320px;
  display: flex;
  flex-direction: column;
  padding: 6px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.16);
}

.searchable-select-panel[hidden] {
  display: none;
}

.searchable-select-search-wrap {
  padding: 4px 4px 7px;
  border-bottom: 1px solid #e5e7eb;
}

.searchable-select-search {
  width: 100%;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #f8fafc;
  color: #111827;
  font: inherit;
  font-size: 13px;
}

.searchable-select-search:focus {
  outline: none;
  border-color: #2563eb;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.searchable-select-options {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 6px;
  overflow-y: auto;
}

.searchable-select-action-row {
  padding: 4px 2px 7px;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 4px;
}

.searchable-select-create-action {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 8px 10px;
  border: 1px solid #2563eb;
  border-radius: 7px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.searchable-select-create-action:hover {
  background: #dbeafe;
  border-color: #1d4ed8;
}

.searchable-select-option-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  border-radius: 7px;
}

.searchable-select-option-row:hover {
  background: #f1f5f9;
}

.searchable-select-option-row.selected {
  background: #eff6ff;
}

.searchable-select-option-row.empty {
  grid-template-columns: 1fr;
}

.searchable-select-option-row.disabled {
  background: #f8fafc;
}

.searchable-select-option-row.empty .searchable-select-option,
.searchable-select-option-row.disabled .searchable-select-option {
  color: #94a3b8;
}

.searchable-select-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 7px;
  background: #fff;
  color: #111827;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.searchable-select-option:hover {
  background: #f1f5f9;
}

.searchable-select-option.selected {
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 800;
}

.searchable-select-option.empty {
  color: #64748b;
  font-weight: 600;
}

.searchable-select-option.disabled,
.searchable-select-option:disabled {
  color: #94a3b8;
  background: #f8fafc;
  cursor: not-allowed;
}

.searchable-select-option span {
  min-width: 0;
}

.searchable-select-option-label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  overflow: hidden;
}

.searchable-select-option-label > span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.searchable-select-option-help {
  display: block;
  max-width: 100%;
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.searchable-select-option-row.selected .searchable-select-option-help {
  color: #475569;
}

.searchable-select-option strong {
  flex: 0 0 auto;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 900;
}

.searchable-select-option-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding-right: 4px;
}

.searchable-select-mini-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 4px 7px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #334155;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.searchable-select-mini-action:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}

.searchable-select-mini-action.danger {
  border-color: #fecaca;
  color: #b91c1c;
}

.searchable-select-mini-action.danger:hover {
  background: #fef2f2;
  border-color: #ef4444;
  color: #991b1b;
}

.searchable-select-empty {
  padding: 12px 10px;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
}

@media (max-width: 700px) {
  .dropdown-menu,
  .dropdown-menu-button {
    width: 100%;
    max-width: none;
  }

  .dropdown-menu-panel,
  .dropdown-menu-panel.align-right {
    left: 0;
    right: auto;
    width: 100%;
    max-width: none;
  }

  .searchable-select-panel {
    max-height: 260px;
  }

  .searchable-select-option-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .searchable-select-option-actions {
    justify-content: flex-end;
    padding: 0 4px 6px;
  }
}