.action-groups {
  width: 100%;
  max-width: 1200px;
}
.action-groups .action-abort {
  width: 100%;
  margin-top: 10px;
}
.action-groups p {
  margin-bottom: 0;
}
.groups__container {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

/* --- list --- */
.groups__sidebar {
  flex: 0 0 340px;
  background-color: white;
  border-radius: 16px;
  border: 1px solid #e9edf5;
  overflow: hidden;
}
.groups__toolbar {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-bottom: 2px solid #e9edf5;
}
.groups__toolbar .btn {
  white-space: nowrap;
}
.groups__list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 70vh;
  overflow-y: auto;
}
.groups__list-empty {
  padding: 10px;
  color: #6b7280;
}
.groups__item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px;
  border-bottom: 1px solid #e9edf5;
  border-left: 4px solid transparent;
  cursor: pointer;
  transition: background-color 0.2s;
}
.groups__item:focus-visible {
  outline: 2px solid rgba(24, 64, 128, 0.6);
  outline-offset: -2px;
}
.groups__item:hover {
  background-color: #f6f7f8;
}
.groups__item--selected,
.groups__item--selected:hover {
  background-color: #eef4ff;
  border-left-color: rgb(24, 64, 128);
}
.groups__item-name {
  font-weight: bold;
}
.groups__item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 14px;
  color: #6b7280;
}
.groups__item-expired {
  display: none;
  font-weight: bold;
}
.groups__item--expired .groups__item-meta {
  color: #dc2626;
}
.groups__item--expired .groups__item-expired {
  display: inline;
}

/* --- detail --- */
.groups__detail {
  flex: 1 1 auto;
  min-width: 0;
}
.groups__placeholder {
  padding: 40px 20px;
  text-align: center;
  color: #6b7280;
  background-color: white;
  border-radius: 16px;
  border: 1px dashed #d1d5db;
}
.groups__content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.groups__container--busy {
  opacity: 0.6;
  pointer-events: none;
}
.groups__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.groups__name {
  margin: 0;
  font-size: 24px;
  font-weight: bold;
}
.groups__id {
  color: #6b7280;
}
.groups__badge {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: bold;
  white-space: nowrap;
}
.groups__badge--valid {
  background-color: #dcfce7;
  color: #166534;
}
.groups__badge--expired {
  background-color: #fee2e2;
  color: #b91c1c;
}

/* --- cards --- */
.groups__card {
  background-color: white;
  border-radius: 16px;
  border: 1px solid #e9edf5;
  overflow: hidden;
}
.groups__card--danger {
  border-color: #fca5a5;
}
.groups__card--danger .groups__card-header {
  color: #b91c1c;
}
.groups__card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  border-bottom: 2px solid #e9edf5;
  font-size: 20px;
  font-weight: bold;
}
.groups__card-meta {
  font-size: 14px;
  font-weight: normal;
  color: #6b7280;
}
.groups__card-body {
  padding: 10px;
}
.groups__delete-hint .groups__card-body {
  color: #6b7280;
}
.groups__row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.groups__row--spread {
  justify-content: space-between;
}
.groups__license {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}
.groups__field {
  flex: 1 1 260px;
}
.groups__field .custom-select,
.groups__field .form-control {
  width: auto;
  min-width: 0;
}
.groups__limit {
  max-width: 110px;
}

/* --- subcategory and user lines --- */
.groups__subcategories,
.groups__users {
  list-style: none;
  padding: 0;
  margin: 0;
}
.groups__line {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-bottom: 1px solid #e9edf5;
}
.groups__line:last-child {
  border-bottom: none;
}
.groups__line--empty {
  color: #6b7280;
}
.groups__user-name {
  flex: 0 0 160px;
  font-weight: bold;
  overflow-wrap: anywhere;
}
.groups__user-full-name {
  flex: 1 1 auto;
}
.groups__user-action {
  flex: 0 0 80px;
  text-align: right;
}
.groups__role {
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 13px;
  background-color: #f3f4f6;
  color: #374151;
}
.groups__role--superAdmin {
  background-color: #ede9fe;
  color: #5b21b6;
}
.groups__role--admin {
  background-color: #dbeafe;
  color: #1e40af;
}

/* --- switch (Bootstrap 4.1 has no custom-switch) --- */
.groups__switch {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  cursor: pointer;
}
.groups__switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.groups__switch-track {
  position: relative;
  flex: 0 0 40px;
  height: 22px;
  border-radius: 999px;
  background-color: #d1d5db;
  transition: background-color 0.2s;
}
.groups__switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: white;
  transition: transform 0.2s;
}
.groups__switch input:checked + .groups__switch-track {
  background-color: rgb(24, 64, 128);
}
.groups__switch input:checked + .groups__switch-track::after {
  transform: translateX(18px);
}
.groups__switch input:focus-visible + .groups__switch-track {
  box-shadow: 0 0 0 3px rgba(24, 64, 128, 0.35);
}

@media (max-width: 900px) {
  .groups__container {
    flex-direction: column;
    align-items: stretch;
  }
  .groups__sidebar {
    flex-basis: auto;
  }
}
