/* Multi-branch administrator assignment and branch switching */
#admin .admin-permission-group {
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid #dce6f2;
  border-radius: 12px;
  background: #fff;
}

#admin .admin-permission-group legend {
  padding: 0 5px;
  color: #27538f;
  font-size: 13px;
  font-weight: 850;
}

#admin .admin-permission-group-options {
  display: grid;
  gap: 8px;
}

#admin .admin-permission-option {
  align-items: flex-start !important;
}

#admin .admin-permission-option input {
  flex: 0 0 auto;
  margin: 2px 0 0 !important;
}

#admin .admin-permission-option-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

#admin .admin-permission-option-copy b {
  color: #243c5d;
  font-size: 13px;
  line-height: 1.35;
}

#admin .admin-permission-option-copy small {
  color: #697d99;
  font-size: 11px;
  line-height: 1.5;
}

#admin .branch-assignment-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

#admin .branch-assignment-fieldset legend {
  width: 100%;
  margin: 0 0 8px;
  padding: 0;
  color: #52657f;
  font-size: 12px;
  font-weight: 800;
}

#admin .branch-assignment-fieldset legend small {
  margin-left: 5px;
  color: #8190a6;
  font-size: 10px;
  font-weight: 700;
}

#admin .branch-assignment-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 218px;
  padding: 9px;
  overflow: auto;
  border: 1px solid #d7e2f0;
  border-radius: 12px;
  background: #f7faff;
  scrollbar-width: thin;
}

#admin .branch-assignment-option {
  display: flex !important;
  align-items: center;
  gap: 10px !important;
  min-width: 0;
  min-height: 52px;
  margin: 0 !important;
  padding: 9px 11px;
  border: 1px solid #e0e8f3;
  border-radius: 10px;
  background: #fff;
  color: #253c5d !important;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

#admin .branch-assignment-option:hover {
  border-color: #adc4e7;
  background: #f9fbff;
}

#admin .branch-assignment-option:has(input:checked) {
  border-color: #7ba4e4;
  background: #edf4ff;
  box-shadow: inset 0 0 0 1px rgba(54, 111, 204, .1);
}

#admin .branch-assignment-option input {
  width: 18px !important;
  height: 18px !important;
  min-height: 0 !important;
  margin: 0 !important;
  flex: 0 0 auto;
  accent-color: #2f6fd1;
}

#admin .branch-assignment-option > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

#admin .branch-assignment-option b {
  overflow: hidden;
  color: #1f3658;
  font-size: 13px;
  font-weight: 820;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#admin .branch-assignment-option small {
  color: #7c8ca3;
  font-size: 10px;
  font-weight: 700;
  text-align: left !important;
}

#admin .branch-assignment-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 16px;
  color: #7b8aa0;
  font-size: 12px;
  text-align: center;
}

#admin #branches-pane .manager-account-row {
  align-items: flex-start;
  flex-wrap: wrap;
}

#admin #branches-pane .manager-account-identity {
  align-content: start;
  min-width: 190px;
}

#admin #branches-pane .manager-account-identity > small {
  max-width: 420px;
  overflow: hidden;
  color: #657791;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#admin #branches-pane .manager-account-actions {
  justify-items: end;
  min-width: min(100%, 360px);
}

#admin #branches-pane .manager-account-actions > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 4px;
}

#admin #branches-pane .manager-account-actions .rider-action {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 11px;
}

#admin .manager-branch-editor {
  display: grid;
  width: 100%;
  gap: 12px;
  margin-top: 5px;
  padding: 16px;
  border-top: 1px solid #e1e9f4;
  border-radius: 0 0 12px 12px;
  background: #f8fbff;
}

#admin .manager-branch-editor[hidden] {
  display: none !important;
}

#admin .manager-branch-editor-head {
  display: flex !important;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

#admin .manager-branch-editor-head > div {
  display: grid;
  gap: 3px;
}

#admin .manager-branch-editor-head b {
  color: #1f3659;
  font-size: 14px;
}

#admin .manager-branch-editor-head p {
  margin: 0;
  color: #74849b;
  font-size: 11px;
  text-align: left;
}

#admin .manager-branch-editor-head > span {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  background: #e9f2ff;
  color: #2c62b6;
  font-size: 10px;
  font-weight: 800;
}

#admin .manager-branch-editor-actions {
  display: flex !important;
  justify-content: flex-end;
  gap: 7px;
}

#admin .manager-branch-editor-actions .rider-action {
  min-height: 36px;
}

@media (max-width: 720px) {
  #admin .branch-assignment-options {
    grid-template-columns: 1fr;
    max-height: 240px;
  }

  #admin #branches-pane .manager-account-identity,
  #admin #branches-pane .manager-account-actions {
    width: 100%;
    min-width: 0;
  }

  #admin #branches-pane .manager-account-actions {
    justify-items: start;
  }

  #admin #branches-pane .manager-account-actions > small,
  #admin #branches-pane .manager-account-actions > p {
    text-align: left;
  }

  #admin #branches-pane .manager-account-actions > div,
  #admin .manager-branch-editor-actions {
    width: 100%;
    justify-content: flex-start;
  }

  #admin .manager-branch-editor {
    padding: 14px 0 2px;
    background: transparent;
  }
}

@media (max-width: 460px) {
  #admin #branches-pane .manager-account-actions > div {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #admin #branches-pane .manager-account-actions [data-manager-branch-toggle] {
    grid-column: 1 / -1;
  }

  #admin #branches-pane .manager-account-actions .rider-action {
    width: 100%;
  }
}
