/* ChatFox profiles screen cleanup */

.top-bar {
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 18px !important;
  min-width: 0 !important;
  padding: 11px 16px !important;
  min-height: 58px !important;
  border-bottom: 1px solid #252a33 !important;
  background: #151820 !important;
}

.top-bar-left {
  flex: 0 0 auto !important;
  min-width: max-content !important;
}

/* Actions start from the left, immediately after the folder title. */
.top-bar-right {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  flex-wrap: nowrap !important;
  gap: 10px !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  margin-left: 0 !important;
  padding-right: 168px !important; /* reserve space for fixed "Сменить раздел" */
  overflow: visible !important;
}

.top-bar-right > * {
  flex: 0 0 auto !important;
}

.top-bar-right .action-btn,
#mpc-open-btn,
#mpr-open-btn {
  height: 36px !important;
  min-height: 36px !important;
  padding: 7px 14px !important;
  font-size: 12.5px !important;
  line-height: 1 !important;
  margin-right: 0 !important;
  border-radius: 8px !important;
  box-shadow: none !important;
}

.top-bar-right .action-btn svg,
#mpc-open-btn svg,
#mpr-open-btn svg {
  width: 14px !important;
  height: 14px !important;
}

/* Search occupies the free space on the right, but never under the hub switch. */
.top-bar-right .search-box {
  margin-left: auto !important;
  min-width: 160px !important;
  width: 185px !important;
  max-width: 185px !important;
  height: 36px !important;
  flex: 0 0 185px !important;
}

/* Hub switch stays on the far right and no longer overlaps search. */
#chatfox-switch-app {
  top: 11px !important;
  right: 12px !important;
  height: 36px !important;
  padding: 7px 12px !important;
  box-sizing: border-box !important;
  z-index: 9990 !important;
}

/* Keep only the bulk actions actually used in this workflow. */
[data-testid="mass-launch-btn"],
[data-testid="mass-stop-btn"],
[data-testid="mass-delete-btn"] {
  display: none !important;
}

/* When profiles are selected, hide only actions the user asked to remove. */
body:has([data-testid="mass-move-btn"]) [data-testid="create-profile-btn"],
body:has([data-testid="mass-move-btn"]) [data-testid="quick-profile-btn"] {
  display: none !important;
}

/* Keep folder title readable. */
.folder-title {
  white-space: nowrap !important;
}

/* Table/header span the full content width with no side gaps. */
.content-area {
  padding: 0 0 16px !important;
}

.profile-table {
  width: 100% !important;
  margin: 0 !important;
  border-collapse: collapse !important;
}

/* Entire table header row is white from edge to edge. */
.profile-table thead,
.profile-table thead tr,
.profile-table thead th {
  background: #ffffff !important;
}

.profile-table thead th {
  color: #111827 !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  padding: 6px 10px !important;
  height: 30px !important;
  line-height: 18px !important;
  top: 0 !important;
  vertical-align: middle !important;
  border-top: 0 !important;
  border-bottom: 1px solid #d7dbe1 !important;
}

/* Keep comfortable inset for the first/last header cells. */
.profile-table thead th:first-child {
  padding-left: 22px !important;
}
.profile-table thead th:last-child {
  padding-right: 22px !important;
}

/* Header checkbox remains visible on white background. */
.profile-table thead .custom-checkbox {
  border-color: #6b7280 !important;
  background: #ffffff !important;
}

/* Hide per-profile Cashinout button. */
[data-testid^="support-btn-"] {
  display: none !important;
}

/* Hide per-profile Dolphin Scenario button. */
[data-testid^="dolphin-scenario-btn-"] {
  display: none !important;
}

/* Proper visual spacing between toolbar actions. */
#mpr-open-btn,
#mpc-open-btn {
  margin-right: 10px !important;
}

.top-bar-right > a {
  margin-right: 10px !important;
}

.top-bar-right > .action-btn,
.top-bar-right > button {
  margin-right: 10px !important;
}

/* Do not add extra space after search/utility controls. */
.top-bar-right .search-box,
.top-bar-right [data-testid="refresh-btn"],
.top-bar-right [data-testid="filter-btn"] {
  margin-right: 0 !important;
}
